Repository navigation
Description
Description
The OpenAI Compatible provider currently has two layers to verify that every tool call has a type of "function":
ai/packages/openai-compatible/src/openai-compatible-chat-language-model.ts
Lines 500 to 505 in 9e16bfd
| if (toolCallDelta.type !== 'function') { | |
| throw new InvalidResponseDataError({ | |
| data: toolCallDelta, | |
| message: `Expected 'function' type.`, | |
| }); | |
| } |
| type: z.literal('function'), |
But these checks are unnecessary and serve no purpose since the "function" is the only type of tool call OpenAI's ever declared. More importantly, they prevent me from using the OpenAI Compatible provider from connecting to Novita AI, a provider that sets the type of tool calls to "" after the first one, like it's a delta. Novita isn't changing how their API works - they're confident that this "complies with OpenAI guidelines", and it makes some intuitive sense (it is in the delta section of the stream after all). To solve this, these checks will have to be removed.
AI SDK Version
No response
Activity
feat (provider/openai-compatible): allow providers that do not specif…
lgrammel commentedon Jul 22, 2026
Identify issue type
Identified as Feature
Confidence: High
Rationale
This requests broader compatibility and more permissive handling of tool-call deltas, rather than identifying a violation of documented SDK behavior.
Evidence
typeto equal"function".type: ""after the first tool-call delta, causing its responses to be rejected.