Skip to main content

create_tool_model_output

Function create_tool_model_output 

Source
pub fn create_tool_model_output(
    tool: Option<&Tool>,
    tool_call_id: &ToolCallId,
    input: &JsonValue,
    output: &JsonValue,
    error_mode: ErrorMode,
) -> ToolResultOutput
Expand 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.