Tool

Trait Tool 

Source
pub trait Tool: Send + Sync {
    // Required methods
    fn definition(&self) -> ToolDefinition;
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        input: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn name(&self) -> &str { ... }
    fn version(&self) -> &str { ... }
    fn description(&self) -> &str { ... }
    fn author(&self) -> &str { ... }
    fn validate_input(&self, input: &str) -> Result<(), ToolError> { ... }
}

Required Methods§

Source

fn definition(&self) -> ToolDefinition

Source

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

Provided Methods§

Source

fn name(&self) -> &str

Source

fn version(&self) -> &str

Source

fn description(&self) -> &str

Source

fn author(&self) -> &str

Source

fn validate_input(&self, input: &str) -> Result<(), ToolError>

Implementors§