Skip to main content

Module feedback

Module feedback 

Source
Expand description

What the model reads about its tool calls: a tool’s result shaped as a tool result, the error result of a call that never ran, what a call that did not finish says (not_finished), and the feedback for arguments that do not fit a tool.

use rig_core::tool::feedback::invalid_arguments_feedback;

assert!(invalid_arguments_feedback("add", "[1]").contains("not a JSON object"));

Constants§

ECHOED_CHARS
How much of a call’s raw arguments its feedback echoes, in characters.
TOOL_NOT_EXECUTED_DUE_TO_INVALID_PEER
The result every other call of a turn gets when one call was retried or skipped: none of the turn’s calls ran.

Functions§

arguments_refusal
Why call’s arguments do not fit a tool whose JSON schema is parameters, for the model to read as the call’s error: they are not a JSON object (invalid_arguments_feedback), name an argument the schema does not declare, or do not validate against it (up to five of the problems are named). None when they fit as far as the validator checks; the tool checks the rest.
invalid_arguments_feedback
What the model reads when its call to tool sent raw, arguments that are not a JSON object: the tool never ran, and the model calls it again. raw is echoed up to ECHOED_CHARS.
invalid_call_feedback
The tool results answering a turn with an invalid call, in call order: feedback for the call invalid, TOOL_NOT_EXECUTED_DUE_TO_INVALID_PEER for every other call. Empty when content has no tool calls.
not_executed
The result of a call the run did not execute because a call beside it was invalid.
not_finished
What the model reads of a call that did not finish, for any early end (“stopped” means any of them: the user stopped the turn, a plugin or a failure ended it, or the session restarted), from whether it started and its footprint: one never started was not run; one that started and only reads (Touches::reads_only) is safe to run again; any other, Touches::Independent too, may have partly run. why is said as it is, without a final period.
output_limit_feedback
What the model reads for its call to tool that its reply ended in the middle of, having reached the output limit after sending raw of the arguments (a response’s unfinished_calls): the tool never ran, and sending as much again would be cut off again. raw is echoed up to ECHOED_CHARS.
tool_result_message
Constructs the error result of a call that never ran, its text verbatim, such as recovery feedback or a skip reason. JSON-shaped text is not reinterpreted as structured or multimodal output.
tool_result_output
Shape a tool’s result as the tool result the model reads, without reparsing text. Anything but a success is an error result.