use crate::persona::Persona;
use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AgentId(String);
impl AgentId {
pub fn new(name: impl Into<String>) -> Self {
Self(name.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
}
impl fmt::Display for AgentId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.0)
}
}
pub trait Agent {
fn id(&self) -> &AgentId;
fn persona(&self) -> &Persona;
fn respond(
&mut self,
msg: &crate::message::Message,
) -> Result<crate::message::Message, crate::error::ProserpinaError>;
}