create_tool

Function create_tool 

Source
pub fn create_tool<F, Fut>(
    name: impl Into<String>,
    description: impl Into<String>,
    handler: F,
) -> ToolBox
where F: Fn(Value) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<String>> + Send + 'static,
Expand description

Simple helper to create a tool from an async closure (backwards compatibility) This is a simpler API for basic tools that don’t need explicit parameter schemas. The schema will be inferred as accepting any JSON object.