AS AgentScopeAPI 手册 / API Reference

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().

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/subagent/task/RemoteSubagentTransport.java:30

submit

public void submit(RemoteTarget target, String taskId, String agentId, String input, RemoteSubmitContext context) throws Exception

执行提交相关操作。

Performs the submit operation.

参数Parameters
名称Name类型Type说明Description
targetRemoteTarget目标(类型 `RemoteTarget`)。The target.
taskIdString任务标识(类型 `String`)。The task id.
agentIdString智能体标识(类型 `String`)。The agent id.
inputString输入消息(类型 `String`)。The input.
contextRemoteSubmitContext上下文(类型 `RemoteSubmitContext`)。The context.
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/harness/agent/subagent/task/RemoteSubagentTransport.java:32–38

getStatus

public RemoteTaskStatus getStatus(RemoteTarget target, String taskId) throws Exception

获取状态。

Returns the status.

参数Parameters
名称Name类型Type说明Description
targetRemoteTarget目标(类型 `RemoteTarget`)。The target.
taskIdString任务标识(类型 `String`)。The task id.
返回Returns RemoteTaskStatus
返回RemoteTaskStatus。Returns remote task status.
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/harness/agent/subagent/task/RemoteSubagentTransport.java:40

waitForResult

public String waitForResult(RemoteTarget target, String taskId, long timeoutSeconds) throws Exception

等待用于结果。

Performs the wait for result operation.

参数Parameters
名称Name类型Type说明Description
targetRemoteTarget目标(类型 `RemoteTarget`)。The target.
taskIdString任务标识(类型 `String`)。The task id.
timeoutSecondslong超时秒(类型 `long`)。The timeout seconds.
返回Returns String
返回字符串结果。Returns a string.
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/harness/agent/subagent/task/RemoteSubagentTransport.java:42

cancel

public void cancel(RemoteTarget target, String taskId) throws Exception

执行取消相关操作。

Performs the cancel operation.

参数Parameters
名称Name类型Type说明Description
targetRemoteTarget目标(类型 `RemoteTarget`)。The target.
taskIdString任务标识(类型 `String`)。The task id.
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/harness/agent/subagent/task/RemoteSubagentTransport.java:44

resume

public void resume(RemoteTarget target, String taskId, List<RemoteConfirmDecision> decisions) throws Exception

执行恢复相关操作。

Performs the resume operation.

参数Parameters
名称Name类型Type说明Description
targetRemoteTarget目标(类型 `RemoteTarget`)。The target.
taskIdString任务标识(类型 `String`)。The task id.
decisionsList<RemoteConfirmDecision>decisions(类型 `List`)。The decisions.
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/harness/agent/subagent/task/RemoteSubagentTransport.java:46–47

streamEvents

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
targetRemoteTarget目标(类型 `RemoteTarget`)。The target.
taskIdString任务标识(类型 `String`)。The task id.
fromSeqlong来自 Seq(类型 `long`)。The from seq.
consumerConsumer<RemoteAgentEvent>消费者(类型 `Consumer`)。The consumer.
返回Returns Closeable
返回Closeable。closeable handle that stops the subscription
源码Source io/agentscope/harness/agent/subagent/task/RemoteSubagentTransport.java:55–58
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.