Agent

Trait Agent 

Source
pub trait Agent: Send + Sync {
    // Required method
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 AgentContext,
    ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Core Agent trait – all agents must implement this.

Required Methods§

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 AgentContext, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run the agent with the provided context.

Implementors§

Source§

impl Agent for EchoAgent

Source§

impl<M: Model + 'static> Agent for ConfiguredAgent<M>