Skip to main content

CustomToolExecutor

Trait CustomToolExecutor 

Source
pub trait CustomToolExecutor:
    Send
    + Sync
    + Debug {
    // Required methods
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tool_id: &'life1 str,
        input: Value,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn clone_box(&self) -> Arc<dyn CustomToolExecutor>;
}
Expand description

Trait for custom tool executors. Implement this for each kirsten tool.

Required Methods§

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, tool_id: &'life1 str, input: Value, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute the tool with the given input. Return the output text.

Source

fn clone_box(&self) -> Arc<dyn CustomToolExecutor>

Clone into an Arc (for storing in ToolExecutorV1::Custom).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§