Skip to main content

MultiAgent

Trait MultiAgent 

Source
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§

Source

fn role(&self) -> AgentRole

Get this agent’s role

Source

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

Source

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,

Process a user request

Implementors§