类 UserAgent.Builder
java.lang.Object
io.agentscope.core.agent.user.UserAgent.Builder
- 封闭类:
UserAgent
Builder for UserAgent.
Provides fluent API for configuring agent name, input method, and hooks. The name is required; other properties have sensible defaults.
-
方法概要
修饰符和类型方法说明build()Build the UserAgent instance.checkRunning(boolean checkRunning) Set the checkRunning flag.description(String description) Set the agent description.Set the hooks for monitoring agent execution.inputMethod(UserInputBase inputMethod) Set the input method for user interaction.Set the agent name (required).
-
方法详细资料
-
name
Set the agent name (required).- 参数:
name- The agent name- 返回:
- This builder
-
description
Set the agent description.- 参数:
description- The agent description- 返回:
- This builder
-
checkRunning
Set the checkRunning flag.- 参数:
checkRunning- The checkRunning flag- 返回:
- This builder
-
inputMethod
Set the input method for user interaction.- 参数:
inputMethod- The input method implementation (defaults to StreamUserInput with System.in/out)- 返回:
- This builder
-
hooks
Set the hooks for monitoring agent execution.- 参数:
hooks- List of hooks- 返回:
- This builder
-
build
Build the UserAgent instance.- 返回:
- A new UserAgent instance
- 抛出:
IllegalArgumentException- if name is null or empty
-