Skip to main content

ToolUseHook

Trait ToolUseHook 

Source
pub trait ToolUseHook: Send + Sync {
    // Required method
    fn apply<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        calls: Vec<ToolCallPayload>,
        ctx: &'life1 HookCtx<'life2>,
    ) -> Pin<Box<dyn Future<Output = HookOutcome> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

The tool-use filter seam this component exposes.

Filters in causa_runtime::filter (FilterChain and friends) implement this trait. The driver calls hook.apply(calls, ctx).await between receiving the model’s ToolCallPayload batch and dispatching it to ToolExecutor.

Required Methods§

Source

fn apply<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, calls: Vec<ToolCallPayload>, ctx: &'life1 HookCtx<'life2>, ) -> Pin<Box<dyn Future<Output = HookOutcome> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Filter the model-emitted batch between receipt and dispatch: return what to execute and what to reject.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§