pub trait ToolInterceptor:
Send
+ Sync
+ 'static {
// Required methods
fn pre_execute(
&self,
tool_call: &ToolCall,
state: &Value,
) -> BoxFuture<'_, Result<(), ToolError>>;
fn post_execute(
&self,
tool_call: &ToolCall,
result: &Result<String, ToolError>,
) -> BoxFuture<'_, Result<String, ToolError>>;
}Expand description
Tool call interceptor trait
Allows injecting custom logic before and after tool execution.
Note: This trait does not implement Debug as it’s an async trait intended for dynamic dispatch via trait objects.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".