1use super::config::AgentConfig;
4use crate::error::Result;
5use crate::trajectory::TrajectoryRecorder;
6use async_trait::async_trait;
7
8use super::execution::AgentExecution;
9
10pub type AgentResult<T> = Result<T>;
12
13#[async_trait]
15pub trait Agent: Send + Sync {
16 async fn execute_task(&mut self, task: &str) -> AgentResult<AgentExecution>;
18
19 fn config(&self) -> &AgentConfig;
21
22 fn agent_type(&self) -> &str;
24
25 fn set_trajectory_recorder(&mut self, recorder: TrajectoryRecorder);
27
28 fn trajectory_recorder(&self) -> Option<&TrajectoryRecorder>;
30}
31
32