Skip to main content

ToolBackgroundHook

Trait ToolBackgroundHook 

Source
pub trait ToolBackgroundHook: Send + Sync {
    // Provided methods
    fn on_background_start<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 BaseCtx,
        _task_id: &'life2 str,
        _args: Json,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn on_background_progress<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 BaseCtx,
        _task_id: String,
        _output: ToolOutput<Json>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn on_background_end<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 BaseCtx,
        _task_id: String,
        _output: ToolOutput<Json>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Provided Methods§

Source

fn on_background_start<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 BaseCtx, _task_id: &'life2 str, _args: Json, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called when a tool starts a background task.

Source

fn on_background_progress<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 BaseCtx, _task_id: String, _output: ToolOutput<Json>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called when a tool reports progress from a background task.

Source

fn on_background_end<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 BaseCtx, _task_id: String, _output: ToolOutput<Json>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called with the final output from a background tool task.

Implementors§