Skip to main content

run_tool_loop_with_registry

Function run_tool_loop_with_registry 

Source
pub fn run_tool_loop_with_registry(
    cx: &mut Cx,
    plan: &Expr,
    request: &Expr,
    cache: &mut OpenAiPlanCache,
    registry: &OpenAiToolRegistry,
    initial: PlanEvalReport,
    config: ToolLoopConfig,
) -> Result<PlanEvalReport>
Expand description

Drives the model/tool loop until the model stops requesting tool calls.

Each round executes the model’s requested tool calls against registry, appends their results to the request, and re-evaluates plan. The loop rejects duplicate identical calls, enforces the per-round call limit, and fails once config.max_tool_rounds is exceeded.