@ai-sdk/openai 4.0.86 → 4.0.87

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,11 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 4.0.87
4
+
5
+ ### Patch Changes
6
+
7
+ - bccc1b7: fix(openai): avoid duplicate references for stored messages with multiple text parts
8
+
3
9
  ## 4.0.86
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -4834,6 +4834,7 @@ async function convertToOpenAIResponsesInput({ prompt, toolNameMapping, systemMe
4834
4834
  break;
4835
4835
  case "assistant": {
4836
4836
  const reasoningMessages = {};
4837
+ const emittedTextItemIds = /* @__PURE__ */ new Set();
4837
4838
  for (const part of content) switch (part.type) {
4838
4839
  case "text": {
4839
4840
  const providerOptions = part.providerOptions?.[providerOptionsName];
@@ -4841,10 +4842,13 @@ async function convertToOpenAIResponsesInput({ prompt, toolNameMapping, systemMe
4841
4842
  const phase = providerOptions?.phase;
4842
4843
  if (hasConversation && id != null) break;
4843
4844
  if (store && id != null) {
4844
- input.push({
4845
- type: "item_reference",
4846
- id
4847
- });
4845
+ if (!emittedTextItemIds.has(id)) {
4846
+ emittedTextItemIds.add(id);
4847
+ input.push({
4848
+ type: "item_reference",
4849
+ id
4850
+ });
4851
+ }
4848
4852
  break;
4849
4853
  }
4850
4854
  input.push({
@@ -10038,7 +10042,7 @@ var OpenAISkills = class {
10038
10042
  };
10039
10043
  //#endregion
10040
10044
  //#region src/version.ts
10041
- const VERSION = "4.0.86";
10045
+ const VERSION = "4.0.87";
10042
10046
  //#endregion
10043
10047
  //#region src/openai-provider.ts
10044
10048
  /**