@ai-sdk/openai 3.0.12 → 3.0.14

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/dist/index.mjs CHANGED
@@ -2548,6 +2548,7 @@ async function convertToOpenAIResponsesInput({
2548
2548
  providerOptionsName,
2549
2549
  fileIdPrefixes,
2550
2550
  store,
2551
+ hasConversation = false,
2551
2552
  hasLocalShellTool = false,
2552
2553
  hasShellTool = false,
2553
2554
  hasApplyPatchTool = false
@@ -2634,6 +2635,9 @@ async function convertToOpenAIResponsesInput({
2634
2635
  switch (part.type) {
2635
2636
  case "text": {
2636
2637
  const id = (_b = (_a = part.providerOptions) == null ? void 0 : _a[providerOptionsName]) == null ? void 0 : _b.itemId;
2638
+ if (hasConversation && id != null) {
2639
+ break;
2640
+ }
2637
2641
  if (store && id != null) {
2638
2642
  input.push({ type: "item_reference", id });
2639
2643
  break;
@@ -2647,6 +2651,9 @@ async function convertToOpenAIResponsesInput({
2647
2651
  }
2648
2652
  case "tool-call": {
2649
2653
  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;
2654
+ if (hasConversation && id != null) {
2655
+ break;
2656
+ }
2650
2657
  if (part.providerExecuted) {
2651
2658
  if (store && id != null) {
2652
2659
  input.push({ type: "item_reference", id });
@@ -2712,6 +2719,9 @@ async function convertToOpenAIResponsesInput({
2712
2719
  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") {
2713
2720
  break;
2714
2721
  }
2722
+ if (hasConversation) {
2723
+ break;
2724
+ }
2715
2725
  if (store) {
2716
2726
  const itemId = (_j = (_i = (_h = part.providerMetadata) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.itemId) != null ? _j : part.toolCallId;
2717
2727
  input.push({ type: "item_reference", id: itemId });
@@ -2730,6 +2740,9 @@ async function convertToOpenAIResponsesInput({
2730
2740
  schema: openaiResponsesReasoningProviderOptionsSchema
2731
2741
  });
2732
2742
  const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
2743
+ if (hasConversation && reasoningId != null) {
2744
+ break;
2745
+ }
2733
2746
  if (reasoningId != null) {
2734
2747
  const reasoningMessage = reasoningMessages[reasoningId];
2735
2748
  if (store) {
@@ -4140,6 +4153,7 @@ var OpenAIResponsesLanguageModel = class {
4140
4153
  providerOptionsName,
4141
4154
  fileIdPrefixes: this.config.fileIdPrefixes,
4142
4155
  store: (_c = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _c : true,
4156
+ hasConversation: (openaiOptions == null ? void 0 : openaiOptions.conversation) != null,
4143
4157
  hasLocalShellTool: hasOpenAITool("openai.local_shell"),
4144
4158
  hasShellTool: hasOpenAITool("openai.shell"),
4145
4159
  hasApplyPatchTool: hasOpenAITool("openai.apply_patch")
@@ -5842,7 +5856,7 @@ var OpenAITranscriptionModel = class {
5842
5856
  };
5843
5857
 
5844
5858
  // src/version.ts
5845
- var VERSION = true ? "3.0.12" : "0.0.0-test";
5859
+ var VERSION = true ? "3.0.14" : "0.0.0-test";
5846
5860
 
5847
5861
  // src/openai-provider.ts
5848
5862
  function createOpenAI(options = {}) {