The places where an OpenAI-compatible provider departs from the plain /chat/completions wire format.
OpenAICompatibleClient holds everything the providers share - request building, the HTTP round trip, SSE streaming, tool-call fan-out, error mapping, exchange logging - written once. A dialect answers the handful of questions on which they differ, and every answer defaults to the standard format, so a provider overrides only where it departs from it:
'''Response:''' how content is read back (decodeContent); where the model's thinking is (thinking); where its reasoning-token count is (reasoningTokens); and how a non-streaming tool_calls array is parsed (parseToolCalls).
The generic openai-compatible provider uses OpenAICompatibleDialect.standard, which overrides nothing but headers. DeepSeek, Z.ai and OpenRouter each override two to five members. A new OpenAI-compatible provider whose differences fit these members is a dialect and a descriptor, not a client; one whose differences do not should extend this trait rather than fork OpenAICompatibleClient (#1132).
Adds provider-specific reasoning fields to a request body, given the configured model and the caller's options. Standard: adds nothing, so CompletionOptions.reasoning is ignored.
Adds provider-specific reasoning fields to a request body, given the configured model and the caller's options. Standard: adds nothing, so CompletionOptions.reasoning is ignored.
Whether an assistant message with no text still carries a content field ("" for empty text, null for none). Standard: false - the field is omitted, which is what most providers expect alongside tool_calls.
Whether an assistant message with no text still carries a content field ("" for empty text, null for none). Standard: false - the field is omitted, which is what most providers expect alongside tool_calls.
Parses the tool_calls array of a non-streaming reply.
Parses the tool_calls array of a non-streaming reply.
Standard: OpenAICompatibleDialect.lenientToolCalls, which fills in missing fields and turns unparseable arguments into {}. Streamed tool calls always go through StreamingToolArgumentParser, which keeps unparseable arguments as a raw string.
Reads the model's thinking from a JSON object: a completion's message (then, if that has none, its enclosing choice), or a stream's delta. Standard: none.
Reads the model's thinking from a JSON object: a completion's message (then, if that has none, its enclosing choice), or a stream's delta. Standard: none.