pub struct AgentConfig {
pub default_model: String,
pub context_window: usize,
pub reserve_tokens: usize,
pub max_tokens: usize,
pub max_spawn_depth: Option<u8>,
pub subagent_model: Option<String>,
pub fallback_models: Vec<String>,
pub max_tool_repeats: usize,
pub session_max_age: u64,
pub session_max_count: usize,
}Fields§
§default_model: String§context_window: usize§reserve_tokens: usize§max_tokens: usizeMaximum tokens for LLM response
max_spawn_depth: Option<u8>Maximum depth for spawn_agent tool (default: 1, no nested spawning)
- 0: spawn_agent tool disabled
- 1: single level only (subagents cannot spawn more agents)
- 2+: limited nesting allowed (not recommended)
subagent_model: Option<String>Model to use for spawned subagents (default: same as default_model or claude-cli/sonnet)
fallback_models: Vec<String>Fallback models to try if primary provider fails with retryable errors (rate limits, server errors, timeouts). Providers are tried in order. Example: [“openai/gpt-4o”, “ollama/llama3”]
max_tool_repeats: usizeMaximum times the same tool can be called with identical arguments before loop detection triggers. Default: 3. Set to 0 to disable loop detection.
session_max_age: u64Maximum age for session files before pruning (in seconds). 0 = keep forever. Default: 30 days.
session_max_count: usizeMaximum number of sessions to keep per agent. 0 = unlimited. Default: 500.
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§fn clone(&self) -> AgentConfig
fn clone(&self) -> AgentConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentConfig
impl Debug for AgentConfig
Source§impl Default for AgentConfig
impl Default for AgentConfig
Source§impl<'de> Deserialize<'de> for AgentConfig
impl<'de> Deserialize<'de> for AgentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentConfig
impl RefUnwindSafe for AgentConfig
impl Send for AgentConfig
impl Sync for AgentConfig
impl Unpin for AgentConfig
impl UnsafeUnpin for AgentConfig
impl UnwindSafe for AgentConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().