@ai-sdk/openai 3.0.12 → 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.
@@ -2492,6 +2492,7 @@ async function convertToOpenAIResponsesInput({
2492
2492
  providerOptionsName,
2493
2493
  fileIdPrefixes,
2494
2494
  store,
2495
+ hasConversation = false,
2495
2496
  hasLocalShellTool = false,
2496
2497
  hasShellTool = false,
2497
2498
  hasApplyPatchTool = false
@@ -2578,6 +2579,9 @@ async function convertToOpenAIResponsesInput({
2578
2579
  switch (part.type) {
2579
2580
  case "text": {
2580
2581
  const id = (_b = (_a = part.providerOptions) == null ? void 0 : _a[providerOptionsName]) == null ? void 0 : _b.itemId;
2582
+ if (hasConversation && id != null) {
2583
+ break;
2584
+ }
2581
2585
  if (store && id != null) {
2582
2586
  input.push({ type: "item_reference", id });
2583
2587
  break;
@@ -2591,6 +2595,9 @@ async function convertToOpenAIResponsesInput({
2591
2595
  }
2592
2596
  case "tool-call": {
2593
2597
  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;
2598
+ if (hasConversation && id != null) {
2599
+ break;
2600
+ }
2594
2601
  if (part.providerExecuted) {
2595
2602
  if (store && id != null) {
2596
2603
  input.push({ type: "item_reference", id });
@@ -2656,6 +2663,9 @@ async function convertToOpenAIResponsesInput({
2656
2663
  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") {
2657
2664
  break;
2658
2665
  }
2666
+ if (hasConversation) {
2667
+ break;
2668
+ }
2659
2669
  if (store) {
2660
2670
  const itemId = (_j = (_i = (_h = part.providerMetadata) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.itemId) != null ? _j : part.toolCallId;
2661
2671
  input.push({ type: "item_reference", id: itemId });
@@ -2674,6 +2684,9 @@ async function convertToOpenAIResponsesInput({
2674
2684
  schema: openaiResponsesReasoningProviderOptionsSchema
2675
2685
  });
2676
2686
  const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
2687
+ if (hasConversation && reasoningId != null) {
2688
+ break;
2689
+ }
2677
2690
  if (reasoningId != null) {
2678
2691
  const reasoningMessage = reasoningMessages[reasoningId];
2679
2692
  if (store) {
@@ -4400,6 +4413,7 @@ var OpenAIResponsesLanguageModel = class {
4400
4413
  providerOptionsName,
4401
4414
  fileIdPrefixes: this.config.fileIdPrefixes,
4402
4415
  store: (_c = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _c : true,
4416
+ hasConversation: (openaiOptions == null ? void 0 : openaiOptions.conversation) != null,
4403
4417
  hasLocalShellTool: hasOpenAITool("openai.local_shell"),
4404
4418
  hasShellTool: hasOpenAITool("openai.shell"),
4405
4419
  hasApplyPatchTool: hasOpenAITool("openai.apply_patch")