@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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.113
4
+
5
+ ### Patch Changes
6
+
7
+ - 90757ce: fix(openai): report apply patch responses with a tool-calls finish reason
8
+
9
+ ## 3.0.112
10
+
11
+ ### Patch Changes
12
+
13
+ - 1336501: fix(openai): return an AI SDK error for empty chat completion choices
14
+ - Updated dependencies [1a4dbb1]
15
+ - @ai-sdk/provider@3.0.16
16
+ - @ai-sdk/provider-utils@4.0.51
17
+
3
18
  ## 3.0.111
4
19
 
5
20
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1140,6 +1140,12 @@ var OpenAIChatLanguageModel = class {
1140
1140
  fetch: this.config.fetch
1141
1141
  });
1142
1142
  const choice = response.choices[0];
1143
+ if (choice == null) {
1144
+ throw new import_provider4.InvalidResponseDataError({
1145
+ data: rawResponse,
1146
+ message: "Response did not contain any choices."
1147
+ });
1148
+ }
1143
1149
  const content = [];
1144
1150
  const text = choice.message.content;
1145
1151
  if (text != null && text.length > 0) {
@@ -6557,6 +6563,7 @@ var OpenAIResponsesLanguageModel = class {
6557
6563
  break;
6558
6564
  }
6559
6565
  case "apply_patch_call": {
6566
+ hasFunctionCall = true;
6560
6567
  content.push({
6561
6568
  type: "tool-call",
6562
6569
  toolCallId: part.call_id,
@@ -7203,6 +7210,7 @@ var OpenAIResponsesLanguageModel = class {
7203
7210
  toolCall.applyPatch.endEmitted = true;
7204
7211
  }
7205
7212
  if (toolCall && value.item.status === "completed") {
7213
+ hasFunctionCall = true;
7206
7214
  controller.enqueue({
7207
7215
  type: "tool-call",
7208
7216
  toolCallId: toolCall.toolCallId,
@@ -8102,7 +8110,7 @@ var OpenAITranscriptionModel = class {
8102
8110
  };
8103
8111
 
8104
8112
  // src/version.ts
8105
- var VERSION = true ? "3.0.111" : "0.0.0-test";
8113
+ var VERSION = true ? "3.0.113" : "0.0.0-test";
8106
8114
 
8107
8115
  // src/openai-provider.ts
8108
8116
  function createOpenAI(options = {}) {