31 lines
714 B
Rust
31 lines
714 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct AgentDefinition {
|
|
pub name: String,
|
|
pub role: String,
|
|
pub system_prompt: Option<String>,
|
|
pub allowed_tools: Option<Vec<String>>,
|
|
pub max_steps: Option<usize>,
|
|
pub temperature: Option<f32>,
|
|
}
|
|
|
|
impl AgentDefinition {
|
|
pub fn new(name: String, role: String) -> Self {
|
|
AgentDefinition {
|
|
name,
|
|
role,
|
|
system_prompt: None,
|
|
allowed_tools: None,
|
|
max_steps: None,
|
|
temperature: None,
|
|
}
|
|
}
|
|
|
|
pub fn with_max_steps(mut self, steps: usize) -> Self {
|
|
self.max_steps = Some(steps);
|
|
self
|
|
}
|
|
|
|
}
|