use crate::dynamic_tool::DynamicToolFactory;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
#[derive(Debug, Clone, Default, Serialize, Deserialize, ToSchema)]
pub struct DefinitionOverrides {
pub model: Option<String>,
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub max_iterations: Option<usize>,
pub instructions: Option<String>,
pub use_browser: Option<bool>,
pub remote: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub dynamic_tools: Option<Vec<DynamicToolFactory>>,
}
impl DefinitionOverrides {
pub fn new() -> Self {
Self::default()
}
pub fn with_model(mut self, model: String) -> Self {
self.model = Some(model);
self
}
pub fn with_temperature(mut self, temperature: f32) -> Self {
self.temperature = Some(temperature);
self
}
pub fn with_max_tokens(mut self, max_tokens: u32) -> Self {
self.max_tokens = Some(max_tokens);
self
}
pub fn with_max_iterations(mut self, max_iterations: usize) -> Self {
self.max_iterations = Some(max_iterations);
self
}
pub fn with_instructions(mut self, instructions: String) -> Self {
self.instructions = Some(instructions);
self
}
pub fn with_browser_enabled(mut self, enabled: bool) -> Self {
self.use_browser = Some(enabled);
self
}
pub fn with_dynamic_tools(mut self, tools: Vec<DynamicToolFactory>) -> Self {
self.dynamic_tools = Some(tools);
self
}
}