@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/dist/internal/index.mjs
CHANGED
|
@@ -1128,6 +1128,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
1128
1128
|
fetch: this.config.fetch
|
|
1129
1129
|
});
|
|
1130
1130
|
const choice = response.choices[0];
|
|
1131
|
+
if (choice == null) {
|
|
1132
|
+
throw new InvalidResponseDataError({
|
|
1133
|
+
data: rawResponse,
|
|
1134
|
+
message: "Response did not contain any choices."
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1131
1137
|
const content = [];
|
|
1132
1138
|
const text = choice.message.content;
|
|
1133
1139
|
if (text != null && text.length > 0) {
|