pub fn create_tool_model_output(
tool: Option<&Tool>,
tool_call_id: &ToolCallId,
input: &JsonValue,
output: &JsonValue,
error_mode: ErrorMode,
) -> ToolResultOutputExpand description
Builds the model-facing output for a tool result.
Errors become error-text / error-json; successful outputs go through
the tool’s to_model_output when defined, otherwise strings become
text and everything else json.