@ai-sdk/openai 3.0.34 → 3.0.35

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": "3.0.34",
3
+ "version": "3.0.35",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -428,10 +428,36 @@ export async function convertToOpenAIResponsesInput({
428
428
  }
429
429
  }
430
430
  } else {
431
- warnings.push({
432
- type: 'other',
433
- message: `Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(part)}.`,
434
- });
431
+ // No itemId — fall back to encrypted_content if available.
432
+ // The OpenAI Responses API accepts reasoning items without an
433
+ // id when encrypted_content is provided, enabling multi-turn
434
+ // reasoning even when server-side item persistence is not used
435
+ // or when itemId has been stripped from providerOptions.
436
+ const encryptedContent =
437
+ providerOptions?.reasoningEncryptedContent;
438
+
439
+ if (encryptedContent != null) {
440
+ const summaryParts: Array<{
441
+ type: 'summary_text';
442
+ text: string;
443
+ }> = [];
444
+ if (part.text.length > 0) {
445
+ summaryParts.push({
446
+ type: 'summary_text',
447
+ text: part.text,
448
+ });
449
+ }
450
+ input.push({
451
+ type: 'reasoning',
452
+ encrypted_content: encryptedContent,
453
+ summary: summaryParts,
454
+ });
455
+ } else {
456
+ warnings.push({
457
+ type: 'other',
458
+ message: `Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(part)}.`,
459
+ });
460
+ }
435
461
  }
436
462
  break;
437
463
  }
@@ -381,7 +381,7 @@ export type OpenAIResponsesTool =
381
381
 
382
382
  export type OpenAIResponsesReasoning = {
383
383
  type: 'reasoning';
384
- id: string;
384
+ id?: string;
385
385
  encrypted_content?: string | null;
386
386
  summary: Array<{
387
387
  type: 'summary_text';