AS AgentScopeAPI 手册 / API Reference

SubagentMaterializer

@FunctionalInterface public interface SubagentMaterializer
源码Source io/agentscope/harness/agent/gateway/SubagentMaterializer.java:32–43

定义子智能体物化器契约的接口。位于 io.agentscope.harness.agent.gateway 包。核心成员包括 materialize。

Rebuilds a subagent Agent instance from its type id. Used by HarnessGateway to recover an exposed subagent on a node that does not hold the live instance (after a restart or when a request is routed to a different replica).

Typically backed by DefaultAgentManager::createAgentIfPresent. The rebuilt agent is invoked with the sessionId carried by the SubagentRecord, so a distributed io.agentscope.core.state.AgentStateStore restores the prior conversation history.

方法摘要Method Summary

方法Method说明Description
public Optional<Agent> materialize(String agentId, RuntimeContext parentRc)
执行 `materialize` 方法。
Materializes an agent of the given type.

方法详情Method Detail

materialize

public Optional<Agent> materialize(String agentId, RuntimeContext parentRc)

执行 materialize 方法。

Materializes an agent of the given type.

参数Parameters
名称Name类型Type说明Description
agentIdString智能体标识(类型 `String`)。the subagent type identifier
parentRcRuntimeContext父级 Rc(类型 `RuntimeContext`)。a runtime context carrying at least the target session id
返回Returns Optional<Agent>
返回可选。the rebuilt agent, or `Optional#empty()` if the type is unknown / not spawnable
源码Source io/agentscope/harness/agent/gateway/SubagentMaterializer.java:42
基于官方固定版本源码静态生成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.