AS AgentScopeAPI 手册 / API Reference

SubagentGatewayBridge

@FunctionalInterface public interface SubagentGatewayBridge
源码Source io/agentscope/harness/agent/gateway/SubagentGatewayBridge.java:29–50

定义子智能体网关 Bridge契约的接口。位于 io.agentscope.harness.agent.gateway 包。核心成员包括 expose。

Bridge between io.agentscope.harness.agent.tool.AgentSpawnTool and the gateway layer. Allows spawned subagents to be exposed as user-addressable entry points without the spawn tool needing to know about channels, routers, or the gateway implementation.

When a subagent is exposed, the gateway assigns it a subagentId that the user can use to send messages directly to that subagent, bypassing normal binding-based routing.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
ExposeResult记录record
承载 Expose 结果数据的记录类型。
Result of exposing a subagent to the user.

方法摘要Method Summary

方法Method说明Description
public ExposeResult expose(String agentId, String sessionId, Agent agent, OutboundAddress replyTo)
执行 `expose` 方法。
Exposes a spawned subagent as a user-addressable entry point in the gateway.

方法详情Method Detail

expose

public ExposeResult expose(String agentId, String sessionId, Agent agent, OutboundAddress replyTo)

执行 expose 方法。

Exposes a spawned subagent as a user-addressable entry point in the gateway.

参数Parameters
名称Name类型Type说明Description
agentIdString智能体标识(类型 `String`)。the subagent type identifier
sessionIdString会话标识(类型 `String`)。the session id assigned to the subagent
agentAgent智能体实例。the agent instance
replyToOutboundAddress回复到(类型 `OutboundAddress`)。the outbound address for delivering replies back to the user's channel; may be null if no outbound channel context is available
返回Returns ExposeResult
返回ExposeResult。the expose result containing the subagentId handle
源码Source io/agentscope/harness/agent/gateway/SubagentGatewayBridge.java:49

嵌套类详情Nested Class Detail

ExposeResult

record ExposeResult(String subagentId)

承载 Expose 结果数据的记录类型。位于 io.agentscope.harness.agent.gateway 包。核心成员包括 subagentId。

Result of exposing a subagent to the user.

基于官方固定版本源码静态生成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.