pub struct AgentConfig {
pub max_iterations: usize,
pub model: String,
pub system_prompt: String,
pub max_memory_recalls: usize,
pub max_memory_tokens: Option<usize>,
}Expand description
Configuration for the ReAct agent loop.
Fields§
§max_iterations: usizeMaximum number of Thought-Action-Observation cycles.
model: StringModel identifier passed to the inference function.
system_prompt: StringSystem prompt injected at the start of the conversation.
max_memory_recalls: usizeMaximum number of episodic memories to inject into the prompt. Keeping this small prevents silent token-budget overruns. Default: 3.
max_memory_tokens: Option<usize>Maximum approximate token budget for injected memories. Uses ~4 chars/token heuristic. None means no limit.
Implementations§
Source§impl AgentConfig
impl AgentConfig
Sourcepub fn new(max_iterations: usize, model: impl Into<String>) -> Self
pub fn new(max_iterations: usize, model: impl Into<String>) -> Self
Create a new config with sensible defaults.
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Override the system prompt.
Sourcepub fn with_max_memory_recalls(self, n: usize) -> Self
pub fn with_max_memory_recalls(self, n: usize) -> Self
Set the maximum number of episodic memories injected per run.
Sourcepub fn with_max_memory_tokens(self, n: usize) -> Self
pub fn with_max_memory_tokens(self, n: usize) -> Self
Set a maximum token budget for injected memories (~4 chars/token heuristic).
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 moreAuto 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