@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.mjs
CHANGED
|
@@ -934,6 +934,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
934
934
|
fetch: this.config.fetch
|
|
935
935
|
});
|
|
936
936
|
const choice = response.choices[0];
|
|
937
|
+
if (choice == null) {
|
|
938
|
+
throw new InvalidResponseDataError({
|
|
939
|
+
data: rawResponse,
|
|
940
|
+
message: "Response did not contain any choices."
|
|
941
|
+
});
|
|
942
|
+
}
|
|
937
943
|
const content = [];
|
|
938
944
|
const text = choice.message.content;
|
|
939
945
|
if (text != null && text.length > 0) {
|