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 |
|---|---|---|
agentId | String | 智能体标识(类型 `String`)。the subagent type identifier |
parentRc | RuntimeContext | 父级 Rc(类型 `RuntimeContext`)。a runtime context carrying at least the target session id |
Optional<Agent>返回可选。the rebuilt agent, or `Optional#empty()` if the type is unknown / not spawnable
源码Source
io/agentscope/harness/agent/gateway/SubagentMaterializer.java:42