pub fn to_tool_definition(tool: &dyn BaseTool) -> ToolDefinitionExpand description
Converts BaseTool to ToolDefinition (for function calling).
§Arguments
tool- Tool implementing BaseTool trait.
§Returns
ToolDefinition for bind_tools().
§Example
ⓘ
use langchainrust::{Calculator, BaseTool, to_tool_definition};
use std::sync::Arc;
let calculator = Calculator::new();
let tool_def = to_tool_definition(&calculator);