Skip to main content

Tool

Trait Tool 

Source
pub trait Tool<Deps>: Send + Sync {
    // Required methods
    fn definition(&self) -> ToolDefinition;
    fn call<'life0, 'async_trait>(
        &'life0 self,
        ctx: RunContext<Deps>,
        args: Value,
    ) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn definition(&self) -> ToolDefinition

Source

fn call<'life0, 'async_trait>( &'life0 self, ctx: RunContext<Deps>, args: Value, ) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl<Deps> Tool<Deps> for FunctionTool<Deps>
where Deps: Send + Sync + 'static,