1#[derive(Debug, Clone)]
8#[non_exhaustive]
9pub struct AgentConfig {
10 pub system_prompt: Option<String>,
12
13 pub max_tokens: Option<u32>,
15
16 pub temperature: Option<f32>,
18
19 pub max_iterations: u32,
21
22 pub token_budget: Option<usize>,
24}
25
26impl Default for AgentConfig {
27 fn default() -> Self {
28 Self {
29 system_prompt: None,
30 max_tokens: Some(4096),
31 temperature: Some(0.7),
32 max_iterations: 20,
33 token_budget: None,
34 }
35 }
36}
37
38#[cfg(test)]
39mod tests {
40 use super::*;
41
42 #[test]
43 fn test_default_config() {
44 let config = AgentConfig::default();
45 assert!(config.system_prompt.is_none());
46 assert_eq!(config.max_iterations, 20);
47 assert_eq!(config.max_tokens, Some(4096));
48 assert!(config.token_budget.is_none());
49 assert!((config.temperature.unwrap() - 0.7).abs() < f32::EPSILON);
50 }
51}