@ai-sdk/openai 3.0.111 → 3.0.113

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) {
@@ -6905,6 +6911,7 @@ var OpenAIResponsesLanguageModel = class {
6905
6911
  break;
6906
6912
  }
6907
6913
  case "apply_patch_call": {
6914
+ hasFunctionCall = true;
6908
6915
  content.push({
6909
6916
  type: "tool-call",
6910
6917
  toolCallId: part.call_id,
@@ -7551,6 +7558,7 @@ var OpenAIResponsesLanguageModel = class {
7551
7558
  toolCall.applyPatch.endEmitted = true;
7552
7559
  }
7553
7560
  if (toolCall && value.item.status === "completed") {
7561
+ hasFunctionCall = true;
7554
7562
  controller.enqueue({
7555
7563
  type: "tool-call",
7556
7564
  toolCallId: toolCall.toolCallId,