Skip to main content

Module stop

Module stop 

Source
Expand description

The stop tool: ends the agent loop gracefully.

The tool calls the agent’s cancel with after_current_tools, so the rest of the tool batch still runs, then the loop ends with StopReason::Cancelled and the message as the final assistant message. The model sees the same message as the result.

Structs§

MakeStopOptions
Options for make_stop (MakeStopOptions).
MakeStopOptionsBuilder
Use builder syntax to set the inputs and finish with build().

Constants§

DEFAULT_MAX_STOP_MESSAGE_LENGTH
The default cap on message, in characters (DEFAULT_MAX_STOP_MESSAGE_LENGTH).
DEFAULT_STOP_DESCRIPTION
The description of the stop tool shown to the model (DEFAULT_STOP_DESCRIPTION).
DEFAULT_STOP_MESSAGE
The final assistant message when the model gives none (DEFAULT_STOP_MESSAGE).

Functions§

make_stop
Creates a stop tool. An absent, null or empty message becomes DEFAULT_STOP_MESSAGE, so the loop always ends with a final message.
stop
The default stop tool (stop).