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