@ai-sdk/openai 3.0.11 → 3.0.13

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,19 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 000fa96: fix(openai): filter duplicate items when passing conversationID
8
+
9
+ ## 3.0.12
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [5c090e7]
14
+ - @ai-sdk/provider@3.0.4
15
+ - @ai-sdk/provider-utils@4.0.8
16
+
3
17
  ## 3.0.11
4
18
 
5
19
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2480,6 +2480,7 @@ async function convertToOpenAIResponsesInput({
2480
2480
  providerOptionsName,
2481
2481
  fileIdPrefixes,
2482
2482
  store,
2483
+ hasConversation = false,
2483
2484
  hasLocalShellTool = false,
2484
2485
  hasShellTool = false,
2485
2486
  hasApplyPatchTool = false
@@ -2566,6 +2567,9 @@ async function convertToOpenAIResponsesInput({
2566
2567
  switch (part.type) {
2567
2568
  case "text": {
2568
2569
  const id = (_b = (_a = part.providerOptions) == null ? void 0 : _a[providerOptionsName]) == null ? void 0 : _b.itemId;
2570
+ if (hasConversation && id != null) {
2571
+ break;
2572
+ }
2569
2573
  if (store && id != null) {
2570
2574
  input.push({ type: "item_reference", id });
2571
2575
  break;
@@ -2579,6 +2583,9 @@ async function convertToOpenAIResponsesInput({
2579
2583
  }
2580
2584
  case "tool-call": {
2581
2585
  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;
2586
+ if (hasConversation && id != null) {
2587
+ break;
2588
+ }
2582
2589
  if (part.providerExecuted) {
2583
2590
  if (store && id != null) {
2584
2591
  input.push({ type: "item_reference", id });
@@ -2644,6 +2651,9 @@ async function convertToOpenAIResponsesInput({
2644
2651
  if (part.output.type === "execution-denied" || part.output.type === "json" && typeof part.output.value === "object" && part.output.value != null && "type" in part.output.value && part.output.value.type === "execution-denied") {
2645
2652
  break;
2646
2653
  }
2654
+ if (hasConversation) {
2655
+ break;
2656
+ }
2647
2657
  if (store) {
2648
2658
  const itemId = (_j = (_i = (_h = part.providerMetadata) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.itemId) != null ? _j : part.toolCallId;
2649
2659
  input.push({ type: "item_reference", id: itemId });
@@ -2662,6 +2672,9 @@ async function convertToOpenAIResponsesInput({
2662
2672
  schema: openaiResponsesReasoningProviderOptionsSchema
2663
2673
  });
2664
2674
  const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
2675
+ if (hasConversation && reasoningId != null) {
2676
+ break;
2677
+ }
2665
2678
  if (reasoningId != null) {
2666
2679
  const reasoningMessage = reasoningMessages[reasoningId];
2667
2680
  if (store) {
@@ -4070,6 +4083,7 @@ var OpenAIResponsesLanguageModel = class {
4070
4083
  providerOptionsName,
4071
4084
  fileIdPrefixes: this.config.fileIdPrefixes,
4072
4085
  store: (_c = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _c : true,
4086
+ hasConversation: (openaiOptions == null ? void 0 : openaiOptions.conversation) != null,
4073
4087
  hasLocalShellTool: hasOpenAITool("openai.local_shell"),
4074
4088
  hasShellTool: hasOpenAITool("openai.shell"),
4075
4089
  hasApplyPatchTool: hasOpenAITool("openai.apply_patch")
@@ -5760,7 +5774,7 @@ var OpenAITranscriptionModel = class {
5760
5774
  };
5761
5775
 
5762
5776
  // src/version.ts
5763
- var VERSION = true ? "3.0.11" : "0.0.0-test";
5777
+ var VERSION = true ? "3.0.13" : "0.0.0-test";
5764
5778
 
5765
5779
  // src/openai-provider.ts
5766
5780
  function createOpenAI(options = {}) {