#[derive(Clone)]
pub struct AgentConfig {
pub model: String,
pub max_iterations: usize,
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub system: Option<String>,
pub thinking_tag: Option<String>,
}
impl Default for AgentConfig {
fn default() -> Self {
Self {
model: "llama-3.3-70b-versatile".to_string(),
max_iterations: 10,
temperature: Some(0.7),
max_tokens: Some(4096),
system: None,
thinking_tag: None,
}
}
}
impl AgentConfig {
pub fn new(model: impl Into<String>) -> Self {
Self {
model: model.into(),
..Default::default()
}
}
pub fn max_iterations(mut self, n: usize) -> Self {
self.max_iterations = n;
self
}
pub fn temperature(mut self, t: f32) -> Self {
self.temperature = Some(t);
self
}
pub fn max_tokens(mut self, n: u32) -> Self {
self.max_tokens = Some(n);
self
}
pub fn no_max_tokens(mut self) -> Self {
self.max_tokens = None;
self
}
pub fn system(mut self, system: impl Into<String>) -> Self {
self.system = Some(system.into());
self
}
pub fn thinking_tag(mut self, tag: impl Into<String>) -> Self {
self.thinking_tag = Some(tag.into());
self
}
}