ToolHandle

Trait ToolHandle 

Source
pub trait ToolHandle: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn invoke<'life0, 'async_trait>(
        &'life0 self,
        invocation: ToolInvocation,
    ) -> Pin<Box<dyn Future<Output = Result<ToolResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Describes a tool that can be invoked by an agent at runtime.

Required Methods§

Source

fn name(&self) -> &str

Returns the unique, stable name for this tool.

Source

fn invoke<'life0, 'async_trait>( &'life0 self, invocation: ToolInvocation, ) -> Pin<Box<dyn Future<Output = Result<ToolResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Executes the tool given the invocation payload.

Implementors§