Class AgentConfig.Builder
java.lang.Object
io.agentscope.extensions.scheduler.config.AgentConfig.Builder
- Direct Known Subclasses:
RuntimeAgentConfig.Builder
- Enclosing class:
- AgentConfig
Builder for creating AgentConfig instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the AgentConfig instance.modelConfig(ModelConfig modelConfig) Set the model configuration (required).Set the agent name (required).Set the system prompt (optional).
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
name
Set the agent name (required).The name is used as the identifier for the scheduled agent and should be unique.
- Parameters:
name- The agent name- Returns:
- This builder
-
modelConfig
Set the model configuration (required).ModelConfig provides a flexible way to configure model settings. Use
DashScopeModelConfigfor DashScope models.Example:
ModelConfig config = DashScopeModelConfig.builder() .apiKey(apiKey) .modelName("qwen-max") .stream(true) .build(); AgentConfig agentConfig = AgentConfig.builder() .name("MyAgent") .modelConfig(config) .build();- Parameters:
modelConfig- The model configuration- Returns:
- This builder
-
sysPrompt
Set the system prompt (optional).The system prompt defines the agent's role and behavior.
- Parameters:
sysPrompt- The system prompt- Returns:
- This builder
-
build
Build the AgentConfig instance.- Returns:
- A new AgentConfig instance
- Throws:
IllegalArgumentException- if required fields are missing or invalid
-