hasToolCall

Stop once a named tool has been called.

Ends the loop as soon as the model calls the tool you name. The usual pattern is a terminal tool such as submit_answer or finish, which turns "the model decided it is done" into a stop condition.

stopWhen: [hasToolCall("submit_answer")]

Signature

func hasToolCall(
    _ toolNames: String...
) -> StopCondition

Defined in Sources/AI/Core/StepControl.swift.

Parameters

ParameterTypeDefault
_String...required

Returns

A StopCondition.

See also