@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.
package/dist/index.mjs CHANGED
@@ -1136,6 +1136,12 @@ var OpenAIChatLanguageModel = class {
1136
1136
  fetch: this.config.fetch
1137
1137
  });
1138
1138
  const choice = response.choices[0];
1139
+ if (choice == null) {
1140
+ throw new InvalidResponseDataError({
1141
+ data: rawResponse,
1142
+ message: "Response did not contain any choices."
1143
+ });
1144
+ }
1139
1145
  const content = [];
1140
1146
  const text = choice.message.content;
1141
1147
  if (text != null && text.length > 0) {
@@ -6663,6 +6669,7 @@ var OpenAIResponsesLanguageModel = class {
6663
6669
  break;
6664
6670
  }
6665
6671
  case "apply_patch_call": {
6672
+ hasFunctionCall = true;
6666
6673
  content.push({
6667
6674
  type: "tool-call",
6668
6675
  toolCallId: part.call_id,
@@ -7309,6 +7316,7 @@ var OpenAIResponsesLanguageModel = class {
7309
7316
  toolCall.applyPatch.endEmitted = true;
7310
7317
  }
7311
7318
  if (toolCall && value.item.status === "completed") {
7319
+ hasFunctionCall = true;
7312
7320
  controller.enqueue({
7313
7321
  type: "tool-call",
7314
7322
  toolCallId: toolCall.toolCallId,
@@ -8226,7 +8234,7 @@ var OpenAITranscriptionModel = class {
8226
8234
  };
8227
8235
 
8228
8236
  // src/version.ts
8229
- var VERSION = true ? "3.0.111" : "0.0.0-test";
8237
+ var VERSION = true ? "3.0.113" : "0.0.0-test";
8230
8238
 
8231
8239
  // src/openai-provider.ts
8232
8240
  function createOpenAI(options = {}) {