Skip to main content

ToolHandler

Type Alias ToolHandler 

Source
pub type ToolHandler = dyn Fn(Value) -> Pin<Box<dyn Future<Output = ToolResult<Value>> + Send>> + Send + Sync;
Expand description

Type alias for the async handler function used by FunctionTool.

The handler returns a JSON Value (not a ToolOutput); the wrapper internally converts it to a ToolOutput. This matches the long-standing convention from the facade’s FunctionTool::new.