ToolExecutor

Trait ToolExecutor 

Source
pub trait ToolExecutor: Send + Sync {
    type Output: Serialize + Send;
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 ExecutionContext,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn execute_tool<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 ExecutionContext,
    ) -> Pin<Box<dyn Future<Output = ToolResult<Self::Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Trait for types that can execute as tools

Required Associated Types§

Source

type Output: Serialize + Send

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 ExecutionContext, ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn execute_tool<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 ExecutionContext, ) -> Pin<Box<dyn Future<Output = ToolResult<Self::Output>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§