@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 2.0.37
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6075c91: feat(provider/openai): only send item references for reasoning when store: true
|
|
8
|
+
|
|
9
|
+
## 2.0.36
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- bc5ed71: chore: update zod peer depenedency version
|
|
14
|
+
- Updated dependencies [bc5ed71]
|
|
15
|
+
- @ai-sdk/provider-utils@3.0.10
|
|
16
|
+
|
|
3
17
|
## 2.0.35
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -2087,26 +2087,40 @@ async function convertToOpenAIResponsesInput({
|
|
|
2087
2087
|
});
|
|
2088
2088
|
const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
|
|
2089
2089
|
if (reasoningId != null) {
|
|
2090
|
-
const
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
if (existingReasoningMessage === void 0) {
|
|
2101
|
-
reasoningMessages[reasoningId] = {
|
|
2102
|
-
type: "reasoning",
|
|
2103
|
-
id: reasoningId,
|
|
2104
|
-
encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
|
|
2105
|
-
summary: summaryParts
|
|
2106
|
-
};
|
|
2107
|
-
input.push(reasoningMessages[reasoningId]);
|
|
2090
|
+
const reasoningMessage = reasoningMessages[reasoningId];
|
|
2091
|
+
if (store) {
|
|
2092
|
+
if (reasoningMessage === void 0) {
|
|
2093
|
+
input.push({ type: "item_reference", id: reasoningId });
|
|
2094
|
+
reasoningMessages[reasoningId] = {
|
|
2095
|
+
type: "reasoning",
|
|
2096
|
+
id: reasoningId,
|
|
2097
|
+
summary: []
|
|
2098
|
+
};
|
|
2099
|
+
}
|
|
2108
2100
|
} else {
|
|
2109
|
-
|
|
2101
|
+
const summaryParts = [];
|
|
2102
|
+
if (part.text.length > 0) {
|
|
2103
|
+
summaryParts.push({
|
|
2104
|
+
type: "summary_text",
|
|
2105
|
+
text: part.text
|
|
2106
|
+
});
|
|
2107
|
+
} else if (reasoningMessage !== void 0) {
|
|
2108
|
+
warnings.push({
|
|
2109
|
+
type: "other",
|
|
2110
|
+
message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
|
|
2111
|
+
});
|
|
2112
|
+
}
|
|
2113
|
+
if (reasoningMessage === void 0) {
|
|
2114
|
+
reasoningMessages[reasoningId] = {
|
|
2115
|
+
type: "reasoning",
|
|
2116
|
+
id: reasoningId,
|
|
2117
|
+
encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
|
|
2118
|
+
summary: summaryParts
|
|
2119
|
+
};
|
|
2120
|
+
input.push(reasoningMessages[reasoningId]);
|
|
2121
|
+
} else {
|
|
2122
|
+
reasoningMessage.summary.push(...summaryParts);
|
|
2123
|
+
}
|
|
2110
2124
|
}
|
|
2111
2125
|
} else {
|
|
2112
2126
|
warnings.push({
|
|
@@ -3869,7 +3883,7 @@ var openaiTranscriptionResponseSchema = import_v418.z.object({
|
|
|
3869
3883
|
});
|
|
3870
3884
|
|
|
3871
3885
|
// src/version.ts
|
|
3872
|
-
var VERSION = true ? "2.0.
|
|
3886
|
+
var VERSION = true ? "2.0.37" : "0.0.0-test";
|
|
3873
3887
|
|
|
3874
3888
|
// src/openai-provider.ts
|
|
3875
3889
|
function createOpenAI(options = {}) {
|