@ai-sdk/openai 3.0.0-beta.26 → 3.0.0-beta.27
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 +16 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +15 -5
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +15 -5
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.js
CHANGED
|
@@ -2175,7 +2175,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2175
2175
|
store,
|
|
2176
2176
|
hasLocalShellTool = false
|
|
2177
2177
|
}) {
|
|
2178
|
-
var _a, _b, _c, _d, _e
|
|
2178
|
+
var _a, _b, _c, _d, _e;
|
|
2179
2179
|
const input = [];
|
|
2180
2180
|
const warnings = [];
|
|
2181
2181
|
for (const { role, content } of prompt) {
|
|
@@ -2256,10 +2256,15 @@ async function convertToOpenAIResponsesInput({
|
|
|
2256
2256
|
for (const part of content) {
|
|
2257
2257
|
switch (part.type) {
|
|
2258
2258
|
case "text": {
|
|
2259
|
+
const id = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId;
|
|
2260
|
+
if (store && id != null) {
|
|
2261
|
+
input.push({ type: "item_reference", id });
|
|
2262
|
+
break;
|
|
2263
|
+
}
|
|
2259
2264
|
input.push({
|
|
2260
2265
|
role: "assistant",
|
|
2261
2266
|
content: [{ type: "output_text", text: part.text }],
|
|
2262
|
-
id
|
|
2267
|
+
id
|
|
2263
2268
|
});
|
|
2264
2269
|
break;
|
|
2265
2270
|
}
|
|
@@ -2268,6 +2273,11 @@ async function convertToOpenAIResponsesInput({
|
|
|
2268
2273
|
if (part.providerExecuted) {
|
|
2269
2274
|
break;
|
|
2270
2275
|
}
|
|
2276
|
+
const id = (_d = (_c = part.providerOptions) == null ? void 0 : _c.openai) == null ? void 0 : _d.itemId;
|
|
2277
|
+
if (store && id != null) {
|
|
2278
|
+
input.push({ type: "item_reference", id });
|
|
2279
|
+
break;
|
|
2280
|
+
}
|
|
2271
2281
|
if (hasLocalShellTool && part.toolName === "local_shell") {
|
|
2272
2282
|
const parsedInput = await (0, import_provider_utils20.validateTypes)({
|
|
2273
2283
|
value: part.input,
|
|
@@ -2276,7 +2286,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2276
2286
|
input.push({
|
|
2277
2287
|
type: "local_shell_call",
|
|
2278
2288
|
call_id: part.toolCallId,
|
|
2279
|
-
id
|
|
2289
|
+
id,
|
|
2280
2290
|
action: {
|
|
2281
2291
|
type: "exec",
|
|
2282
2292
|
command: parsedInput.action.command,
|
|
@@ -2293,7 +2303,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2293
2303
|
call_id: part.toolCallId,
|
|
2294
2304
|
name: part.toolName,
|
|
2295
2305
|
arguments: JSON.stringify(part.input),
|
|
2296
|
-
id
|
|
2306
|
+
id
|
|
2297
2307
|
});
|
|
2298
2308
|
break;
|
|
2299
2309
|
}
|
|
@@ -2386,7 +2396,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2386
2396
|
contentValue = output.value;
|
|
2387
2397
|
break;
|
|
2388
2398
|
case "execution-denied":
|
|
2389
|
-
contentValue = (
|
|
2399
|
+
contentValue = (_e = output.reason) != null ? _e : "Tool execution denied.";
|
|
2390
2400
|
break;
|
|
2391
2401
|
case "json":
|
|
2392
2402
|
case "error-json":
|