Skip to main content

ToolCallRepair

Trait ToolCallRepair 

Source
pub trait ToolCallRepair: Send + Sync {
    // Required method
    fn repair<'a>(
        &'a self,
        request: RepairRequest<'a>,
    ) -> BoxFuture<'a, Result<Option<ToolCall>, BoxError>>;
}
Expand description

Repairs tool calls the model got wrong (unknown tool or invalid input).

Return Ok(None) to give up (the original error is kept), Ok(Some(call)) to re-parse the repaired call, or Err to fail with Error::ToolCallRepair.

Required Methods§

Source

fn repair<'a>( &'a self, request: RepairRequest<'a>, ) -> BoxFuture<'a, Result<Option<ToolCall>, BoxError>>

Attempts a repair.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§