SubagentFactory
@FunctionalInterface public interface SubagentFactory
io/agentscope/harness/agent/subagent/SubagentFactory.java:36–48定义子智能体工厂契约的接口。位于 io.agentscope.harness.agent.subagent 包。核心成员包括 create。
Creates a new subagent instance for a single spawn or session. Registered under an agent_id in DefaultAgentManager; each #create(RuntimeContext) call should
return a fresh agent when isolation is required.
This type replaces a raw java.util.function.Supplier for subagent wiring so call sites
and maps are self-documenting.
Phase B-0: Implementations should bake parentRc.getUserId() and
parentRc.getSessionId() into the child agent's persisted SessionKey so that
AgentState stays isolated per (user, parent-session) — regardless of which
io.agentscope.core.state.AgentStateStore backend (Workspace / Redis / InMemory / custom) is
configured. Both fields are nullable; when absent the child falls back to the legacy single
bucket form keyed only by declaration name.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Agent create(RuntimeContext parentRc) | 创建并返回实例。 Builds a new subagent instance for the given parent runtime context. |
方法详情Method Detail
create
public Agent create(RuntimeContext parentRc)
创建并返回实例。
Builds a new subagent instance for the given parent runtime context.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
parentRc | RuntimeContext | 父级 Rc(类型 `RuntimeContext`)。parent agent's runtime context at spawn time; may be `RuntimeContext#empty()` when caller has no scope |
Agentio/agentscope/harness/agent/subagent/SubagentFactory.java:47