Skip to main content

ToolExecute

Trait ToolExecute 

Source
pub trait ToolExecute: Send + Sync {
    type Input: DeserializeOwned + JsonSchema;

    // Required method
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        input: Self::Input,
        ctx: &'life1 ToolContext,
    ) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Typed tool execution trait — used with #[derive(Tool)].

Required Associated Types§

Required Methods§

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 self, input: Self::Input, ctx: &'life1 ToolContext, ) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§