类 SubAgentConfig.Builder

java.lang.Object
io.agentscope.core.tool.subagent.SubAgentConfig.Builder
封闭类:
SubAgentConfig

public static class SubAgentConfig.Builder extends Object
Builder for SubAgentConfig.
  • 方法详细资料

    • toolName

      public SubAgentConfig.Builder toolName(String 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

      public SubAgentConfig.Builder description(String description)
      Sets the tool description.

      If not set, the description is derived from the agent's description.

      参数:
      description - The description
      返回:
      This builder
    • forwardEvents

      public SubAgentConfig.Builder forwardEvents(boolean 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

      public SubAgentConfig.Builder streamOptions(StreamOptions 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

      public SubAgentConfig.Builder session(Session 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 InMemorySession is used by default.

      To enable persistent conversations across process restarts, use a persistent session implementation like JsonSession.

      参数:
      session - The session instance
      返回:
      This builder
    • build

      public SubAgentConfig build()
      Builds the configuration.
      返回:
      New SubAgentConfig instance