@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/CHANGELOG.md +9 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +6 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +6 -0
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/chat/openai-chat-language-model.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai",
|
|
3
|
-
"version": "3.0.
|
|
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.
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
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:
|