@ai-sdk/openai 3.0.111 → 3.0.112

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/openai",
3
- "version": "3.0.111",
3
+ "version": "3.0.112",
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.51"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -370,6 +370,13 @@ export class OpenAIChatLanguageModel implements LanguageModelV3 {
370
370
  });
371
371
 
372
372
  const choice = response.choices[0];
373
+ if (choice == null) {
374
+ throw new InvalidResponseDataError({
375
+ data: rawResponse,
376
+ message: 'Response did not contain any choices.',
377
+ });
378
+ }
379
+
373
380
  const content: Array<LanguageModelV3Content> = [];
374
381
 
375
382
  // text content: