Trait ExecutableTool

Source
pub trait ExecutableTool: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn description(&self) -> String;
    fn input_schema(&self) -> &'static InputSchema;
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        params: Value,
        ctx: &'life1 ExecutionContext,
    ) -> Pin<Box<dyn Future<Output = Result<ToolResultEnum, ToolError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn requires_approval(&self) -> bool;
}

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn description(&self) -> String

Source

fn input_schema(&self) -> &'static InputSchema

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 self, params: Value, ctx: &'life1 ExecutionContext, ) -> Pin<Box<dyn Future<Output = Result<ToolResultEnum, ToolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn requires_approval(&self) -> bool

Implementors§

Source§

impl<T> ExecutableTool for T
where T: Tool + Send + Sync, T::Output: Into<ToolResult> + Send,