Skip to main content

Middleware

Trait Middleware 

Source
pub trait Middleware: Send + Sync {
    // Provided methods
    fn on_user_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 mut UserMessageCtx,
    ) -> Pin<Box<dyn Future<Output = AgentResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn on_pre_llm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 mut PreLlmCtx,
    ) -> Pin<Box<dyn Future<Output = AgentResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn on_post_llm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 mut PostLlmCtx,
    ) -> Pin<Box<dyn Future<Output = AgentResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Provided Methods§

Source

fn on_user_message<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 mut UserMessageCtx, ) -> Pin<Box<dyn Future<Output = AgentResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn on_pre_llm<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 mut PreLlmCtx, ) -> Pin<Box<dyn Future<Output = AgentResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn on_post_llm<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 mut PostLlmCtx, ) -> Pin<Box<dyn Future<Output = AgentResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§