@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.
@@ -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) {