pub struct AgentConfig {
pub name: String,
pub description: Option<String>,
pub system_prompt: Option<String>,
pub model: ModelConfig,
pub tools: Vec<String>,
pub max_steps: u32,
pub max_history: usize,
pub parallel_tool_calls: bool,
pub verification: VerificationConfig,
}Expand description
Configuration for an agent instance
Defines the agent’s identity, behavior, and capabilities.
Fields§
§name: StringAgent name (used in logging and identification)
description: Option<String>Human-readable description of the agent
system_prompt: Option<String>System prompt - instructions for the model
model: ModelConfigModel configuration
tools: Vec<String>List of enabled tool names
max_steps: u32Maximum steps (tool calls) per conversation turn
max_history: usizeMaximum conversation history length (messages to keep)
parallel_tool_calls: boolWhether to allow parallel tool calls
verification: VerificationConfigVerification configuration for auto-build/test
Implementations§
Source§impl AgentConfig
impl AgentConfig
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Set the system prompt
Sourcepub fn with_model(self, model: ModelConfig) -> Self
pub fn with_model(self, model: ModelConfig) -> Self
Set the model configuration
Sourcepub fn with_tools(self, tools: Vec<String>) -> Self
pub fn with_tools(self, tools: Vec<String>) -> Self
Set enabled tools
Sourcepub fn with_max_steps(self, max_steps: u32) -> Self
pub fn with_max_steps(self, max_steps: u32) -> Self
Set maximum steps
Sourcepub fn with_max_history(self, max_history: usize) -> Self
pub fn with_max_history(self, max_history: usize) -> Self
Set maximum history length
Sourcepub fn with_parallel_tool_calls(self, parallel: bool) -> Self
pub fn with_parallel_tool_calls(self, parallel: bool) -> Self
Set whether to allow parallel tool calls
Sourcepub fn with_verification(self, verification: VerificationConfig) -> Self
pub fn with_verification(self, verification: VerificationConfig) -> Self
Set verification configuration
Sourcepub fn build_system_prompt(&self, store: &PromptStore) -> String
pub fn build_system_prompt(&self, store: &PromptStore) -> String
Build the system prompt using the PromptStore
This composes the system prompt from multiple layers:
- Base prompt (agent identity)
- Provider-specific instructions (based on model)
- Environment context (working dir, git status, date)
- Verification instructions (if enabled)
If a custom system_prompt is set, it takes precedence.
Sourcepub fn build_system_prompt_with_env(
&self,
store: &PromptStore,
env: EnvironmentContext,
) -> String
pub fn build_system_prompt_with_env( &self, store: &PromptStore, env: EnvironmentContext, ) -> String
Build system prompt with custom environment context