Skip to main content

ToolErrorRecovery

Trait ToolErrorRecovery 

Source
pub trait ToolErrorRecovery: Send + Sync {
    // Required method
    fn on_error<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        _session_id: &'life1 SessionId,
        _tool_names: &'life2 [String],
        _error: &'life3 AgentError,
    ) -> Pin<Box<dyn Future<Output = AgentResult<ToolErrorAction>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Recovery strategy after a tool execution failure

Defaults to StopOnError, following the lightweight kernel design of conservative defaults and strategy injection. Upper-layer agents can inject custom strategies such as RetryOnError.

Required Methods§

Source

fn on_error<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _session_id: &'life1 SessionId, _tool_names: &'life2 [String], _error: &'life3 AgentError, ) -> Pin<Box<dyn Future<Output = AgentResult<ToolErrorAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Implementors§