Tool

Trait Tool 

Source
pub trait Tool {
    // Required methods
    fn info(&self) -> &ToolInfo;
    fn call<'life0, 'async_trait>(
        &'life0 self,
        ctx: AgentContext,
        args: AgentValue,
    ) -> Pin<Box<dyn Future<Output = Result<AgentValue, AgentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for Tool implementations.

Required Methods§

Source

fn info(&self) -> &ToolInfo

Source

fn call<'life0, 'async_trait>( &'life0 self, ctx: AgentContext, args: AgentValue, ) -> Pin<Box<dyn Future<Output = Result<AgentValue, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Call the tool with the given context and arguments.

Implementors§