Skip to main content

AgentTool

Trait AgentTool 

Source
pub trait AgentTool: Send + Sync {
    // Required methods
    fn definition(&self) -> Tool;
    fn label(&self) -> &str;
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tool_call_id: &'life1 str,
        args: Value,
        cancellation_token: Option<CancellationToken>,
        on_update: Option<AgentToolUpdateCallback>,
    ) -> Pin<Box<dyn Future<Output = AgentResult<AgentToolResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn execution_mode(&self) -> Option<ToolExecutionMode> { ... }
    fn prepare_arguments(&self, args: Value) -> AgentResult<Value> { ... }
}

Required Methods§

Source

fn definition(&self) -> Tool

Source

fn label(&self) -> &str

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, tool_call_id: &'life1 str, args: Value, cancellation_token: Option<CancellationToken>, on_update: Option<AgentToolUpdateCallback>, ) -> Pin<Box<dyn Future<Output = AgentResult<AgentToolResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§