@ai-sdk/openai 3.0.0-beta.25 → 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 +12 -0
- package/dist/index.js +27 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -8
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +26 -7
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +26 -7
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/internal/index.mjs
CHANGED
|
@@ -2190,7 +2190,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2190
2190
|
store,
|
|
2191
2191
|
hasLocalShellTool = false
|
|
2192
2192
|
}) {
|
|
2193
|
-
var _a, _b, _c, _d, _e
|
|
2193
|
+
var _a, _b, _c, _d, _e;
|
|
2194
2194
|
const input = [];
|
|
2195
2195
|
const warnings = [];
|
|
2196
2196
|
for (const { role, content } of prompt) {
|
|
@@ -2271,10 +2271,15 @@ async function convertToOpenAIResponsesInput({
|
|
|
2271
2271
|
for (const part of content) {
|
|
2272
2272
|
switch (part.type) {
|
|
2273
2273
|
case "text": {
|
|
2274
|
+
const id = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId;
|
|
2275
|
+
if (store && id != null) {
|
|
2276
|
+
input.push({ type: "item_reference", id });
|
|
2277
|
+
break;
|
|
2278
|
+
}
|
|
2274
2279
|
input.push({
|
|
2275
2280
|
role: "assistant",
|
|
2276
2281
|
content: [{ type: "output_text", text: part.text }],
|
|
2277
|
-
id
|
|
2282
|
+
id
|
|
2278
2283
|
});
|
|
2279
2284
|
break;
|
|
2280
2285
|
}
|
|
@@ -2283,6 +2288,11 @@ async function convertToOpenAIResponsesInput({
|
|
|
2283
2288
|
if (part.providerExecuted) {
|
|
2284
2289
|
break;
|
|
2285
2290
|
}
|
|
2291
|
+
const id = (_d = (_c = part.providerOptions) == null ? void 0 : _c.openai) == null ? void 0 : _d.itemId;
|
|
2292
|
+
if (store && id != null) {
|
|
2293
|
+
input.push({ type: "item_reference", id });
|
|
2294
|
+
break;
|
|
2295
|
+
}
|
|
2286
2296
|
if (hasLocalShellTool && part.toolName === "local_shell") {
|
|
2287
2297
|
const parsedInput = await validateTypes({
|
|
2288
2298
|
value: part.input,
|
|
@@ -2291,7 +2301,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2291
2301
|
input.push({
|
|
2292
2302
|
type: "local_shell_call",
|
|
2293
2303
|
call_id: part.toolCallId,
|
|
2294
|
-
id
|
|
2304
|
+
id,
|
|
2295
2305
|
action: {
|
|
2296
2306
|
type: "exec",
|
|
2297
2307
|
command: parsedInput.action.command,
|
|
@@ -2308,7 +2318,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2308
2318
|
call_id: part.toolCallId,
|
|
2309
2319
|
name: part.toolName,
|
|
2310
2320
|
arguments: JSON.stringify(part.input),
|
|
2311
|
-
id
|
|
2321
|
+
id
|
|
2312
2322
|
});
|
|
2313
2323
|
break;
|
|
2314
2324
|
}
|
|
@@ -2401,7 +2411,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2401
2411
|
contentValue = output.value;
|
|
2402
2412
|
break;
|
|
2403
2413
|
case "execution-denied":
|
|
2404
|
-
contentValue = (
|
|
2414
|
+
contentValue = (_e = output.reason) != null ? _e : "Tool execution denied.";
|
|
2405
2415
|
break;
|
|
2406
2416
|
case "json":
|
|
2407
2417
|
case "error-json":
|
|
@@ -2955,6 +2965,7 @@ var openaiResponsesProviderOptionsSchema = lazySchema13(
|
|
|
2955
2965
|
include: z15.array(
|
|
2956
2966
|
z15.enum([
|
|
2957
2967
|
"reasoning.encrypted_content",
|
|
2968
|
+
// handled internally by default, only needed for unknown reasoning models
|
|
2958
2969
|
"file_search_call.results",
|
|
2959
2970
|
"message.output_text.logprobs"
|
|
2960
2971
|
])
|
|
@@ -3475,7 +3486,11 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3475
3486
|
const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : false;
|
|
3476
3487
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
3477
3488
|
function addInclude(key) {
|
|
3478
|
-
|
|
3489
|
+
if (include == null) {
|
|
3490
|
+
include = [key];
|
|
3491
|
+
} else if (!include.includes(key)) {
|
|
3492
|
+
include = [...include, key];
|
|
3493
|
+
}
|
|
3479
3494
|
}
|
|
3480
3495
|
function hasOpenAITool(id) {
|
|
3481
3496
|
return (tools == null ? void 0 : tools.find(
|
|
@@ -3495,6 +3510,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3495
3510
|
if (hasOpenAITool("openai.code_interpreter")) {
|
|
3496
3511
|
addInclude("code_interpreter_call.outputs");
|
|
3497
3512
|
}
|
|
3513
|
+
const store = openaiOptions == null ? void 0 : openaiOptions.store;
|
|
3514
|
+
if (store === false && modelConfig.isReasoningModel) {
|
|
3515
|
+
addInclude("reasoning.encrypted_content");
|
|
3516
|
+
}
|
|
3498
3517
|
const baseArgs = {
|
|
3499
3518
|
model: this.modelId,
|
|
3500
3519
|
input,
|
|
@@ -3522,7 +3541,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3522
3541
|
metadata: openaiOptions == null ? void 0 : openaiOptions.metadata,
|
|
3523
3542
|
parallel_tool_calls: openaiOptions == null ? void 0 : openaiOptions.parallelToolCalls,
|
|
3524
3543
|
previous_response_id: openaiOptions == null ? void 0 : openaiOptions.previousResponseId,
|
|
3525
|
-
store
|
|
3544
|
+
store,
|
|
3526
3545
|
user: openaiOptions == null ? void 0 : openaiOptions.user,
|
|
3527
3546
|
instructions: openaiOptions == null ? void 0 : openaiOptions.instructions,
|
|
3528
3547
|
service_tier: openaiOptions == null ? void 0 : openaiOptions.serviceTier,
|