类 SubAgentConfig.Builder
java.lang.Object
io.agentscope.core.tool.subagent.SubAgentConfig.Builder
- 封闭类:
SubAgentConfig
Builder for SubAgentConfig.
-
方法概要
修饰符和类型方法说明build()Builds the configuration.description(String description) Sets the tool description.forwardEvents(boolean forwardEvents) Sets whether to forward sub-agent events to the parent agent.Sets the session for conversation state management.streamOptions(StreamOptions streamOptions) Sets the stream options for event forwarding.Sets the tool name.
-
方法详细资料
-
toolName
Sets the tool name.If not set, the tool name is derived from the agent's name.
- 参数:
toolName- The tool name- 返回:
- This builder
-
description
Sets the tool description.If not set, the description is derived from the agent's description.
- 参数:
description- The description- 返回:
- This builder
-
forwardEvents
Sets whether to forward sub-agent events to the parent agent.When enabled, events from the sub-agent (reasoning chunks, tool execution chunks) are forwarded via ToolEmitter to the parent agent's hooks.
- 参数:
forwardEvents- true to forward events (default: true)- 返回:
- This builder
-
streamOptions
Sets the stream options for event forwarding.Controls which event types to forward and streaming mode. Only applicable when
forwardEvents(boolean)is true.- 参数:
streamOptions- The stream options (null for defaults)- 返回:
- This builder
-
session
Sets the session for conversation state management.The session is used to persist and restore sub-agent state across conversation turns. If not set, an
InMemorySessionis used by default.To enable persistent conversations across process restarts, use a persistent session implementation like
JsonSession.- 参数:
session- The session instance- 返回:
- This builder
-
build
Builds the configuration.- 返回:
- New SubAgentConfig instance
-