@ai-sdk/openai 2.0.49 → 2.0.50
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 +15 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +14 -4
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +14 -4
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/internal/index.mjs
CHANGED
|
@@ -2207,7 +2207,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2207
2207
|
store,
|
|
2208
2208
|
hasLocalShellTool = false
|
|
2209
2209
|
}) {
|
|
2210
|
-
var _a, _b, _c, _d
|
|
2210
|
+
var _a, _b, _c, _d;
|
|
2211
2211
|
const input = [];
|
|
2212
2212
|
const warnings = [];
|
|
2213
2213
|
for (const { role, content } of prompt) {
|
|
@@ -2288,10 +2288,15 @@ async function convertToOpenAIResponsesInput({
|
|
|
2288
2288
|
for (const part of content) {
|
|
2289
2289
|
switch (part.type) {
|
|
2290
2290
|
case "text": {
|
|
2291
|
+
const id = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId;
|
|
2292
|
+
if (store && id != null) {
|
|
2293
|
+
input.push({ type: "item_reference", id });
|
|
2294
|
+
break;
|
|
2295
|
+
}
|
|
2291
2296
|
input.push({
|
|
2292
2297
|
role: "assistant",
|
|
2293
2298
|
content: [{ type: "output_text", text: part.text }],
|
|
2294
|
-
id
|
|
2299
|
+
id
|
|
2295
2300
|
});
|
|
2296
2301
|
break;
|
|
2297
2302
|
}
|
|
@@ -2300,6 +2305,11 @@ async function convertToOpenAIResponsesInput({
|
|
|
2300
2305
|
if (part.providerExecuted) {
|
|
2301
2306
|
break;
|
|
2302
2307
|
}
|
|
2308
|
+
const id = (_d = (_c = part.providerOptions) == null ? void 0 : _c.openai) == null ? void 0 : _d.itemId;
|
|
2309
|
+
if (store && id != null) {
|
|
2310
|
+
input.push({ type: "item_reference", id });
|
|
2311
|
+
break;
|
|
2312
|
+
}
|
|
2303
2313
|
if (hasLocalShellTool && part.toolName === "local_shell") {
|
|
2304
2314
|
const parsedInput = await validateTypes({
|
|
2305
2315
|
value: part.input,
|
|
@@ -2308,7 +2318,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2308
2318
|
input.push({
|
|
2309
2319
|
type: "local_shell_call",
|
|
2310
2320
|
call_id: part.toolCallId,
|
|
2311
|
-
id
|
|
2321
|
+
id,
|
|
2312
2322
|
action: {
|
|
2313
2323
|
type: "exec",
|
|
2314
2324
|
command: parsedInput.action.command,
|
|
@@ -2325,7 +2335,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2325
2335
|
call_id: part.toolCallId,
|
|
2326
2336
|
name: part.toolName,
|
|
2327
2337
|
arguments: JSON.stringify(part.input),
|
|
2328
|
-
id
|
|
2338
|
+
id
|
|
2329
2339
|
});
|
|
2330
2340
|
break;
|
|
2331
2341
|
}
|