类 UserAgent.Builder

java.lang.Object
io.agentscope.core.agent.user.UserAgent.Builder
封闭类:
UserAgent

public static class UserAgent.Builder extends Object
Builder for UserAgent.

Provides fluent API for configuring agent name, input method, and hooks. The name is required; other properties have sensible defaults.

  • 方法详细资料

    • name

      public UserAgent.Builder name(String name)
      Set the agent name (required).
      参数:
      name - The agent name
      返回:
      This builder
    • description

      public UserAgent.Builder description(String description)
      Set the agent description.
      参数:
      description - The agent description
      返回:
      This builder
    • checkRunning

      public UserAgent.Builder checkRunning(boolean checkRunning)
      Set the checkRunning flag.
      参数:
      checkRunning - The checkRunning flag
      返回:
      This builder
    • inputMethod

      public UserAgent.Builder inputMethod(UserInputBase inputMethod)
      Set the input method for user interaction.
      参数:
      inputMethod - The input method implementation (defaults to StreamUserInput with System.in/out)
      返回:
      This builder
    • hooks

      public UserAgent.Builder hooks(List<Hook> hooks)
      Set the hooks for monitoring agent execution.
      参数:
      hooks - List of hooks
      返回:
      This builder
    • build

      public UserAgent build()
      Build the UserAgent instance.
      返回:
      A new UserAgent instance
      抛出:
      IllegalArgumentException - if name is null or empty