nexo_core/agent/agent.rs
1use super::behavior::AgentBehavior;
2use nexo_config::types::agents::AgentConfig;
3use std::sync::Arc;
4pub struct Agent {
5 pub id: String,
6 pub config: Arc<AgentConfig>,
7 pub behavior: Arc<dyn AgentBehavior>,
8}
9impl Agent {
10 pub fn new(config: AgentConfig, behavior: impl AgentBehavior + 'static) -> Self {
11 let id = config.id.clone();
12 Self {
13 id,
14 config: Arc::new(config),
15 behavior: Arc::new(behavior),
16 }
17 }
18}