pub struct AgentConfig {Show 14 fields
pub name: String,
pub description: Option<String>,
pub model_id: String,
pub system_prompt: Option<String>,
pub max_iterations: usize,
pub timeout_seconds: u64,
pub temperature: Option<f64>,
pub max_tokens: Option<usize>,
pub compaction_strategy: CompactionStrategy,
pub compaction_instruction: Option<String>,
pub context_window: usize,
pub api_key: Option<String>,
pub workspace_dir: Option<PathBuf>,
pub output_mode: Option<String>,
}Expand description
Agent runtime configuration
Fields§
§name: StringAgent name
description: Option<String>Agent description
model_id: StringModel ID to use
system_prompt: Option<String>System prompt
max_iterations: usizeMaximum number of agent iterations
timeout_seconds: u64Timeout in seconds for the entire agent run
temperature: Option<f64>Temperature for generation (0.0 to 1.0)
max_tokens: Option<usize>Maximum tokens to generate
compaction_strategy: CompactionStrategyCompaction strategy for long conversations
compaction_instruction: Option<String>Custom instruction passed to the compactor
context_window: usizeModel context window size (used for threshold-based compaction)
api_key: Option<String>API key override for the provider.
When set, this is injected into oxi_ai::StreamOptions so the
provider uses it instead of an environment variable.
workspace_dir: Option<PathBuf>Working directory for file tools. Defaults to current directory if None.
output_mode: Option<String>Output mode for agent responses.
When set, the agent extracts structured output from the final response.
See OutputMode for available modes.
Implementations§
Source§impl AgentConfig
impl AgentConfig
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_max_iterations(self, max: usize) -> Self
pub fn with_max_iterations(self, max: usize) -> Self
Set the maximum number of agent loop iterations.
Sourcepub fn with_timeout(self, seconds: u64) -> Self
pub fn with_timeout(self, seconds: u64) -> Self
Set the timeout in seconds for the entire agent run.
Sourcepub fn with_compaction_strategy(self, strategy: CompactionStrategy) -> Self
pub fn with_compaction_strategy(self, strategy: CompactionStrategy) -> Self
Set the compaction strategy for long conversations.
Sourcepub fn with_compaction_instruction(self, instruction: impl Into<String>) -> Self
pub fn with_compaction_instruction(self, instruction: impl Into<String>) -> Self
Set a custom instruction passed to the compactor.
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§fn clone(&self) -> AgentConfig
fn clone(&self) -> AgentConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more