@ai-sdk/openai 3.0.112 → 3.0.114

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,17 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.114
4
+
5
+ ### Patch Changes
6
+
7
+ - e53d917: fix(openai): preserve provider file references in Responses tool results
8
+
9
+ ## 3.0.113
10
+
11
+ ### Patch Changes
12
+
13
+ - 90757ce: fix(openai): report apply patch responses with a tool-calls finish reason
14
+
3
15
  ## 3.0.112
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -3153,7 +3153,7 @@ async function convertFunctionToolResultOutput({
3153
3153
  return convertScalarOutput(JSON.stringify(output.value));
3154
3154
  case "content":
3155
3155
  return output.value.map((item) => {
3156
- var _a3, _b, _c, _d, _e;
3156
+ var _a3, _b, _c, _d, _e, _f, _g;
3157
3157
  const promptCacheBreakpoint2 = getPromptCacheBreakpoint2(
3158
3158
  item.providerOptions,
3159
3159
  providerOptionsName
@@ -3188,10 +3188,29 @@ async function convertFunctionToolResultOutput({
3188
3188
  }
3189
3189
  };
3190
3190
  }
3191
+ case "file-id": {
3192
+ return {
3193
+ type: "input_file",
3194
+ file_id: typeof item.fileId === "string" ? item.fileId : item.fileId[providerOptionsName],
3195
+ ...promptCacheBreakpoint2 != null && {
3196
+ prompt_cache_breakpoint: promptCacheBreakpoint2
3197
+ }
3198
+ };
3199
+ }
3200
+ case "image-file-id": {
3201
+ return {
3202
+ type: "input_image",
3203
+ file_id: typeof item.fileId === "string" ? item.fileId : item.fileId[providerOptionsName],
3204
+ detail: (_f = (_e = item.providerOptions) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.imageDetail,
3205
+ ...promptCacheBreakpoint2 != null && {
3206
+ prompt_cache_breakpoint: promptCacheBreakpoint2
3207
+ }
3208
+ };
3209
+ }
3191
3210
  case "file-data": {
3192
3211
  return {
3193
3212
  type: "input_file",
3194
- filename: (_e = item.filename) != null ? _e : "data",
3213
+ filename: (_g = item.filename) != null ? _g : "data",
3195
3214
  file_data: `data:${item.mediaType};base64,${item.data}`,
3196
3215
  ...promptCacheBreakpoint2 != null && {
3197
3216
  prompt_cache_breakpoint: promptCacheBreakpoint2
@@ -6563,6 +6582,7 @@ var OpenAIResponsesLanguageModel = class {
6563
6582
  break;
6564
6583
  }
6565
6584
  case "apply_patch_call": {
6585
+ hasFunctionCall = true;
6566
6586
  content.push({
6567
6587
  type: "tool-call",
6568
6588
  toolCallId: part.call_id,
@@ -7209,6 +7229,7 @@ var OpenAIResponsesLanguageModel = class {
7209
7229
  toolCall.applyPatch.endEmitted = true;
7210
7230
  }
7211
7231
  if (toolCall && value.item.status === "completed") {
7232
+ hasFunctionCall = true;
7212
7233
  controller.enqueue({
7213
7234
  type: "tool-call",
7214
7235
  toolCallId: toolCall.toolCallId,
@@ -8108,7 +8129,7 @@ var OpenAITranscriptionModel = class {
8108
8129
  };
8109
8130
 
8110
8131
  // src/version.ts
8111
- var VERSION = true ? "3.0.112" : "0.0.0-test";
8132
+ var VERSION = true ? "3.0.114" : "0.0.0-test";
8112
8133
 
8113
8134
  // src/openai-provider.ts
8114
8135
  function createOpenAI(options = {}) {