Aistio
public final class Aistio
io/agentscope/extensions/aistio/Aistio.java:52–75Aistio,承载智能体的部署、调度与服务化运行。位于 io.agentscope.extensions.aistio 包。核心成员包括 instrument、newBridge。
Entry point for reporting a self-deployed agent to the aistio control plane.
Full instrumentation, including the Level-2 event stream, needs the observer middleware
registered while the agent is being built, because a ReActAgent's middleware list is
fixed at construction:
`AgentScopeAdapter adapter = new AgentScopeAdapter();
ReActAgent agent = ReActAgent.builder()
.name("Friday")
.model(model)
.middleware(adapter.middleware())
.build();
SessionBridge bridge = Aistio.instrument(agent,
AistioConfig.builder("my-agentscope-agent")
.controlPlaneHttp("http://localhost:8081")
.internalToken(System.getenv("BUILDER_INTERNAL_TOKEN"))
.namespace("default")
.enableEvents(true)
.contractHttpPort(18090)
.build(),
adapter);
`
#instrument(Object, AistioConfig) also works on an agent that is already built. It
reports session snapshots, effective context, history and commands — everything that reads live
state — but emits no events, since there is no way to add a middleware after construction.
The returned bridge is AutoCloseable; close it to detach and release both channels.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static SessionBridge instrument(Object target, AistioConfig config)static | 执行 `instrument` 方法。 Instruments an already-built agent. |
public static SessionBridge instrument(Object target, AistioConfig config, FrameworkAdapter adapter)static | 执行 `instrument` 方法。 Instruments `target` with a pre-built adapter, typically one already wired as a
middleware on the agent. |
public static SessionBridge newBridge(AistioConfig config)static | 创建 `newBridge`。 Creates a bridge without attaching or starting it, for callers that need to hold the adapter
before the agent exists. |
方法详情Method Detail
instrument
public static SessionBridge instrument(Object target, AistioConfig config)
执行 instrument 方法。
Instruments an already-built agent.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
target | Object | 目标(类型 `Object`)。The target. |
config | AistioConfig | 配置对象(类型 `AistioConfig`)。The config. |
SessionBridgeio/agentscope/extensions/aistio/Aistio.java:57–59instrument
public static SessionBridge instrument(Object target, AistioConfig config, FrameworkAdapter adapter)
执行 instrument 方法。
Instruments target with a pre-built adapter, typically one already wired as a middleware on the agent.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
target | Object | 目标(类型 `Object`)。The target. |
config | AistioConfig | 配置对象(类型 `AistioConfig`)。The config. |
adapter | FrameworkAdapter | 适配器(类型 `FrameworkAdapter`)。The adapter. |
SessionBridgeio/agentscope/extensions/aistio/Aistio.java:63–66newBridge
public static SessionBridge newBridge(AistioConfig config)
创建 newBridge。
Creates a bridge without attaching or starting it, for callers that need to hold the adapter before the agent exists.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
config | AistioConfig | 配置对象(类型 `AistioConfig`)。The config. |
SessionBridgeio/agentscope/extensions/aistio/Aistio.java:72–74