AgentProtocolTransport
public final class AgentProtocolTransport implements RemoteSubagentTransport
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:28–102智能体协议传输层,支持智能体之间的发现、委派与协作。位于 io.agentscope.harness.agent.subagent.task 包,实现 RemoteSubagentTransport。核心成员包括 transportType、submit、getStatus、waitForResult、cancel、resume。
RemoteSubagentTransport backed by the Agent Protocol HTTP client.
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
TYPEstaticfinal | String | 类型字段。 The TYPE field. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public AgentProtocolTransport() | 初始化 `AgentProtocolTransport` 实例。 Creates a new instance. |
public AgentProtocolTransport(AgentProtocolTaskClient client) | 初始化 `AgentProtocolTransport` 实例。 Creates a new instance. |
方法摘要Method Summary
字段详情Field Detail
TYPE
public static final String TYPE
staticfinal
类型字段。声明为 public static final String TYPE。
The TYPE field.
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:30构造器详情Constructor Detail
AgentProtocolTransport
public AgentProtocolTransport()
初始化 AgentProtocolTransport 实例。
Creates a new instance.
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:36–38AgentProtocolTransport
public AgentProtocolTransport(AgentProtocolTaskClient client)
初始化 AgentProtocolTransport 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
client | AgentProtocolTaskClient | 客户端(类型 `AgentProtocolTaskClient`)。The client. |
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:40–42方法详情Method Detail
transportType
public String transportType()
返回传输层类型。
Returns the transport type.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:44–47submit
public void submit(RemoteTarget target, String taskId, String agentId, String input, RemoteSubmitContext context) throws Exception
执行提交相关操作。
Performs the submit operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
target | RemoteTarget | 目标(类型 `RemoteTarget`)。The target. |
taskId | String | 任务标识(类型 `String`)。The task id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
input | String | 输入消息(类型 `String`)。The input. |
context | RemoteSubmitContext | 上下文(类型 `RemoteSubmitContext`)。The context. |
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:49–64getStatus
public RemoteTaskStatus getStatus(RemoteTarget target, String taskId) throws Exception
获取状态。
Returns the status.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
target | RemoteTarget | 目标(类型 `RemoteTarget`)。The target. |
taskId | String | 任务标识(类型 `String`)。The task id. |
RemoteTaskStatus返回RemoteTaskStatus。Returns remote task status.
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:66–69waitForResult
public String waitForResult(RemoteTarget target, String taskId, long timeoutSeconds) throws Exception
等待用于结果。
Performs the wait for result operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
target | RemoteTarget | 目标(类型 `RemoteTarget`)。The target. |
taskId | String | 任务标识(类型 `String`)。The task id. |
timeoutSeconds | long | 超时秒(类型 `long`)。The timeout seconds. |
String返回字符串结果。Returns a string.
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:71–75cancel
public void cancel(RemoteTarget target, String taskId) throws Exception
执行取消相关操作。
Performs the cancel operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
target | RemoteTarget | 目标(类型 `RemoteTarget`)。The target. |
taskId | String | 任务标识(类型 `String`)。The task id. |
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:77–80resume
public void resume(RemoteTarget target, String taskId, List<RemoteConfirmDecision> decisions) throws Exception
执行恢复相关操作。
Performs the resume operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
target | RemoteTarget | 目标(类型 `RemoteTarget`)。The target. |
taskId | String | 任务标识(类型 `String`)。The task id. |
decisions | List<RemoteConfirmDecision> | decisions(类型 `List`)。The decisions. |
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:82–86streamEvents
public Closeable streamEvents(RemoteTarget target, String taskId, long fromSeq, Consumer<RemoteAgentEvent> consumer)
执行事件。
Streams the events.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
target | RemoteTarget | 目标(类型 `RemoteTarget`)。The target. |
taskId | String | 任务标识(类型 `String`)。The task id. |
fromSeq | long | 来自 Seq(类型 `long`)。The from seq. |
consumer | Consumer<RemoteAgentEvent> | 消费者(类型 `Consumer`)。The consumer. |
Closeable返回Closeable。Returns closeable.
源码Source
io/agentscope/harness/agent/subagent/task/AgentProtocolTransport.java:88–101