pub trait ToolHandler: Send + Sync {
// Required method
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
input: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Trait for handling tool calls in agent loops.
Required Methods§
Sourcefn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
input: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
input: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Handle a tool call and return the result.