Skip to main content

ToolApprover

Trait ToolApprover 

Source
pub trait ToolApprover:
    Send
    + Sync
    + 'static {
    // Required method
    fn approve<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        tool_name: &'life1 str,
        input: &'life2 Value,
    ) -> Pin<Box<dyn Future<Output = ApprovalDecision> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Available on crate feature async only.
Expand description

Async-callable predicate consulted before each tool dispatch.

Implement this trait for stateful approvers, or use the closure adapter fn_approver / RunOptions::with_approver_fn.

Required Methods§

Source

fn approve<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, tool_name: &'life1 str, input: &'life2 Value, ) -> Pin<Box<dyn Future<Output = ApprovalDecision> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Inspect a pending tool dispatch and return a verdict.

Implementors§