CustomTool

Trait CustomTool 

Source
pub trait CustomTool: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn parameters(&self) -> ToolParameters;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        parameters: Value,
    ) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for custom tools that can be integrated.

Required Methods§

Source

fn name(&self) -> &str

Tool name

Source

fn description(&self) -> &str

Tool description

Source

fn parameters(&self) -> ToolParameters

Tool parameter definitions

Source

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

Execute the tool with given parameters

Implementors§