Skip to main content

validate_tool_calls

Function validate_tool_calls 

Source
pub fn validate_tool_calls(
    tools: Option<&Value>,
    tool_calls: Option<&Value>,
) -> Verdict
Expand description

Validate a response’s tool_calls against the request’s tools.

Both arguments are the raw arrays in OpenAI shape: tools as the client sent it, tool_calls as the response carried it (with arguments still a JSON-encoded string, which this function parses).

Never panics and never errors — an input it cannot make sense of yields Verdict::NotApplicable or Verdict::Unvalidatable, both of which mean forward unchanged.