omni_agent/
agent.rs

1use uuid::Uuid;
2use std::result::Result;
3
4pub struct Agent {
5    id: Uuid,
6    name: String,
7    version: String,
8}
9
10impl Agent {
11    pub fn new(name: String, version: String) -> Self {
12        Self {
13            id: Uuid::new_v4(),
14            name,
15            version,
16        }
17    }
18    
19    pub fn id(&self) -> Uuid {
20        self.id
21    }
22    
23    pub fn name(&self) -> &str {
24        &self.name
25    }
26    
27    pub fn version(&self) -> &str {
28        &self.version
29    }
30    pub async fn start() -> Result<Self, std::io::Error> {
31        let agent = Agent::new("OmniAgent".to_string(), env!("CARGO_PKG_VERSION").to_string());
32        Ok(agent)
33    }
34}