@ai-sdk/openai 2.1.0-beta.4 → 2.1.0-beta.6
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 +14 -0
- package/dist/index.js +34 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -20
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +33 -19
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +33 -19
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
|
@@ -2176,26 +2176,40 @@ async function convertToOpenAIResponsesInput({
|
|
|
2176
2176
|
});
|
|
2177
2177
|
const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
|
|
2178
2178
|
if (reasoningId != null) {
|
|
2179
|
-
const
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
if (existingReasoningMessage === void 0) {
|
|
2190
|
-
reasoningMessages[reasoningId] = {
|
|
2191
|
-
type: "reasoning",
|
|
2192
|
-
id: reasoningId,
|
|
2193
|
-
encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
|
|
2194
|
-
summary: summaryParts
|
|
2195
|
-
};
|
|
2196
|
-
input.push(reasoningMessages[reasoningId]);
|
|
2179
|
+
const reasoningMessage = reasoningMessages[reasoningId];
|
|
2180
|
+
if (store) {
|
|
2181
|
+
if (reasoningMessage === void 0) {
|
|
2182
|
+
input.push({ type: "item_reference", id: reasoningId });
|
|
2183
|
+
reasoningMessages[reasoningId] = {
|
|
2184
|
+
type: "reasoning",
|
|
2185
|
+
id: reasoningId,
|
|
2186
|
+
summary: []
|
|
2187
|
+
};
|
|
2188
|
+
}
|
|
2197
2189
|
} else {
|
|
2198
|
-
|
|
2190
|
+
const summaryParts = [];
|
|
2191
|
+
if (part.text.length > 0) {
|
|
2192
|
+
summaryParts.push({
|
|
2193
|
+
type: "summary_text",
|
|
2194
|
+
text: part.text
|
|
2195
|
+
});
|
|
2196
|
+
} else if (reasoningMessage !== void 0) {
|
|
2197
|
+
warnings.push({
|
|
2198
|
+
type: "other",
|
|
2199
|
+
message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
|
|
2200
|
+
});
|
|
2201
|
+
}
|
|
2202
|
+
if (reasoningMessage === void 0) {
|
|
2203
|
+
reasoningMessages[reasoningId] = {
|
|
2204
|
+
type: "reasoning",
|
|
2205
|
+
id: reasoningId,
|
|
2206
|
+
encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
|
|
2207
|
+
summary: summaryParts
|
|
2208
|
+
};
|
|
2209
|
+
input.push(reasoningMessages[reasoningId]);
|
|
2210
|
+
} else {
|
|
2211
|
+
reasoningMessage.summary.push(...summaryParts);
|
|
2212
|
+
}
|
|
2199
2213
|
}
|
|
2200
2214
|
} else {
|
|
2201
2215
|
warnings.push({
|