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 isparameters, 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 notvalidateagainst it (up to five of the problems are named).Nonewhen they fit as far as the validator checks; the tool checks the rest. - invalid_
arguments_ feedback - What the model reads when its call to
toolsentraw, arguments that are not a JSON object: the tool never ran, and the model calls it again.rawis echoed up toECHOED_CHARS. - invalid_
call_ feedback - The tool results answering a turn with an invalid call, in call order:
feedbackfor the callinvalid,TOOL_NOT_EXECUTED_DUE_TO_INVALID_PEERfor every other call. Empty whencontenthas 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
startedand itsfootprint: one never started was not run; one that started and only reads (Touches::reads_only) is safe to run again; any other,Touches::Independenttoo, may have partly run.whyis said as it is, without a final period. - output_
limit_ feedback - What the model reads for its call to
toolthat its reply ended in the middle of, having reached the output limit after sendingrawof the arguments (a response’sunfinished_calls): the tool never ran, and sending as much again would be cut off again.rawis echoed up toECHOED_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.