@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/openai",
3
- "version": "4.0.86",
3
+ "version": "4.0.87",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -649,6 +649,7 @@ export async function convertToOpenAIResponsesInput({
649
649
 
650
650
  case 'assistant': {
651
651
  const reasoningMessages: Record<string, OpenAIResponsesReasoning> = {};
652
+ const emittedTextItemIds = new Set<string>();
652
653
 
653
654
  for (const part of content) {
654
655
  switch (part.type) {
@@ -669,7 +670,10 @@ export async function convertToOpenAIResponsesInput({
669
670
 
670
671
  // item references reduce the payload size
671
672
  if (store && id != null) {
672
- input.push({ type: 'item_reference', id });
673
+ if (!emittedTextItemIds.has(id)) {
674
+ emittedTextItemIds.add(id);
675
+ input.push({ type: 'item_reference', id });
676
+ }
673
677
  break;
674
678
  }
675
679