pub struct AgentConfig {Show 13 fields
pub system_prompt: Option<String>,
pub system_prompt_file: Option<PathBuf>,
pub tool_instructions: Option<String>,
pub model: String,
pub max_tokens_per_turn: u32,
pub temperature: Option<f32>,
pub budget_warning_threshold: f32,
pub max_turns: Option<u32>,
pub provider_params: Option<Value>,
pub provider_tool_defaults: Option<Value>,
pub output_schema: Option<OutputSchema>,
pub structured_output_retries: u32,
pub extraction_prompt: Option<String>,
}Expand description
Agent behavior configuration
Fields§
§system_prompt: Option<String>System prompt to prepend
system_prompt_file: Option<PathBuf>Path to system prompt file (alternative to inline system_prompt)
tool_instructions: Option<String>Optional tool usage instructions appended to system prompt
model: StringModel identifier (provider-specific)
max_tokens_per_turn: u32Maximum tokens to generate per turn
temperature: Option<f32>Temperature for sampling
budget_warning_threshold: f32Warning threshold for budget (0.0-1.0)
max_turns: Option<u32>Maximum turns before forced stop
provider_params: Option<Value>Provider-specific parameters (e.g., thinking config, reasoning effort)
This is a generic JSON bag that providers can extract provider-specific options from. Each provider implementation is responsible for reading and applying relevant parameters.
provider_tool_defaults: Option<Value>Provider-native tool defaults resolved at factory build time.
Intentionally non-persisted (#[serde(skip)]): re-derived on every
build (including resume) from Config.provider_tools +
ModelProfile.supports_web_search. This means config changes (e.g.,
disabling web search) take effect immediately on resumed sessions without
requiring session recreation. Explicit per-request overrides live in
provider_params which IS persisted.
Merged with provider_params per-turn via RFC 7396 merge-patch.
output_schema: Option<OutputSchema>Output schema for structured output extraction.
When set, the agent will perform an extraction turn after completing the agentic work, forcing the LLM to output validated JSON. The final response text becomes the schema-only JSON string.
structured_output_retries: u32Maximum retries for structured output validation failures.
extraction_prompt: Option<String>Custom prompt for the structured output extraction turn.
When output_schema is set, this prompt is sent as a user message
after the agentic loop to elicit schema-valid JSON. Defaults to a
built-in prompt if None.
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§fn clone(&self) -> AgentConfig
fn clone(&self) -> AgentConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more