Expand description
OpenAI Chat Completions response shapes.
The spec (https://developers.openai.com/api/docs/guides/function-calling)
puts tool calls in message.tool_calls[] with function.arguments as a
JSON string and a mandatory id. The broken variants below reproduce
deviations observed on OpenAI-compatible stacks in the wild.
Functions§
- text_
response - Assistant text response (
finish_reason: "stop"). - tool_
call - Spec-conformant tool call: string
arguments,idpresent. - tool_
call_ malformed_ args - Broken variant:
argumentsis not valid JSON. Clients must surface a recoverable error rather than dying (a model that emits one malformed payload can be asked to retry). - tool_
call_ object_ args_ no_ id - Broken-but-observed variant:
argumentsis a JSON object and theidfield is absent. Emitted through OpenAI-compatible endpoints by Ollama’s native/api/chatshape (which has noidat all — see ollamadocs/api.md), by Gemini’sfunctionCall.args, and by some vLLM tool-call parsers. - tool_
calls_ response - Assistant tool-calls response (
finish_reason: "tool_calls",content: null).