Skip to main content

AgentLoopToolExecutor

Trait AgentLoopToolExecutor 

Source
pub trait AgentLoopToolExecutor: Send + Sync {
    // Required method
    fn execute<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        arguments: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, LLMError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn available_tools<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Tool>, LLMError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait { ... }
}
Expand description

Tool executor trait for LLM tool calling.

Required Methods§

Source

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, name: &'life1 str, arguments: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<String, LLMError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Execute a tool call by name with JSON arguments.

Provided Methods§

Source

fn available_tools<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Tool>, LLMError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get available tool definitions.

Default returns an empty list for executors that don’t expose tools.

Implementors§