@ai-sdk/openai-compatible 2.0.74 → 2.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/index.mdx CHANGED
@@ -13,10 +13,10 @@ We provide detailed documentation for the following OpenAI compatible providers:
13
13
 
14
14
  - [LM Studio](/providers/openai-compatible-providers/lmstudio)
15
15
  - [NIM](/providers/openai-compatible-providers/nim)
16
+ - [ModelRush](/providers/openai-compatible-providers/modelrush)
16
17
  - [Heroku](/providers/openai-compatible-providers/heroku)
17
18
  - [Clarifai](/providers/openai-compatible-providers/clarifai)
18
19
  - [NEAR AI Cloud](/providers/openai-compatible-providers/nearai)
19
- - [Synthorai](/providers/openai-compatible-providers/synthorai)
20
20
 
21
21
  The general setup and provider instance creation is the same for all of these providers.
22
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/openai-compatible",
3
- "version": "2.0.74",
3
+ "version": "2.0.76",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -36,8 +36,8 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@ai-sdk/provider": "3.0.15",
40
- "@ai-sdk/provider-utils": "4.0.50"
39
+ "@ai-sdk/provider": "3.0.16",
40
+ "@ai-sdk/provider-utils": "4.0.52"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -299,6 +299,13 @@ export class OpenAICompatibleChatLanguageModel implements LanguageModelV3 {
299
299
  });
300
300
 
301
301
  const choice = responseBody.choices[0];
302
+ if (choice == null) {
303
+ throw new InvalidResponseDataError({
304
+ data: rawResponse,
305
+ message: 'Response did not contain any choices.',
306
+ });
307
+ }
308
+
302
309
  const content: Array<LanguageModelV3Content> = [];
303
310
 
304
311
  content.push(...convertOpenAICompatibleContent(choice.message.content));
@@ -562,7 +569,7 @@ export class OpenAICompatibleChatLanguageModel implements LanguageModelV3 {
562
569
  }
563
570
  }
564
571
 
565
- if (delta.tool_calls != null) {
572
+ if (delta.tool_calls != null && delta.tool_calls.length > 0) {
566
573
  // end active reasoning block before tool calls start
567
574
  if (isActiveReasoning) {
568
575
  controller.enqueue({