Skip to main content

AgentBehavior

Trait AgentBehavior 

Source
pub trait AgentBehavior: Send + Sync {
    // Provided methods
    fn on_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 AgentContext,
        _msg: InboundMessage,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn on_message_control<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 AgentContext,
        msg: InboundMessage,
    ) -> Pin<Box<dyn Future<Output = Result<AgentTurnControl>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn on_event<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 AgentContext,
        _event: Event,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn on_heartbeat<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 AgentContext,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn decide<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 AgentContext,
        _msg: &'life2 InboundMessage,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}

Provided Methods§

Source

fn on_message<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 AgentContext, _msg: InboundMessage, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn on_event<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 AgentContext, _event: Event, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn decide<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 AgentContext, _msg: &'life2 InboundMessage, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Stub for LLM reasoning. Returns empty string by default.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§