@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/CHANGELOG.md +17 -0
- package/dist/index.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +20 -4
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +20 -4
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/responses/convert-to-openai-responses-input.ts +30 -4
- package/src/responses/openai-responses-api.ts +1 -1
package/package.json
CHANGED
|
@@ -428,10 +428,36 @@ export async function convertToOpenAIResponsesInput({
|
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
} else {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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
|
}
|