@ai-sdk/openai 4.0.69 → 4.0.70

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,14 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 4.0.70
4
+
5
+ ### Patch Changes
6
+
7
+ - fd75cee: fix(openai): preserve provider file references in Responses tool results
8
+ - 1f5bb62: fix(openai): send assistant text as Responses easy input messages
9
+ - Updated dependencies [0455398]
10
+ - @ai-sdk/provider-utils@5.0.44
11
+
3
12
  ## 4.0.69
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -4995,6 +4995,29 @@ async function convertFunctionToolResultOutput({
4995
4995
  case "file": {
4996
4996
  const topLevel = getTopLevelMediaType2(item.mediaType);
4997
4997
  const imageDetail = (_b = (_a3 = item.providerOptions) == null ? void 0 : _a3[providerOptionsName]) == null ? void 0 : _b.imageDetail;
4998
+ if (item.data.type === "reference") {
4999
+ const fileId = resolveProviderReference2({
5000
+ reference: item.data.reference,
5001
+ provider: providerOptionsName
5002
+ });
5003
+ if (topLevel === "image") {
5004
+ return {
5005
+ type: "input_image",
5006
+ file_id: fileId,
5007
+ detail: imageDetail,
5008
+ ...promptCacheBreakpoint2 != null && {
5009
+ prompt_cache_breakpoint: promptCacheBreakpoint2
5010
+ }
5011
+ };
5012
+ }
5013
+ return {
5014
+ type: "input_file",
5015
+ file_id: fileId,
5016
+ ...promptCacheBreakpoint2 != null && {
5017
+ prompt_cache_breakpoint: promptCacheBreakpoint2
5018
+ }
5019
+ };
5020
+ }
4998
5021
  if (item.data.type === "data") {
4999
5022
  const fullMediaType = resolveFullMediaType2({ part: item });
5000
5023
  if (topLevel === "image") {
@@ -5335,8 +5358,7 @@ async function convertToOpenAIResponsesInput({
5335
5358
  input.push({
5336
5359
  ...explicitMessageItemType && { type: "message" },
5337
5360
  role: "assistant",
5338
- content: [{ type: "output_text", text: part.text }],
5339
- id,
5361
+ content: part.text,
5340
5362
  ...phase != null && { phase }
5341
5363
  });
5342
5364
  break;
@@ -11945,7 +11967,7 @@ var OpenAISkills = class {
11945
11967
  };
11946
11968
 
11947
11969
  // src/version.ts
11948
- var VERSION = true ? "4.0.69" : "0.0.0-test";
11970
+ var VERSION = true ? "4.0.70" : "0.0.0-test";
11949
11971
 
11950
11972
  // src/openai-provider.ts
11951
11973
  function createOpenAI(options = {}) {