pub trait MultiAgent: Send + Sync {
// Required methods
fn role(&self) -> AgentRole;
fn handle_message<'life0, 'async_trait>(
&'life0 self,
message: AgentMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentMessage>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for agents that can participate in multi-agent systems
Required Methods§
Sourcefn handle_message<'life0, 'async_trait>(
&'life0 self,
message: AgentMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_message<'life0, 'async_trait>(
&'life0 self,
message: AgentMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an incoming message from another agent