Skip to main content

run_tool_loop

Function run_tool_loop 

Source
pub async fn run_tool_loop(
    model: &dyn TextModel,
    prompt: Prompt,
    executor: &dyn ToolExecutor,
    budget: ToolBudget,
) -> Result<ToolLoopOutcome, ToolLoopError>
Expand description

Runs prompt to completion through model, running any tool calls with executor, within budget (issue #665).

Every offered tool’s parameters schema is validated before the first model call, and every call’s arguments are validated against its tool’s schema before any executor sees them — a call with arguments that are not a JSON object, or that do not conform, becomes an error ToolResult the model is shown, never an execution.

§Errors