@ai-sdk/openai 2.0.126 → 2.0.127
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 +10 -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/dist/internal/index.js
CHANGED
|
@@ -974,6 +974,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
974
974
|
fetch: this.config.fetch
|
|
975
975
|
});
|
|
976
976
|
const choice = response.choices[0];
|
|
977
|
+
if (choice == null) {
|
|
978
|
+
throw new import_provider3.InvalidResponseDataError({
|
|
979
|
+
data: rawResponse,
|
|
980
|
+
message: "Response did not contain any choices."
|
|
981
|
+
});
|
|
982
|
+
}
|
|
977
983
|
const content = [];
|
|
978
984
|
const text = choice.message.content;
|
|
979
985
|
if (text != null && text.length > 0) {
|