Skip to main content

create_agent_tool_executor

Function create_agent_tool_executor 

Source
pub fn create_agent_tool_executor(
    tool: Arc<AgentTool>,
) -> impl Fn(Value, &ToolContext) -> Pin<Box<dyn Future<Output = Result<ToolResult, AgentError>> + Send>> + Send + Sync + 'static
Expand description

Create a tool executor closure from an AgentTool for use with QueryEngine::register_tool().

The executor clones the AgentTool (via Arc) and calls its execute method.