RemoteSubagentTransport
public interface RemoteSubagentTransport
源码Source
io/agentscope/harness/agent/subagent/task/RemoteSubagentTransport.java:27–59定义远程子智能体传输层契约的接口。位于 io.agentscope.harness.agent.subagent.task 包。核心成员包括 transportType、submit、getStatus、waitForResult、cancel、resume。
Transport abstraction for remote subagent execution (Agent Protocol today; A2A later).
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String transportType() | 返回传输层类型。 Stable transport type string persisted on `TaskRecord#getTransportType()`. |
public void submit(RemoteTarget target, String taskId, String agentId, String input, RemoteSubmitContext context) throws Exception | 执行提交相关操作。 Performs the submit operation. |
public RemoteTaskStatus getStatus(RemoteTarget target, String taskId) throws Exception | 获取状态。 Returns the status. |
public String waitForResult(RemoteTarget target, String taskId, long timeoutSeconds) throws Exception | 等待用于结果。 Performs the wait for result operation. |
public void cancel(RemoteTarget target, String taskId) throws Exception | 执行取消相关操作。 Performs the cancel operation. |
public void resume(RemoteTarget target, String taskId, List<RemoteConfirmDecision> decisions) throws Exception | 执行恢复相关操作。 Performs the resume operation. |
default public Closeable streamEvents(RemoteTarget target, String taskId, long fromSeq, Consumer<RemoteAgentEvent> consumer)default | 执行事件。 Opens an event stream for the remote task. |
方法详情Method Detail
transportType
public String transportType()
返回传输层类型。
Stable transport type string persisted on TaskRecord#getTransportType().
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/subagent/task/RemoteSubagentTransport.java:30submit
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/RemoteSubagentTransport.java:32–38getStatus
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/RemoteSubagentTransport.java:40waitForResult
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/RemoteSubagentTransport.java:42cancel
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/RemoteSubagentTransport.java:44resume
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/RemoteSubagentTransport.java:46–47streamEvents
default public Closeable streamEvents(RemoteTarget target, String taskId, long fromSeq, Consumer<RemoteAgentEvent> consumer)
default
执行事件。
Opens an event stream for the remote task.
参数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。closeable handle that stops the subscription
源码Source
io/agentscope/harness/agent/subagent/task/RemoteSubagentTransport.java:55–58