use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum ConversationMode {
Stateless,
Stateful,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentConfig {
pub system_prompt: String,
pub max_iterations: usize,
pub verbose: bool,
pub conversation_mode: ConversationMode,
pub max_conversation_length: usize,
}
impl Default for AgentConfig {
fn default() -> Self {
Self {
system_prompt: "You are a helpful assistant with access to tools. Use tools when needed to provide accurate information.".to_string(),
max_iterations: 10,
verbose: false,
conversation_mode: ConversationMode::Stateless,
max_conversation_length: 50,
}
}
}
impl AgentConfig {
pub fn new() -> Self {
Self::default()
}
pub fn with_system_prompt(mut self, prompt: impl Into<String>) -> Self {
self.system_prompt = prompt.into();
self
}
pub fn with_max_iterations(mut self, max: usize) -> Self {
self.max_iterations = max;
self
}
pub fn with_verbose(mut self, verbose: bool) -> Self {
self.verbose = verbose;
self
}
pub fn with_conversation_mode(mut self, mode: ConversationMode) -> Self {
self.conversation_mode = mode;
self
}
pub fn with_max_conversation_length(mut self, length: usize) -> Self {
self.max_conversation_length = length;
self
}
}