Expand description
Model-facing structured-output policy shared by the agent runtimes: the synthetic output tool’s name and description, the instructions and reprompts the model sees, and the required-field check on an answer.
use rig_core::structured_output::{output_tool_augmentation, output_tool_name};
let name = output_tool_name(|taken| taken == "final_result");
assert_eq!(name, "final_result_1");
assert!(output_tool_augmentation(&name).contains("`final_result_1`"));Constants§
- AUGMENTATION_
SEPARATOR - The separator between the preamble and an augmentation.
- OUTPUT_
TOOL_ DESCRIPTION - The output tool’s default description.
- OUTPUT_
TOOL_ NAME - The output tool’s default name.
Functions§
- missing_
required_ fields - The top-level required fields of an object schema that
argumentslacks, in the schema’s order. A non-object argument lacks every one. - output_
tool_ augmentation - Appended to the preamble when the answer is asked for through the output
tool named
name. - output_
tool_ callable - Whether the tool choice permits calling the output tool named
name. No choice,Auto,Required, and aSpecificset naming it permit it. - output_
tool_ name - The output tool’s name for a run: the default, numbered from 1 while
is_takenreports a collision (final_result,final_result_1, …). - prompted_
augmentation - Appended to the preamble when the answer is asked for as prompted JSON;
schemais the schema’s canonical rendering. - reprompt_
missing_ fields - The reprompt when the output tool named
namewas called without themissingrequired fields. - reprompt_
text_ answer - The reprompt when the model answered as text instead of calling the output
tool named
name. - text_
satisfies_ schema - Whether
textparses as JSON with every top-level required field ofschema. Without a schema any JSON passes. Field types and other schema constraints are not checked.