Skip to main content

AgentToolHandler

Trait AgentToolHandler 

Source
pub trait AgentToolHandler: Send + Sync {
    // Required methods
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        input: AgentToolInput,
    ) -> Pin<Box<dyn Future<Output = Result<AgentToolOutput, AgentToolError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn name(&self) -> &str;
    fn description(&self) -> &str;

    // Provided methods
    fn is_available(&self) -> bool { ... }
    fn capabilities(&self) -> Vec<String> { ... }
}
Expand description

Trait for agent tool handlers

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, input: AgentToolInput, ) -> Pin<Box<dyn Future<Output = Result<AgentToolOutput, AgentToolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute the agent with the given input

Source

fn name(&self) -> &str

Get the agent’s name

Source

fn description(&self) -> &str

Get the agent’s description

Provided Methods§

Source

fn is_available(&self) -> bool

Check if the agent is available

Source

fn capabilities(&self) -> Vec<String>

Get the agent’s capabilities/tags

Implementors§