@zenning/openai 3.0.5 → 3.0.6

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,15 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Add support for OpenAI compaction message part type in system messages for managing context window limits
8
+ - 10b232c: Fix openai file_search tool to accept optional query param
9
+ - Updated dependencies
10
+ - @zenning/provider@3.0.3
11
+ - @zenning/provider-utils@4.0.5
12
+
3
13
  ## 3.0.5
4
14
 
5
15
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2479,7 +2479,7 @@ async function convertToOpenAIResponsesInput({
2479
2479
  hasShellTool = false,
2480
2480
  hasApplyPatchTool = false
2481
2481
  }) {
2482
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
2482
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
2483
2483
  const input = [];
2484
2484
  const warnings = [];
2485
2485
  const processedApprovalIds = /* @__PURE__ */ new Set();
@@ -2572,8 +2572,17 @@ async function convertToOpenAIResponsesInput({
2572
2572
  });
2573
2573
  break;
2574
2574
  }
2575
+ case "compaction": {
2576
+ const id = (_d = (_c = part.providerOptions) == null ? void 0 : _c[providerOptionsName]) == null ? void 0 : _d.itemId;
2577
+ input.push({
2578
+ role: "assistant",
2579
+ content: [{ type: "compaction", encrypted_content: part.encrypted_content }],
2580
+ id
2581
+ });
2582
+ break;
2583
+ }
2575
2584
  case "tool-call": {
2576
- const id = (_g = (_d = (_c = part.providerOptions) == null ? void 0 : _c[providerOptionsName]) == null ? void 0 : _d.itemId) != null ? _g : (_f = (_e = part.providerMetadata) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.itemId;
2585
+ const id = (_i = (_f = (_e = part.providerOptions) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.itemId) != null ? _i : (_h = (_g = part.providerMetadata) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.itemId;
2577
2586
  if (part.providerExecuted) {
2578
2587
  if (store && id != null) {
2579
2588
  input.push({ type: "item_reference", id });
@@ -2640,7 +2649,7 @@ async function convertToOpenAIResponsesInput({
2640
2649
  break;
2641
2650
  }
2642
2651
  if (store) {
2643
- const itemId = (_j = (_i = (_h = part.providerMetadata) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.itemId) != null ? _j : part.toolCallId;
2652
+ const itemId = (_l = (_k = (_j = part.providerMetadata) == null ? void 0 : _j[providerOptionsName]) == null ? void 0 : _k.itemId) != null ? _l : part.toolCallId;
2644
2653
  input.push({ type: "item_reference", id: itemId });
2645
2654
  } else {
2646
2655
  warnings.push({
@@ -2731,7 +2740,7 @@ async function convertToOpenAIResponsesInput({
2731
2740
  }
2732
2741
  const output = part.output;
2733
2742
  if (output.type === "execution-denied") {
2734
- const approvalId = (_l = (_k = output.providerOptions) == null ? void 0 : _k.openai) == null ? void 0 : _l.approvalId;
2743
+ const approvalId = (_n = (_m = output.providerOptions) == null ? void 0 : _m.openai) == null ? void 0 : _n.approvalId;
2735
2744
  if (approvalId) {
2736
2745
  continue;
2737
2746
  }
@@ -2790,7 +2799,7 @@ async function convertToOpenAIResponsesInput({
2790
2799
  contentValue = output.value;
2791
2800
  break;
2792
2801
  case "execution-denied":
2793
- contentValue = (_m = output.reason) != null ? _m : "Tool execution denied.";
2802
+ contentValue = (_o = output.reason) != null ? _o : "Tool execution denied.";
2794
2803
  break;
2795
2804
  case "json":
2796
2805
  case "error-json":
@@ -5755,7 +5764,7 @@ var OpenAITranscriptionModel = class {
5755
5764
  };
5756
5765
 
5757
5766
  // src/version.ts
5758
- var VERSION = true ? "3.0.5" : "0.0.0-test";
5767
+ var VERSION = true ? "3.0.6" : "0.0.0-test";
5759
5768
 
5760
5769
  // src/openai-provider.ts
5761
5770
  function createOpenAI(options = {}) {