@ai-sdk/openai 2.0.0-beta.8 → 2.0.0-beta.9
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 +6 -0
- package/dist/index.js +19 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +19 -7
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +19 -7
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/internal/index.js
CHANGED
|
@@ -1988,7 +1988,7 @@ async function convertToOpenAIResponsesMessages({
|
|
|
1988
1988
|
prompt,
|
|
1989
1989
|
systemMessageMode
|
|
1990
1990
|
}) {
|
|
1991
|
-
var _a, _b, _c, _d, _e;
|
|
1991
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1992
1992
|
const messages = [];
|
|
1993
1993
|
const warnings = [];
|
|
1994
1994
|
for (const { role, content } of prompt) {
|
|
@@ -2066,7 +2066,8 @@ async function convertToOpenAIResponsesMessages({
|
|
|
2066
2066
|
case "text": {
|
|
2067
2067
|
messages.push({
|
|
2068
2068
|
role: "assistant",
|
|
2069
|
-
content: [{ type: "output_text", text: part.text }]
|
|
2069
|
+
content: [{ type: "output_text", text: part.text }],
|
|
2070
|
+
id: (_c = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId) != null ? _c : void 0
|
|
2070
2071
|
});
|
|
2071
2072
|
break;
|
|
2072
2073
|
}
|
|
@@ -2079,7 +2080,7 @@ async function convertToOpenAIResponsesMessages({
|
|
|
2079
2080
|
call_id: part.toolCallId,
|
|
2080
2081
|
name: part.toolName,
|
|
2081
2082
|
arguments: JSON.stringify(part.input),
|
|
2082
|
-
id: (
|
|
2083
|
+
id: (_f = (_e = (_d = part.providerOptions) == null ? void 0 : _d.openai) == null ? void 0 : _e.itemId) != null ? _f : void 0
|
|
2083
2084
|
});
|
|
2084
2085
|
break;
|
|
2085
2086
|
}
|
|
@@ -2096,7 +2097,7 @@ async function convertToOpenAIResponsesMessages({
|
|
|
2096
2097
|
providerOptions: part.providerOptions,
|
|
2097
2098
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
2098
2099
|
});
|
|
2099
|
-
const reasoningId = (
|
|
2100
|
+
const reasoningId = (_g = providerOptions == null ? void 0 : providerOptions.reasoning) == null ? void 0 : _g.id;
|
|
2100
2101
|
if (reasoningId != null) {
|
|
2101
2102
|
const existingReasoningMessage = reasoningMessages[reasoningId];
|
|
2102
2103
|
const summaryParts = [];
|
|
@@ -2112,7 +2113,7 @@ async function convertToOpenAIResponsesMessages({
|
|
|
2112
2113
|
reasoningMessages[reasoningId] = {
|
|
2113
2114
|
type: "reasoning",
|
|
2114
2115
|
id: reasoningId,
|
|
2115
|
-
encrypted_content: (
|
|
2116
|
+
encrypted_content: (_h = providerOptions == null ? void 0 : providerOptions.reasoning) == null ? void 0 : _h.encryptedContent,
|
|
2116
2117
|
summary: summaryParts
|
|
2117
2118
|
};
|
|
2118
2119
|
messages.push(reasoningMessages[reasoningId]);
|
|
@@ -2457,6 +2458,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2457
2458
|
import_v415.z.object({
|
|
2458
2459
|
type: import_v415.z.literal("message"),
|
|
2459
2460
|
role: import_v415.z.literal("assistant"),
|
|
2461
|
+
id: import_v415.z.string(),
|
|
2460
2462
|
content: import_v415.z.array(
|
|
2461
2463
|
import_v415.z.object({
|
|
2462
2464
|
type: import_v415.z.literal("output_text"),
|
|
@@ -2548,7 +2550,12 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2548
2550
|
for (const contentPart of part.content) {
|
|
2549
2551
|
content.push({
|
|
2550
2552
|
type: "text",
|
|
2551
|
-
text: contentPart.text
|
|
2553
|
+
text: contentPart.text,
|
|
2554
|
+
providerMetadata: {
|
|
2555
|
+
openai: {
|
|
2556
|
+
itemId: part.id
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2552
2559
|
});
|
|
2553
2560
|
for (const annotation of contentPart.annotations) {
|
|
2554
2561
|
content.push({
|
|
@@ -2725,7 +2732,12 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2725
2732
|
} else if (value.item.type === "message") {
|
|
2726
2733
|
controller.enqueue({
|
|
2727
2734
|
type: "text-start",
|
|
2728
|
-
id: value.item.id
|
|
2735
|
+
id: value.item.id,
|
|
2736
|
+
providerMetadata: {
|
|
2737
|
+
openai: {
|
|
2738
|
+
itemId: value.item.id
|
|
2739
|
+
}
|
|
2740
|
+
}
|
|
2729
2741
|
});
|
|
2730
2742
|
} else if (isResponseOutputItemAddedReasoningChunk(value)) {
|
|
2731
2743
|
activeReasoning[value.item.id] = {
|