@ai-sdk/openai 2.0.35 → 2.0.37
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/index.mjs
CHANGED
|
@@ -2108,26 +2108,40 @@ async function convertToOpenAIResponsesInput({
|
|
|
2108
2108
|
});
|
|
2109
2109
|
const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
|
|
2110
2110
|
if (reasoningId != null) {
|
|
2111
|
-
const
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
if (existingReasoningMessage === void 0) {
|
|
2122
|
-
reasoningMessages[reasoningId] = {
|
|
2123
|
-
type: "reasoning",
|
|
2124
|
-
id: reasoningId,
|
|
2125
|
-
encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
|
|
2126
|
-
summary: summaryParts
|
|
2127
|
-
};
|
|
2128
|
-
input.push(reasoningMessages[reasoningId]);
|
|
2111
|
+
const reasoningMessage = reasoningMessages[reasoningId];
|
|
2112
|
+
if (store) {
|
|
2113
|
+
if (reasoningMessage === void 0) {
|
|
2114
|
+
input.push({ type: "item_reference", id: reasoningId });
|
|
2115
|
+
reasoningMessages[reasoningId] = {
|
|
2116
|
+
type: "reasoning",
|
|
2117
|
+
id: reasoningId,
|
|
2118
|
+
summary: []
|
|
2119
|
+
};
|
|
2120
|
+
}
|
|
2129
2121
|
} else {
|
|
2130
|
-
|
|
2122
|
+
const summaryParts = [];
|
|
2123
|
+
if (part.text.length > 0) {
|
|
2124
|
+
summaryParts.push({
|
|
2125
|
+
type: "summary_text",
|
|
2126
|
+
text: part.text
|
|
2127
|
+
});
|
|
2128
|
+
} else if (reasoningMessage !== void 0) {
|
|
2129
|
+
warnings.push({
|
|
2130
|
+
type: "other",
|
|
2131
|
+
message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
if (reasoningMessage === void 0) {
|
|
2135
|
+
reasoningMessages[reasoningId] = {
|
|
2136
|
+
type: "reasoning",
|
|
2137
|
+
id: reasoningId,
|
|
2138
|
+
encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
|
|
2139
|
+
summary: summaryParts
|
|
2140
|
+
};
|
|
2141
|
+
input.push(reasoningMessages[reasoningId]);
|
|
2142
|
+
} else {
|
|
2143
|
+
reasoningMessage.summary.push(...summaryParts);
|
|
2144
|
+
}
|
|
2131
2145
|
}
|
|
2132
2146
|
} else {
|
|
2133
2147
|
warnings.push({
|
|
@@ -3904,7 +3918,7 @@ var openaiTranscriptionResponseSchema = z18.object({
|
|
|
3904
3918
|
});
|
|
3905
3919
|
|
|
3906
3920
|
// src/version.ts
|
|
3907
|
-
var VERSION = true ? "2.0.
|
|
3921
|
+
var VERSION = true ? "2.0.37" : "0.0.0-test";
|
|
3908
3922
|
|
|
3909
3923
|
// src/openai-provider.ts
|
|
3910
3924
|
function createOpenAI(options = {}) {
|