Tool

Trait Tool 

Source
pub trait Tool: Send + Sync {
    // Required methods
    fn schema(&self) -> ToolSchema;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        args: Value,
        ctx: ToolContext,
    ) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Core trait for tool implementations

Required Methods§

Source

fn schema(&self) -> ToolSchema

Returns the schema definition for this tool

Source

fn execute<'life0, 'async_trait>( &'life0 self, args: Value, ctx: ToolContext, ) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Executes the tool with the given arguments and context

Implementors§