AgentTrait

Trait AgentTrait 

Source
pub trait AgentTrait: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn process_task<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        task: &'life1 str,
        context: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, RustChainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn receive_message<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        from: &'life1 str,
        message: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), RustChainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for agents that can work in multi-agent systems

Required Methods§

Source

fn name(&self) -> &str

Source

fn process_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, task: &'life1 str, context: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<String, RustChainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn receive_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, from: &'life1 str, message: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), RustChainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§