Skip to main content

ToolProvider

Trait ToolProvider 

Source
pub trait ToolProvider: Send + Sync {
    // Required methods
    fn list_tools<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        agent_name: &'life1 str,
        context: &'life2 ToolContext,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ToolDefinition>, ToolProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn call_tool<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        request: &'life1 ToolCallRequest,
        service_id: &'life2 str,
        context: &'life3 ToolContext,
    ) -> Pin<Box<dyn Future<Output = Result<ToolCallResult, ToolProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
    fn refresh_connections<'life0, 'life1, 'async_trait>(
        &'life0 self,
        agent_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), ToolProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, bool>, ToolProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn find_tool<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        agent_name: &'life1 str,
        tool_name: &'life2 str,
        context: &'life3 ToolContext,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ToolDefinition>, ToolProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait { ... }
}
Available on crate feature core only.

Required Methods§

Source

fn list_tools<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, agent_name: &'life1 str, context: &'life2 ToolContext, ) -> Pin<Box<dyn Future<Output = Result<Vec<ToolDefinition>, ToolProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn call_tool<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, request: &'life1 ToolCallRequest, service_id: &'life2 str, context: &'life3 ToolContext, ) -> Pin<Box<dyn Future<Output = Result<ToolCallResult, ToolProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Source

fn refresh_connections<'life0, 'life1, 'async_trait>( &'life0 self, agent_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), ToolProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, bool>, ToolProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Provided Methods§

Source

fn find_tool<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, agent_name: &'life1 str, tool_name: &'life2 str, context: &'life3 ToolContext, ) -> Pin<Box<dyn Future<Output = Result<Option<ToolDefinition>, ToolProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Implementors§