@ai-sdk/openai 3.0.124 → 3.0.125
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 +7 -0
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +73 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +15 -15
- package/dist/internal/index.d.ts +15 -15
- package/dist/internal/index.js +964 -898
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +956 -889
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/responses/convert-to-openai-responses-input.ts +89 -0
- package/src/responses/openai-responses-api.ts +9 -1
package/dist/internal/index.js
CHANGED
|
@@ -2816,8 +2816,8 @@ function convertOpenAIResponsesUsage(usage) {
|
|
|
2816
2816
|
|
|
2817
2817
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2818
2818
|
var import_provider8 = require("@ai-sdk/provider");
|
|
2819
|
-
var
|
|
2820
|
-
var
|
|
2819
|
+
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
2820
|
+
var import_v419 = require("zod/v4");
|
|
2821
2821
|
|
|
2822
2822
|
// src/responses/openai-responses-options.ts
|
|
2823
2823
|
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
@@ -3317,9 +3317,67 @@ var toolSearchToolFactory = (0, import_provider_utils24.createProviderToolFactor
|
|
|
3317
3317
|
outputSchema: toolSearchOutputSchema
|
|
3318
3318
|
});
|
|
3319
3319
|
|
|
3320
|
+
// src/tool/web-search.ts
|
|
3321
|
+
var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
3322
|
+
var import_v418 = require("zod/v4");
|
|
3323
|
+
var webSearchArgsSchema = (0, import_provider_utils25.lazySchema)(
|
|
3324
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3325
|
+
import_v418.z.object({
|
|
3326
|
+
externalWebAccess: import_v418.z.boolean().optional(),
|
|
3327
|
+
filters: import_v418.z.object({
|
|
3328
|
+
allowedDomains: import_v418.z.array(import_v418.z.string()).optional(),
|
|
3329
|
+
blockedDomains: import_v418.z.array(import_v418.z.string()).optional()
|
|
3330
|
+
}).optional(),
|
|
3331
|
+
searchContextSize: import_v418.z.enum(["low", "medium", "high"]).optional(),
|
|
3332
|
+
userLocation: import_v418.z.object({
|
|
3333
|
+
type: import_v418.z.literal("approximate"),
|
|
3334
|
+
country: import_v418.z.string().optional(),
|
|
3335
|
+
city: import_v418.z.string().optional(),
|
|
3336
|
+
region: import_v418.z.string().optional(),
|
|
3337
|
+
timezone: import_v418.z.string().optional()
|
|
3338
|
+
}).optional()
|
|
3339
|
+
})
|
|
3340
|
+
)
|
|
3341
|
+
);
|
|
3342
|
+
var webSearchInputSchema = (0, import_provider_utils25.lazySchema)(() => (0, import_provider_utils25.zodSchema)(import_v418.z.object({})));
|
|
3343
|
+
var webSearchOutputSchema = (0, import_provider_utils25.lazySchema)(
|
|
3344
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3345
|
+
import_v418.z.object({
|
|
3346
|
+
action: import_v418.z.discriminatedUnion("type", [
|
|
3347
|
+
import_v418.z.object({
|
|
3348
|
+
type: import_v418.z.literal("search"),
|
|
3349
|
+
query: import_v418.z.string().optional(),
|
|
3350
|
+
queries: import_v418.z.array(import_v418.z.string()).optional()
|
|
3351
|
+
}),
|
|
3352
|
+
import_v418.z.object({
|
|
3353
|
+
type: import_v418.z.literal("openPage"),
|
|
3354
|
+
url: import_v418.z.string().nullish()
|
|
3355
|
+
}),
|
|
3356
|
+
import_v418.z.object({
|
|
3357
|
+
type: import_v418.z.literal("findInPage"),
|
|
3358
|
+
url: import_v418.z.string().nullish(),
|
|
3359
|
+
pattern: import_v418.z.string().nullish()
|
|
3360
|
+
})
|
|
3361
|
+
]).optional(),
|
|
3362
|
+
sources: import_v418.z.array(
|
|
3363
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3364
|
+
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
3365
|
+
import_v418.z.object({ type: import_v418.z.literal("api"), name: import_v418.z.string() })
|
|
3366
|
+
])
|
|
3367
|
+
).optional()
|
|
3368
|
+
})
|
|
3369
|
+
)
|
|
3370
|
+
);
|
|
3371
|
+
var webSearchToolFactory = (0, import_provider_utils25.createProviderToolFactoryWithOutputSchema)({
|
|
3372
|
+
id: "openai.web_search",
|
|
3373
|
+
inputSchema: webSearchInputSchema,
|
|
3374
|
+
outputSchema: webSearchOutputSchema
|
|
3375
|
+
});
|
|
3376
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
3377
|
+
|
|
3320
3378
|
// src/responses/expand-parallel-tool-call.ts
|
|
3321
3379
|
var import_provider7 = require("@ai-sdk/provider");
|
|
3322
|
-
var
|
|
3380
|
+
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
3323
3381
|
var parallelToolName = "parallel";
|
|
3324
3382
|
var recipientNamePrefix = "functions.";
|
|
3325
3383
|
function getParallelToolCallMetadata({
|
|
@@ -3348,7 +3406,7 @@ async function expandParallelToolCall({
|
|
|
3348
3406
|
if (!isUndeclaredParallelToolCall({ toolName: toolCall.toolName, tools })) {
|
|
3349
3407
|
return void 0;
|
|
3350
3408
|
}
|
|
3351
|
-
const parsedInput = await (0,
|
|
3409
|
+
const parsedInput = await (0, import_provider_utils26.safeParseJSON)({ text: toolCall.input });
|
|
3352
3410
|
if (!parsedInput.success || !(0, import_provider7.isJSONObject)(parsedInput.value)) {
|
|
3353
3411
|
return void 0;
|
|
3354
3412
|
}
|
|
@@ -3397,6 +3455,57 @@ async function expandParallelToolCall({
|
|
|
3397
3455
|
function serializeToolCallArguments2(input) {
|
|
3398
3456
|
return JSON.stringify(input === void 0 ? {} : input);
|
|
3399
3457
|
}
|
|
3458
|
+
async function convertWebSearchToolResultOutput({
|
|
3459
|
+
output,
|
|
3460
|
+
id
|
|
3461
|
+
}) {
|
|
3462
|
+
if (output.type !== "json") {
|
|
3463
|
+
return void 0;
|
|
3464
|
+
}
|
|
3465
|
+
const validation = await (0, import_provider_utils27.safeValidateTypes)({
|
|
3466
|
+
value: output.value,
|
|
3467
|
+
schema: webSearchOutputSchema
|
|
3468
|
+
});
|
|
3469
|
+
if (!validation.success || validation.value.action == null) {
|
|
3470
|
+
return void 0;
|
|
3471
|
+
}
|
|
3472
|
+
const { action, sources } = validation.value;
|
|
3473
|
+
switch (action.type) {
|
|
3474
|
+
case "search":
|
|
3475
|
+
return {
|
|
3476
|
+
type: "web_search_call",
|
|
3477
|
+
id,
|
|
3478
|
+
status: "completed",
|
|
3479
|
+
action: {
|
|
3480
|
+
type: "search",
|
|
3481
|
+
...action.query != null && { query: action.query },
|
|
3482
|
+
...action.queries != null && { queries: action.queries },
|
|
3483
|
+
...sources != null && { sources }
|
|
3484
|
+
}
|
|
3485
|
+
};
|
|
3486
|
+
case "openPage":
|
|
3487
|
+
return {
|
|
3488
|
+
type: "web_search_call",
|
|
3489
|
+
id,
|
|
3490
|
+
status: "completed",
|
|
3491
|
+
action: {
|
|
3492
|
+
type: "open_page",
|
|
3493
|
+
url: action.url
|
|
3494
|
+
}
|
|
3495
|
+
};
|
|
3496
|
+
case "findInPage":
|
|
3497
|
+
return {
|
|
3498
|
+
type: "web_search_call",
|
|
3499
|
+
id,
|
|
3500
|
+
status: "completed",
|
|
3501
|
+
action: {
|
|
3502
|
+
type: "find_in_page",
|
|
3503
|
+
url: action.url,
|
|
3504
|
+
pattern: action.pattern
|
|
3505
|
+
}
|
|
3506
|
+
};
|
|
3507
|
+
}
|
|
3508
|
+
}
|
|
3400
3509
|
async function convertFunctionToolResultOutput({
|
|
3401
3510
|
output,
|
|
3402
3511
|
promptCacheBreakpoint,
|
|
@@ -3506,7 +3615,7 @@ async function convertFunctionToolResultOutput({
|
|
|
3506
3615
|
return void 0;
|
|
3507
3616
|
}
|
|
3508
3617
|
}
|
|
3509
|
-
}).filter(
|
|
3618
|
+
}).filter(import_provider_utils27.isNonNullable);
|
|
3510
3619
|
}
|
|
3511
3620
|
}
|
|
3512
3621
|
function hasSameParallelToolCall(first, second) {
|
|
@@ -3557,7 +3666,7 @@ function collectCompleteParallelToolResultGroups({
|
|
|
3557
3666
|
{ length: group.metadata.count },
|
|
3558
3667
|
(_, index) => group.results.get(index)
|
|
3559
3668
|
);
|
|
3560
|
-
if (results.every(
|
|
3669
|
+
if (results.every(import_provider_utils27.isNonNullable)) {
|
|
3561
3670
|
completeGroups.set(toolCallId, {
|
|
3562
3671
|
metadata: group.metadata,
|
|
3563
3672
|
results
|
|
@@ -3603,7 +3712,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3603
3712
|
toolSearchToolName,
|
|
3604
3713
|
customProviderToolNames
|
|
3605
3714
|
}) {
|
|
3606
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
|
|
3715
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G;
|
|
3607
3716
|
let input = [];
|
|
3608
3717
|
const warnings = [];
|
|
3609
3718
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -3616,13 +3725,13 @@ async function convertToOpenAIResponsesInput({
|
|
|
3616
3725
|
for (const { role, content, providerOptions } of prompt) {
|
|
3617
3726
|
switch (role) {
|
|
3618
3727
|
case "system": {
|
|
3619
|
-
let options = await (0,
|
|
3728
|
+
let options = await (0, import_provider_utils27.parseProviderOptions)({
|
|
3620
3729
|
provider: providerOptionsName,
|
|
3621
3730
|
providerOptions,
|
|
3622
3731
|
schema: openaiResponsesSystemMessageOptionsSchema
|
|
3623
3732
|
});
|
|
3624
3733
|
if (options == null && providerOptionsName !== "openai") {
|
|
3625
|
-
options = await (0,
|
|
3734
|
+
options = await (0, import_provider_utils27.parseProviderOptions)({
|
|
3626
3735
|
provider: "openai",
|
|
3627
3736
|
providerOptions,
|
|
3628
3737
|
schema: openaiResponsesSystemMessageOptionsSchema
|
|
@@ -3726,7 +3835,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3726
3835
|
return {
|
|
3727
3836
|
type: "input_image",
|
|
3728
3837
|
...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
3729
|
-
image_url: `data:${mediaType};base64,${(0,
|
|
3838
|
+
image_url: `data:${mediaType};base64,${(0, import_provider_utils27.convertToBase64)(part.data)}`
|
|
3730
3839
|
},
|
|
3731
3840
|
detail: (_b2 = (_a3 = part.providerOptions) == null ? void 0 : _a3[providerOptionsName]) == null ? void 0 : _b2.imageDetail,
|
|
3732
3841
|
...promptCacheBreakpoint != null && {
|
|
@@ -3752,7 +3861,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3752
3861
|
type: "input_file",
|
|
3753
3862
|
...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
3754
3863
|
filename: (_c2 = part.filename) != null ? _c2 : mediaType === "application/pdf" ? `part-${index}.pdf` : `part-${index}`,
|
|
3755
|
-
file_data: `data:${mediaType};base64,${(0,
|
|
3864
|
+
file_data: `data:${mediaType};base64,${(0, import_provider_utils27.convertToBase64)(part.data)}`
|
|
3756
3865
|
},
|
|
3757
3866
|
...promptCacheBreakpoint != null && {
|
|
3758
3867
|
prompt_cache_breakpoint: promptCacheBreakpoint
|
|
@@ -3831,10 +3940,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
3831
3940
|
input.push({ type: "item_reference", id });
|
|
3832
3941
|
break;
|
|
3833
3942
|
}
|
|
3834
|
-
const parsedInput = typeof part.input === "string" ? await (0,
|
|
3943
|
+
const parsedInput = typeof part.input === "string" ? await (0, import_provider_utils27.parseJSON)({
|
|
3835
3944
|
text: part.input,
|
|
3836
3945
|
schema: toolSearchInputSchema
|
|
3837
|
-
}) : await (0,
|
|
3946
|
+
}) : await (0, import_provider_utils27.validateTypes)({
|
|
3838
3947
|
value: part.input,
|
|
3839
3948
|
schema: toolSearchInputSchema
|
|
3840
3949
|
});
|
|
@@ -3866,7 +3975,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3866
3975
|
break;
|
|
3867
3976
|
}
|
|
3868
3977
|
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
3869
|
-
const parsedInput = await (0,
|
|
3978
|
+
const parsedInput = await (0, import_provider_utils27.validateTypes)({
|
|
3870
3979
|
value: part.input,
|
|
3871
3980
|
schema: localShellInputSchema
|
|
3872
3981
|
});
|
|
@@ -3886,7 +3995,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3886
3995
|
break;
|
|
3887
3996
|
}
|
|
3888
3997
|
if (hasShellTool && resolvedToolName === "shell") {
|
|
3889
|
-
const parsedInput = await (0,
|
|
3998
|
+
const parsedInput = await (0, import_provider_utils27.validateTypes)({
|
|
3890
3999
|
value: part.input,
|
|
3891
4000
|
schema: shellInputSchema
|
|
3892
4001
|
});
|
|
@@ -3904,7 +4013,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3904
4013
|
break;
|
|
3905
4014
|
}
|
|
3906
4015
|
if (hasApplyPatchTool && resolvedToolName === "apply_patch") {
|
|
3907
|
-
const parsedInput = await (0,
|
|
4016
|
+
const parsedInput = await (0, import_provider_utils27.validateTypes)({
|
|
3908
4017
|
value: part.input,
|
|
3909
4018
|
schema: applyPatchInputSchema
|
|
3910
4019
|
});
|
|
@@ -3949,12 +4058,27 @@ async function convertToOpenAIResponsesInput({
|
|
|
3949
4058
|
const resolvedResultToolName = toolNameMapping.toProviderToolName(
|
|
3950
4059
|
part.toolName
|
|
3951
4060
|
);
|
|
4061
|
+
if (resolvedResultToolName === "web_search" || resolvedResultToolName === "web_search_preview") {
|
|
4062
|
+
const itemId = (_u = (_t = (_s = part.providerOptions) == null ? void 0 : _s[providerOptionsName]) == null ? void 0 : _t.itemId) != null ? _u : part.toolCallId;
|
|
4063
|
+
if (store) {
|
|
4064
|
+
input.push({ type: "item_reference", id: itemId });
|
|
4065
|
+
break;
|
|
4066
|
+
}
|
|
4067
|
+
const webSearchCall = await convertWebSearchToolResultOutput({
|
|
4068
|
+
output: part.output,
|
|
4069
|
+
id: itemId
|
|
4070
|
+
});
|
|
4071
|
+
if (webSearchCall != null) {
|
|
4072
|
+
input.push(webSearchCall);
|
|
4073
|
+
break;
|
|
4074
|
+
}
|
|
4075
|
+
}
|
|
3952
4076
|
if (part.toolName === toolSearchToolName) {
|
|
3953
|
-
const itemId = (
|
|
4077
|
+
const itemId = (_A = (_z = (_w = (_v = part.providerOptions) == null ? void 0 : _v[providerOptionsName]) == null ? void 0 : _w.itemId) != null ? _z : (_y = (_x = part.providerMetadata) == null ? void 0 : _x[providerOptionsName]) == null ? void 0 : _y.itemId) != null ? _A : part.toolCallId;
|
|
3954
4078
|
if (store) {
|
|
3955
4079
|
input.push({ type: "item_reference", id: itemId });
|
|
3956
4080
|
} else if (part.output.type === "json") {
|
|
3957
|
-
const parsedOutput = await (0,
|
|
4081
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
3958
4082
|
value: part.output.value,
|
|
3959
4083
|
schema: toolSearchOutputSchema
|
|
3960
4084
|
});
|
|
@@ -3971,7 +4095,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3971
4095
|
}
|
|
3972
4096
|
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
3973
4097
|
if (part.output.type === "json") {
|
|
3974
|
-
const parsedOutput = await (0,
|
|
4098
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
3975
4099
|
value: part.output.value,
|
|
3976
4100
|
schema: shellOutputSchema
|
|
3977
4101
|
});
|
|
@@ -3991,7 +4115,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3991
4115
|
break;
|
|
3992
4116
|
}
|
|
3993
4117
|
if (store) {
|
|
3994
|
-
const itemId = (
|
|
4118
|
+
const itemId = (_D = (_C = (_B = part.providerOptions) == null ? void 0 : _B[providerOptionsName]) == null ? void 0 : _C.itemId) != null ? _D : part.toolCallId;
|
|
3995
4119
|
input.push({ type: "item_reference", id: itemId });
|
|
3996
4120
|
} else {
|
|
3997
4121
|
warnings.push({
|
|
@@ -4002,7 +4126,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4002
4126
|
break;
|
|
4003
4127
|
}
|
|
4004
4128
|
case "reasoning": {
|
|
4005
|
-
const providerOptions2 = await (0,
|
|
4129
|
+
const providerOptions2 = await (0, import_provider_utils27.parseProviderOptions)({
|
|
4006
4130
|
provider: providerOptionsName,
|
|
4007
4131
|
providerOptions: part.providerOptions,
|
|
4008
4132
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -4158,7 +4282,7 @@ ${text}`,
|
|
|
4158
4282
|
}
|
|
4159
4283
|
const output = part.output;
|
|
4160
4284
|
if (output.type === "execution-denied") {
|
|
4161
|
-
const approvalId = (
|
|
4285
|
+
const approvalId = (_F = (_E = output.providerOptions) == null ? void 0 : _E.openai) == null ? void 0 : _F.approvalId;
|
|
4162
4286
|
if (approvalId) {
|
|
4163
4287
|
continue;
|
|
4164
4288
|
}
|
|
@@ -4167,7 +4291,7 @@ ${text}`,
|
|
|
4167
4291
|
part.toolName
|
|
4168
4292
|
);
|
|
4169
4293
|
if (part.toolName === toolSearchToolName && output.type === "json") {
|
|
4170
|
-
const parsedOutput = await (0,
|
|
4294
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
4171
4295
|
value: output.value,
|
|
4172
4296
|
schema: toolSearchOutputSchema
|
|
4173
4297
|
});
|
|
@@ -4181,7 +4305,7 @@ ${text}`,
|
|
|
4181
4305
|
continue;
|
|
4182
4306
|
}
|
|
4183
4307
|
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
4184
|
-
const parsedOutput = await (0,
|
|
4308
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
4185
4309
|
value: output.value,
|
|
4186
4310
|
schema: localShellOutputSchema
|
|
4187
4311
|
});
|
|
@@ -4193,7 +4317,7 @@ ${text}`,
|
|
|
4193
4317
|
continue;
|
|
4194
4318
|
}
|
|
4195
4319
|
if (hasShellTool && resolvedToolName === "shell" && output.type === "json") {
|
|
4196
|
-
const parsedOutput = await (0,
|
|
4320
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
4197
4321
|
value: output.value,
|
|
4198
4322
|
schema: shellOutputSchema
|
|
4199
4323
|
});
|
|
@@ -4212,7 +4336,7 @@ ${text}`,
|
|
|
4212
4336
|
continue;
|
|
4213
4337
|
}
|
|
4214
4338
|
if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
|
|
4215
|
-
const parsedOutput = await (0,
|
|
4339
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
4216
4340
|
value: output.value,
|
|
4217
4341
|
schema: applyPatchOutputSchema
|
|
4218
4342
|
});
|
|
@@ -4245,7 +4369,7 @@ ${text}`,
|
|
|
4245
4369
|
break;
|
|
4246
4370
|
case "execution-denied":
|
|
4247
4371
|
outputValue = convertScalarOutput(
|
|
4248
|
-
(
|
|
4372
|
+
(_G = output.reason) != null ? _G : "Tool call execution denied."
|
|
4249
4373
|
);
|
|
4250
4374
|
break;
|
|
4251
4375
|
case "json":
|
|
@@ -4310,7 +4434,7 @@ ${text}`,
|
|
|
4310
4434
|
});
|
|
4311
4435
|
return void 0;
|
|
4312
4436
|
}
|
|
4313
|
-
}).filter(
|
|
4437
|
+
}).filter(import_provider_utils27.isNonNullable);
|
|
4314
4438
|
break;
|
|
4315
4439
|
default:
|
|
4316
4440
|
outputValue = "";
|
|
@@ -4359,9 +4483,9 @@ ${text}`,
|
|
|
4359
4483
|
}
|
|
4360
4484
|
return { input, warnings };
|
|
4361
4485
|
}
|
|
4362
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4363
|
-
itemId:
|
|
4364
|
-
reasoningEncryptedContent:
|
|
4486
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v419.z.object({
|
|
4487
|
+
itemId: import_v419.z.string().nullish(),
|
|
4488
|
+
reasoningEncryptedContent: import_v419.z.string().nullish()
|
|
4365
4489
|
});
|
|
4366
4490
|
|
|
4367
4491
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -4383,75 +4507,75 @@ function mapOpenAIResponseFinishReason({
|
|
|
4383
4507
|
}
|
|
4384
4508
|
|
|
4385
4509
|
// src/responses/openai-responses-api.ts
|
|
4386
|
-
var
|
|
4387
|
-
var
|
|
4388
|
-
var jsonValueSchema =
|
|
4389
|
-
() =>
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4510
|
+
var import_provider_utils28 = require("@ai-sdk/provider-utils");
|
|
4511
|
+
var import_v420 = require("zod/v4");
|
|
4512
|
+
var jsonValueSchema = import_v420.z.lazy(
|
|
4513
|
+
() => import_v420.z.union([
|
|
4514
|
+
import_v420.z.string(),
|
|
4515
|
+
import_v420.z.number(),
|
|
4516
|
+
import_v420.z.boolean(),
|
|
4517
|
+
import_v420.z.null(),
|
|
4518
|
+
import_v420.z.array(jsonValueSchema),
|
|
4519
|
+
import_v420.z.record(import_v420.z.string(), jsonValueSchema.optional())
|
|
4396
4520
|
])
|
|
4397
4521
|
);
|
|
4398
|
-
var jsonObjectSchema =
|
|
4399
|
-
var openaiResponsesUsageSchema =
|
|
4522
|
+
var jsonObjectSchema = import_v420.z.record(import_v420.z.string(), jsonValueSchema.optional());
|
|
4523
|
+
var openaiResponsesUsageSchema = import_v420.z.intersection(
|
|
4400
4524
|
jsonObjectSchema,
|
|
4401
|
-
|
|
4402
|
-
input_tokens:
|
|
4403
|
-
input_tokens_details:
|
|
4525
|
+
import_v420.z.object({
|
|
4526
|
+
input_tokens: import_v420.z.number(),
|
|
4527
|
+
input_tokens_details: import_v420.z.intersection(
|
|
4404
4528
|
jsonObjectSchema,
|
|
4405
|
-
|
|
4406
|
-
cached_tokens:
|
|
4407
|
-
cache_write_tokens:
|
|
4408
|
-
orchestration_input_tokens:
|
|
4409
|
-
orchestration_input_cached_tokens:
|
|
4529
|
+
import_v420.z.object({
|
|
4530
|
+
cached_tokens: import_v420.z.number().nullish(),
|
|
4531
|
+
cache_write_tokens: import_v420.z.number().nullish(),
|
|
4532
|
+
orchestration_input_tokens: import_v420.z.number().nullish(),
|
|
4533
|
+
orchestration_input_cached_tokens: import_v420.z.number().nullish()
|
|
4410
4534
|
})
|
|
4411
4535
|
).nullish(),
|
|
4412
|
-
output_tokens:
|
|
4413
|
-
output_tokens_details:
|
|
4536
|
+
output_tokens: import_v420.z.number(),
|
|
4537
|
+
output_tokens_details: import_v420.z.intersection(
|
|
4414
4538
|
jsonObjectSchema,
|
|
4415
|
-
|
|
4416
|
-
reasoning_tokens:
|
|
4417
|
-
orchestration_output_tokens:
|
|
4539
|
+
import_v420.z.object({
|
|
4540
|
+
reasoning_tokens: import_v420.z.number().nullish(),
|
|
4541
|
+
orchestration_output_tokens: import_v420.z.number().nullish()
|
|
4418
4542
|
})
|
|
4419
4543
|
).nullish(),
|
|
4420
|
-
total_tokens:
|
|
4544
|
+
total_tokens: import_v420.z.number().optional()
|
|
4421
4545
|
})
|
|
4422
4546
|
);
|
|
4423
4547
|
function isRecord(value) {
|
|
4424
4548
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
4425
4549
|
}
|
|
4426
|
-
var openaiResponsesLocalShellCallSchema =
|
|
4427
|
-
type:
|
|
4428
|
-
id:
|
|
4429
|
-
call_id:
|
|
4430
|
-
action:
|
|
4431
|
-
type:
|
|
4432
|
-
command:
|
|
4433
|
-
timeout_ms:
|
|
4434
|
-
user:
|
|
4435
|
-
working_directory:
|
|
4436
|
-
env:
|
|
4550
|
+
var openaiResponsesLocalShellCallSchema = import_v420.z.object({
|
|
4551
|
+
type: import_v420.z.literal("local_shell_call"),
|
|
4552
|
+
id: import_v420.z.string(),
|
|
4553
|
+
call_id: import_v420.z.string(),
|
|
4554
|
+
action: import_v420.z.object({
|
|
4555
|
+
type: import_v420.z.literal("exec"),
|
|
4556
|
+
command: import_v420.z.array(import_v420.z.string()),
|
|
4557
|
+
timeout_ms: import_v420.z.number().optional(),
|
|
4558
|
+
user: import_v420.z.string().optional(),
|
|
4559
|
+
working_directory: import_v420.z.string().optional(),
|
|
4560
|
+
env: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).optional()
|
|
4437
4561
|
})
|
|
4438
4562
|
});
|
|
4439
|
-
var openaiResponsesNestedErrorChunkSchema =
|
|
4440
|
-
type:
|
|
4441
|
-
sequence_number:
|
|
4442
|
-
error:
|
|
4443
|
-
type:
|
|
4444
|
-
code:
|
|
4445
|
-
message:
|
|
4446
|
-
param:
|
|
4563
|
+
var openaiResponsesNestedErrorChunkSchema = import_v420.z.object({
|
|
4564
|
+
type: import_v420.z.literal("error"),
|
|
4565
|
+
sequence_number: import_v420.z.number(),
|
|
4566
|
+
error: import_v420.z.object({
|
|
4567
|
+
type: import_v420.z.string(),
|
|
4568
|
+
code: import_v420.z.string().nullish(),
|
|
4569
|
+
message: import_v420.z.string(),
|
|
4570
|
+
param: import_v420.z.string().nullish()
|
|
4447
4571
|
})
|
|
4448
4572
|
});
|
|
4449
|
-
var openaiResponsesErrorChunkSchema =
|
|
4450
|
-
type:
|
|
4451
|
-
sequence_number:
|
|
4452
|
-
code:
|
|
4453
|
-
message:
|
|
4454
|
-
param:
|
|
4573
|
+
var openaiResponsesErrorChunkSchema = import_v420.z.object({
|
|
4574
|
+
type: import_v420.z.literal("error"),
|
|
4575
|
+
sequence_number: import_v420.z.number(),
|
|
4576
|
+
code: import_v420.z.string().nullish(),
|
|
4577
|
+
message: import_v420.z.string(),
|
|
4578
|
+
param: import_v420.z.string().nullish()
|
|
4455
4579
|
});
|
|
4456
4580
|
var openaiResponsesModeledChunkTypes = /* @__PURE__ */ new Set([
|
|
4457
4581
|
"error",
|
|
@@ -4507,523 +4631,523 @@ function isModeledOpenAIResponsesChunk(value) {
|
|
|
4507
4631
|
}
|
|
4508
4632
|
return openaiResponsesModeledOutputItemTypes.has(value.item.type);
|
|
4509
4633
|
}
|
|
4510
|
-
var openaiResponsesChunkSchema = (0,
|
|
4511
|
-
() => (0,
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
type:
|
|
4515
|
-
item_id:
|
|
4516
|
-
delta:
|
|
4517
|
-
logprobs:
|
|
4518
|
-
|
|
4519
|
-
token:
|
|
4520
|
-
logprob:
|
|
4521
|
-
top_logprobs:
|
|
4522
|
-
|
|
4523
|
-
token:
|
|
4524
|
-
logprob:
|
|
4634
|
+
var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
4635
|
+
() => (0, import_provider_utils28.zodSchema)(
|
|
4636
|
+
import_v420.z.union([
|
|
4637
|
+
import_v420.z.object({
|
|
4638
|
+
type: import_v420.z.literal("response.output_text.delta"),
|
|
4639
|
+
item_id: import_v420.z.string(),
|
|
4640
|
+
delta: import_v420.z.string(),
|
|
4641
|
+
logprobs: import_v420.z.array(
|
|
4642
|
+
import_v420.z.object({
|
|
4643
|
+
token: import_v420.z.string(),
|
|
4644
|
+
logprob: import_v420.z.number(),
|
|
4645
|
+
top_logprobs: import_v420.z.array(
|
|
4646
|
+
import_v420.z.object({
|
|
4647
|
+
token: import_v420.z.string(),
|
|
4648
|
+
logprob: import_v420.z.number()
|
|
4525
4649
|
})
|
|
4526
4650
|
)
|
|
4527
4651
|
})
|
|
4528
4652
|
).nullish()
|
|
4529
4653
|
}),
|
|
4530
|
-
|
|
4531
|
-
type:
|
|
4532
|
-
response:
|
|
4533
|
-
incomplete_details:
|
|
4654
|
+
import_v420.z.object({
|
|
4655
|
+
type: import_v420.z.enum(["response.completed", "response.incomplete"]),
|
|
4656
|
+
response: import_v420.z.object({
|
|
4657
|
+
incomplete_details: import_v420.z.object({ reason: import_v420.z.string() }).nullish(),
|
|
4534
4658
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4535
|
-
reasoning:
|
|
4536
|
-
context:
|
|
4659
|
+
reasoning: import_v420.z.object({
|
|
4660
|
+
context: import_v420.z.string().nullish()
|
|
4537
4661
|
}).nullish(),
|
|
4538
|
-
service_tier:
|
|
4662
|
+
service_tier: import_v420.z.string().nullish()
|
|
4539
4663
|
})
|
|
4540
4664
|
}),
|
|
4541
|
-
|
|
4542
|
-
type:
|
|
4543
|
-
sequence_number:
|
|
4544
|
-
response:
|
|
4545
|
-
error:
|
|
4546
|
-
code:
|
|
4547
|
-
message:
|
|
4665
|
+
import_v420.z.object({
|
|
4666
|
+
type: import_v420.z.literal("response.failed"),
|
|
4667
|
+
sequence_number: import_v420.z.number(),
|
|
4668
|
+
response: import_v420.z.object({
|
|
4669
|
+
error: import_v420.z.object({
|
|
4670
|
+
code: import_v420.z.string().nullish(),
|
|
4671
|
+
message: import_v420.z.string()
|
|
4548
4672
|
}).nullish(),
|
|
4549
|
-
incomplete_details:
|
|
4673
|
+
incomplete_details: import_v420.z.object({ reason: import_v420.z.string() }).nullish(),
|
|
4550
4674
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4551
|
-
reasoning:
|
|
4552
|
-
context:
|
|
4675
|
+
reasoning: import_v420.z.object({
|
|
4676
|
+
context: import_v420.z.string().nullish()
|
|
4553
4677
|
}).nullish(),
|
|
4554
|
-
service_tier:
|
|
4678
|
+
service_tier: import_v420.z.string().nullish()
|
|
4555
4679
|
})
|
|
4556
4680
|
}),
|
|
4557
|
-
|
|
4558
|
-
type:
|
|
4559
|
-
response:
|
|
4560
|
-
id:
|
|
4561
|
-
created_at:
|
|
4562
|
-
model:
|
|
4563
|
-
service_tier:
|
|
4681
|
+
import_v420.z.object({
|
|
4682
|
+
type: import_v420.z.literal("response.created"),
|
|
4683
|
+
response: import_v420.z.object({
|
|
4684
|
+
id: import_v420.z.string(),
|
|
4685
|
+
created_at: import_v420.z.number(),
|
|
4686
|
+
model: import_v420.z.string(),
|
|
4687
|
+
service_tier: import_v420.z.string().nullish()
|
|
4564
4688
|
})
|
|
4565
4689
|
}),
|
|
4566
|
-
|
|
4567
|
-
type:
|
|
4568
|
-
output_index:
|
|
4569
|
-
item:
|
|
4570
|
-
|
|
4571
|
-
type:
|
|
4572
|
-
id:
|
|
4573
|
-
phase:
|
|
4690
|
+
import_v420.z.object({
|
|
4691
|
+
type: import_v420.z.literal("response.output_item.added"),
|
|
4692
|
+
output_index: import_v420.z.number(),
|
|
4693
|
+
item: import_v420.z.discriminatedUnion("type", [
|
|
4694
|
+
import_v420.z.object({
|
|
4695
|
+
type: import_v420.z.literal("message"),
|
|
4696
|
+
id: import_v420.z.string(),
|
|
4697
|
+
phase: import_v420.z.enum(["commentary", "final_answer"]).nullish()
|
|
4574
4698
|
}),
|
|
4575
|
-
|
|
4576
|
-
type:
|
|
4577
|
-
id:
|
|
4578
|
-
encrypted_content:
|
|
4699
|
+
import_v420.z.object({
|
|
4700
|
+
type: import_v420.z.literal("reasoning"),
|
|
4701
|
+
id: import_v420.z.string(),
|
|
4702
|
+
encrypted_content: import_v420.z.string().nullish()
|
|
4579
4703
|
}),
|
|
4580
|
-
|
|
4581
|
-
type:
|
|
4582
|
-
id:
|
|
4583
|
-
call_id:
|
|
4584
|
-
name:
|
|
4585
|
-
arguments:
|
|
4586
|
-
async:
|
|
4587
|
-
namespace:
|
|
4704
|
+
import_v420.z.object({
|
|
4705
|
+
type: import_v420.z.literal("function_call"),
|
|
4706
|
+
id: import_v420.z.string(),
|
|
4707
|
+
call_id: import_v420.z.string(),
|
|
4708
|
+
name: import_v420.z.string(),
|
|
4709
|
+
arguments: import_v420.z.string(),
|
|
4710
|
+
async: import_v420.z.boolean().nullish(),
|
|
4711
|
+
namespace: import_v420.z.string().nullish()
|
|
4588
4712
|
}),
|
|
4589
|
-
|
|
4590
|
-
type:
|
|
4591
|
-
id:
|
|
4592
|
-
status:
|
|
4713
|
+
import_v420.z.object({
|
|
4714
|
+
type: import_v420.z.literal("web_search_call"),
|
|
4715
|
+
id: import_v420.z.string(),
|
|
4716
|
+
status: import_v420.z.string()
|
|
4593
4717
|
}),
|
|
4594
|
-
|
|
4595
|
-
type:
|
|
4596
|
-
id:
|
|
4597
|
-
status:
|
|
4718
|
+
import_v420.z.object({
|
|
4719
|
+
type: import_v420.z.literal("computer_call"),
|
|
4720
|
+
id: import_v420.z.string(),
|
|
4721
|
+
status: import_v420.z.string()
|
|
4598
4722
|
}),
|
|
4599
|
-
|
|
4600
|
-
type:
|
|
4601
|
-
id:
|
|
4723
|
+
import_v420.z.object({
|
|
4724
|
+
type: import_v420.z.literal("file_search_call"),
|
|
4725
|
+
id: import_v420.z.string()
|
|
4602
4726
|
}),
|
|
4603
4727
|
openaiResponsesLocalShellCallSchema,
|
|
4604
|
-
|
|
4605
|
-
type:
|
|
4606
|
-
id:
|
|
4728
|
+
import_v420.z.object({
|
|
4729
|
+
type: import_v420.z.literal("image_generation_call"),
|
|
4730
|
+
id: import_v420.z.string()
|
|
4607
4731
|
}),
|
|
4608
|
-
|
|
4609
|
-
type:
|
|
4610
|
-
id:
|
|
4611
|
-
container_id:
|
|
4612
|
-
code:
|
|
4613
|
-
outputs:
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4732
|
+
import_v420.z.object({
|
|
4733
|
+
type: import_v420.z.literal("code_interpreter_call"),
|
|
4734
|
+
id: import_v420.z.string(),
|
|
4735
|
+
container_id: import_v420.z.string(),
|
|
4736
|
+
code: import_v420.z.string().nullable(),
|
|
4737
|
+
outputs: import_v420.z.array(
|
|
4738
|
+
import_v420.z.discriminatedUnion("type", [
|
|
4739
|
+
import_v420.z.object({ type: import_v420.z.literal("logs"), logs: import_v420.z.string() }),
|
|
4740
|
+
import_v420.z.object({ type: import_v420.z.literal("image"), url: import_v420.z.string() })
|
|
4617
4741
|
])
|
|
4618
4742
|
).nullable(),
|
|
4619
|
-
status:
|
|
4743
|
+
status: import_v420.z.string()
|
|
4620
4744
|
}),
|
|
4621
|
-
|
|
4622
|
-
type:
|
|
4623
|
-
id:
|
|
4624
|
-
status:
|
|
4625
|
-
approval_request_id:
|
|
4745
|
+
import_v420.z.object({
|
|
4746
|
+
type: import_v420.z.literal("mcp_call"),
|
|
4747
|
+
id: import_v420.z.string(),
|
|
4748
|
+
status: import_v420.z.string(),
|
|
4749
|
+
approval_request_id: import_v420.z.string().nullish()
|
|
4626
4750
|
}),
|
|
4627
|
-
|
|
4628
|
-
type:
|
|
4629
|
-
id:
|
|
4751
|
+
import_v420.z.object({
|
|
4752
|
+
type: import_v420.z.literal("mcp_list_tools"),
|
|
4753
|
+
id: import_v420.z.string()
|
|
4630
4754
|
}),
|
|
4631
|
-
|
|
4632
|
-
type:
|
|
4633
|
-
id:
|
|
4755
|
+
import_v420.z.object({
|
|
4756
|
+
type: import_v420.z.literal("mcp_approval_request"),
|
|
4757
|
+
id: import_v420.z.string()
|
|
4634
4758
|
}),
|
|
4635
|
-
|
|
4636
|
-
type:
|
|
4637
|
-
id:
|
|
4638
|
-
call_id:
|
|
4639
|
-
status:
|
|
4640
|
-
operation:
|
|
4641
|
-
|
|
4642
|
-
type:
|
|
4643
|
-
path:
|
|
4644
|
-
diff:
|
|
4759
|
+
import_v420.z.object({
|
|
4760
|
+
type: import_v420.z.literal("apply_patch_call"),
|
|
4761
|
+
id: import_v420.z.string(),
|
|
4762
|
+
call_id: import_v420.z.string(),
|
|
4763
|
+
status: import_v420.z.enum(["in_progress", "completed"]),
|
|
4764
|
+
operation: import_v420.z.discriminatedUnion("type", [
|
|
4765
|
+
import_v420.z.object({
|
|
4766
|
+
type: import_v420.z.literal("create_file"),
|
|
4767
|
+
path: import_v420.z.string(),
|
|
4768
|
+
diff: import_v420.z.string()
|
|
4645
4769
|
}),
|
|
4646
|
-
|
|
4647
|
-
type:
|
|
4648
|
-
path:
|
|
4770
|
+
import_v420.z.object({
|
|
4771
|
+
type: import_v420.z.literal("delete_file"),
|
|
4772
|
+
path: import_v420.z.string()
|
|
4649
4773
|
}),
|
|
4650
|
-
|
|
4651
|
-
type:
|
|
4652
|
-
path:
|
|
4653
|
-
diff:
|
|
4774
|
+
import_v420.z.object({
|
|
4775
|
+
type: import_v420.z.literal("update_file"),
|
|
4776
|
+
path: import_v420.z.string(),
|
|
4777
|
+
diff: import_v420.z.string()
|
|
4654
4778
|
})
|
|
4655
4779
|
])
|
|
4656
4780
|
}),
|
|
4657
|
-
|
|
4658
|
-
type:
|
|
4659
|
-
id:
|
|
4660
|
-
call_id:
|
|
4661
|
-
name:
|
|
4662
|
-
input:
|
|
4663
|
-
async:
|
|
4781
|
+
import_v420.z.object({
|
|
4782
|
+
type: import_v420.z.literal("custom_tool_call"),
|
|
4783
|
+
id: import_v420.z.string(),
|
|
4784
|
+
call_id: import_v420.z.string(),
|
|
4785
|
+
name: import_v420.z.string(),
|
|
4786
|
+
input: import_v420.z.string(),
|
|
4787
|
+
async: import_v420.z.boolean().nullish()
|
|
4664
4788
|
}),
|
|
4665
|
-
|
|
4666
|
-
type:
|
|
4667
|
-
id:
|
|
4668
|
-
call_id:
|
|
4669
|
-
status:
|
|
4670
|
-
action:
|
|
4671
|
-
commands:
|
|
4789
|
+
import_v420.z.object({
|
|
4790
|
+
type: import_v420.z.literal("shell_call"),
|
|
4791
|
+
id: import_v420.z.string(),
|
|
4792
|
+
call_id: import_v420.z.string(),
|
|
4793
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4794
|
+
action: import_v420.z.object({
|
|
4795
|
+
commands: import_v420.z.array(import_v420.z.string())
|
|
4672
4796
|
})
|
|
4673
4797
|
}),
|
|
4674
|
-
|
|
4675
|
-
type:
|
|
4676
|
-
id:
|
|
4677
|
-
call_id:
|
|
4678
|
-
status:
|
|
4679
|
-
output:
|
|
4680
|
-
|
|
4681
|
-
stdout:
|
|
4682
|
-
stderr:
|
|
4683
|
-
outcome:
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
type:
|
|
4687
|
-
exit_code:
|
|
4798
|
+
import_v420.z.object({
|
|
4799
|
+
type: import_v420.z.literal("shell_call_output"),
|
|
4800
|
+
id: import_v420.z.string(),
|
|
4801
|
+
call_id: import_v420.z.string(),
|
|
4802
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4803
|
+
output: import_v420.z.array(
|
|
4804
|
+
import_v420.z.object({
|
|
4805
|
+
stdout: import_v420.z.string(),
|
|
4806
|
+
stderr: import_v420.z.string(),
|
|
4807
|
+
outcome: import_v420.z.discriminatedUnion("type", [
|
|
4808
|
+
import_v420.z.object({ type: import_v420.z.literal("timeout") }),
|
|
4809
|
+
import_v420.z.object({
|
|
4810
|
+
type: import_v420.z.literal("exit"),
|
|
4811
|
+
exit_code: import_v420.z.number()
|
|
4688
4812
|
})
|
|
4689
4813
|
])
|
|
4690
4814
|
})
|
|
4691
4815
|
)
|
|
4692
4816
|
}),
|
|
4693
|
-
|
|
4694
|
-
type:
|
|
4695
|
-
id:
|
|
4696
|
-
execution:
|
|
4697
|
-
call_id:
|
|
4698
|
-
status:
|
|
4699
|
-
arguments:
|
|
4817
|
+
import_v420.z.object({
|
|
4818
|
+
type: import_v420.z.literal("tool_search_call"),
|
|
4819
|
+
id: import_v420.z.string(),
|
|
4820
|
+
execution: import_v420.z.enum(["server", "client"]),
|
|
4821
|
+
call_id: import_v420.z.string().nullable(),
|
|
4822
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4823
|
+
arguments: import_v420.z.unknown()
|
|
4700
4824
|
}),
|
|
4701
|
-
|
|
4702
|
-
type:
|
|
4703
|
-
id:
|
|
4704
|
-
execution:
|
|
4705
|
-
call_id:
|
|
4706
|
-
status:
|
|
4707
|
-
tools:
|
|
4825
|
+
import_v420.z.object({
|
|
4826
|
+
type: import_v420.z.literal("tool_search_output"),
|
|
4827
|
+
id: import_v420.z.string(),
|
|
4828
|
+
execution: import_v420.z.enum(["server", "client"]),
|
|
4829
|
+
call_id: import_v420.z.string().nullable(),
|
|
4830
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4831
|
+
tools: import_v420.z.array(import_v420.z.record(import_v420.z.string(), jsonValueSchema.optional()))
|
|
4708
4832
|
})
|
|
4709
4833
|
])
|
|
4710
4834
|
}),
|
|
4711
|
-
|
|
4712
|
-
type:
|
|
4713
|
-
output_index:
|
|
4714
|
-
item:
|
|
4715
|
-
|
|
4716
|
-
type:
|
|
4717
|
-
id:
|
|
4718
|
-
phase:
|
|
4835
|
+
import_v420.z.object({
|
|
4836
|
+
type: import_v420.z.literal("response.output_item.done"),
|
|
4837
|
+
output_index: import_v420.z.number(),
|
|
4838
|
+
item: import_v420.z.discriminatedUnion("type", [
|
|
4839
|
+
import_v420.z.object({
|
|
4840
|
+
type: import_v420.z.literal("message"),
|
|
4841
|
+
id: import_v420.z.string(),
|
|
4842
|
+
phase: import_v420.z.enum(["commentary", "final_answer"]).nullish()
|
|
4719
4843
|
}),
|
|
4720
|
-
|
|
4721
|
-
type:
|
|
4722
|
-
id:
|
|
4723
|
-
encrypted_content:
|
|
4844
|
+
import_v420.z.object({
|
|
4845
|
+
type: import_v420.z.literal("reasoning"),
|
|
4846
|
+
id: import_v420.z.string(),
|
|
4847
|
+
encrypted_content: import_v420.z.string().nullish()
|
|
4724
4848
|
}),
|
|
4725
|
-
|
|
4726
|
-
type:
|
|
4727
|
-
id:
|
|
4728
|
-
call_id:
|
|
4729
|
-
name:
|
|
4730
|
-
arguments:
|
|
4731
|
-
async:
|
|
4732
|
-
status:
|
|
4733
|
-
namespace:
|
|
4849
|
+
import_v420.z.object({
|
|
4850
|
+
type: import_v420.z.literal("function_call"),
|
|
4851
|
+
id: import_v420.z.string(),
|
|
4852
|
+
call_id: import_v420.z.string(),
|
|
4853
|
+
name: import_v420.z.string(),
|
|
4854
|
+
arguments: import_v420.z.string(),
|
|
4855
|
+
async: import_v420.z.boolean().nullish(),
|
|
4856
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4857
|
+
namespace: import_v420.z.string().nullish()
|
|
4734
4858
|
}),
|
|
4735
|
-
|
|
4736
|
-
type:
|
|
4737
|
-
id:
|
|
4738
|
-
call_id:
|
|
4739
|
-
name:
|
|
4740
|
-
input:
|
|
4741
|
-
async:
|
|
4742
|
-
status:
|
|
4859
|
+
import_v420.z.object({
|
|
4860
|
+
type: import_v420.z.literal("custom_tool_call"),
|
|
4861
|
+
id: import_v420.z.string(),
|
|
4862
|
+
call_id: import_v420.z.string(),
|
|
4863
|
+
name: import_v420.z.string(),
|
|
4864
|
+
input: import_v420.z.string(),
|
|
4865
|
+
async: import_v420.z.boolean().nullish(),
|
|
4866
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"])
|
|
4743
4867
|
}),
|
|
4744
|
-
|
|
4745
|
-
type:
|
|
4746
|
-
id:
|
|
4747
|
-
code:
|
|
4748
|
-
container_id:
|
|
4749
|
-
outputs:
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4868
|
+
import_v420.z.object({
|
|
4869
|
+
type: import_v420.z.literal("code_interpreter_call"),
|
|
4870
|
+
id: import_v420.z.string(),
|
|
4871
|
+
code: import_v420.z.string().nullable(),
|
|
4872
|
+
container_id: import_v420.z.string(),
|
|
4873
|
+
outputs: import_v420.z.array(
|
|
4874
|
+
import_v420.z.discriminatedUnion("type", [
|
|
4875
|
+
import_v420.z.object({ type: import_v420.z.literal("logs"), logs: import_v420.z.string() }),
|
|
4876
|
+
import_v420.z.object({ type: import_v420.z.literal("image"), url: import_v420.z.string() })
|
|
4753
4877
|
])
|
|
4754
4878
|
).nullable()
|
|
4755
4879
|
}),
|
|
4756
|
-
|
|
4757
|
-
type:
|
|
4758
|
-
id:
|
|
4759
|
-
result:
|
|
4880
|
+
import_v420.z.object({
|
|
4881
|
+
type: import_v420.z.literal("image_generation_call"),
|
|
4882
|
+
id: import_v420.z.string(),
|
|
4883
|
+
result: import_v420.z.string()
|
|
4760
4884
|
}),
|
|
4761
|
-
|
|
4762
|
-
type:
|
|
4763
|
-
id:
|
|
4764
|
-
status:
|
|
4765
|
-
action:
|
|
4766
|
-
|
|
4767
|
-
type:
|
|
4768
|
-
query:
|
|
4769
|
-
queries:
|
|
4770
|
-
sources:
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4885
|
+
import_v420.z.object({
|
|
4886
|
+
type: import_v420.z.literal("web_search_call"),
|
|
4887
|
+
id: import_v420.z.string(),
|
|
4888
|
+
status: import_v420.z.string(),
|
|
4889
|
+
action: import_v420.z.discriminatedUnion("type", [
|
|
4890
|
+
import_v420.z.object({
|
|
4891
|
+
type: import_v420.z.literal("search"),
|
|
4892
|
+
query: import_v420.z.string().nullish(),
|
|
4893
|
+
queries: import_v420.z.array(import_v420.z.string()).nullish(),
|
|
4894
|
+
sources: import_v420.z.array(
|
|
4895
|
+
import_v420.z.discriminatedUnion("type", [
|
|
4896
|
+
import_v420.z.object({ type: import_v420.z.literal("url"), url: import_v420.z.string() }),
|
|
4897
|
+
import_v420.z.object({ type: import_v420.z.literal("api"), name: import_v420.z.string() })
|
|
4774
4898
|
])
|
|
4775
4899
|
).nullish()
|
|
4776
4900
|
}),
|
|
4777
|
-
|
|
4778
|
-
type:
|
|
4779
|
-
url:
|
|
4901
|
+
import_v420.z.object({
|
|
4902
|
+
type: import_v420.z.literal("open_page"),
|
|
4903
|
+
url: import_v420.z.string().nullish()
|
|
4780
4904
|
}),
|
|
4781
|
-
|
|
4782
|
-
type:
|
|
4783
|
-
url:
|
|
4784
|
-
pattern:
|
|
4905
|
+
import_v420.z.object({
|
|
4906
|
+
type: import_v420.z.literal("find_in_page"),
|
|
4907
|
+
url: import_v420.z.string().nullish(),
|
|
4908
|
+
pattern: import_v420.z.string().nullish()
|
|
4785
4909
|
})
|
|
4786
4910
|
]).nullish()
|
|
4787
4911
|
}),
|
|
4788
|
-
|
|
4789
|
-
type:
|
|
4790
|
-
id:
|
|
4791
|
-
queries:
|
|
4792
|
-
results:
|
|
4793
|
-
|
|
4794
|
-
attributes:
|
|
4795
|
-
|
|
4796
|
-
|
|
4912
|
+
import_v420.z.object({
|
|
4913
|
+
type: import_v420.z.literal("file_search_call"),
|
|
4914
|
+
id: import_v420.z.string(),
|
|
4915
|
+
queries: import_v420.z.array(import_v420.z.string()),
|
|
4916
|
+
results: import_v420.z.array(
|
|
4917
|
+
import_v420.z.object({
|
|
4918
|
+
attributes: import_v420.z.record(
|
|
4919
|
+
import_v420.z.string(),
|
|
4920
|
+
import_v420.z.union([import_v420.z.string(), import_v420.z.number(), import_v420.z.boolean()])
|
|
4797
4921
|
),
|
|
4798
|
-
file_id:
|
|
4799
|
-
filename:
|
|
4800
|
-
score:
|
|
4801
|
-
text:
|
|
4922
|
+
file_id: import_v420.z.string(),
|
|
4923
|
+
filename: import_v420.z.string(),
|
|
4924
|
+
score: import_v420.z.number(),
|
|
4925
|
+
text: import_v420.z.string()
|
|
4802
4926
|
})
|
|
4803
4927
|
).nullish()
|
|
4804
4928
|
}),
|
|
4805
4929
|
openaiResponsesLocalShellCallSchema,
|
|
4806
|
-
|
|
4807
|
-
type:
|
|
4808
|
-
id:
|
|
4809
|
-
status:
|
|
4930
|
+
import_v420.z.object({
|
|
4931
|
+
type: import_v420.z.literal("computer_call"),
|
|
4932
|
+
id: import_v420.z.string(),
|
|
4933
|
+
status: import_v420.z.literal("completed")
|
|
4810
4934
|
}),
|
|
4811
|
-
|
|
4812
|
-
type:
|
|
4813
|
-
id:
|
|
4814
|
-
status:
|
|
4815
|
-
arguments:
|
|
4816
|
-
name:
|
|
4817
|
-
server_label:
|
|
4818
|
-
output:
|
|
4819
|
-
error:
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
type:
|
|
4823
|
-
code:
|
|
4824
|
-
message:
|
|
4935
|
+
import_v420.z.object({
|
|
4936
|
+
type: import_v420.z.literal("mcp_call"),
|
|
4937
|
+
id: import_v420.z.string(),
|
|
4938
|
+
status: import_v420.z.string(),
|
|
4939
|
+
arguments: import_v420.z.string(),
|
|
4940
|
+
name: import_v420.z.string(),
|
|
4941
|
+
server_label: import_v420.z.string(),
|
|
4942
|
+
output: import_v420.z.string().nullish(),
|
|
4943
|
+
error: import_v420.z.union([
|
|
4944
|
+
import_v420.z.string(),
|
|
4945
|
+
import_v420.z.object({
|
|
4946
|
+
type: import_v420.z.string().optional(),
|
|
4947
|
+
code: import_v420.z.union([import_v420.z.number(), import_v420.z.string()]).optional(),
|
|
4948
|
+
message: import_v420.z.string().optional()
|
|
4825
4949
|
}).loose()
|
|
4826
4950
|
]).nullish(),
|
|
4827
|
-
approval_request_id:
|
|
4951
|
+
approval_request_id: import_v420.z.string().nullish()
|
|
4828
4952
|
}),
|
|
4829
|
-
|
|
4830
|
-
type:
|
|
4831
|
-
id:
|
|
4832
|
-
server_label:
|
|
4833
|
-
tools:
|
|
4834
|
-
|
|
4835
|
-
name:
|
|
4836
|
-
description:
|
|
4837
|
-
input_schema:
|
|
4838
|
-
annotations:
|
|
4953
|
+
import_v420.z.object({
|
|
4954
|
+
type: import_v420.z.literal("mcp_list_tools"),
|
|
4955
|
+
id: import_v420.z.string(),
|
|
4956
|
+
server_label: import_v420.z.string(),
|
|
4957
|
+
tools: import_v420.z.array(
|
|
4958
|
+
import_v420.z.object({
|
|
4959
|
+
name: import_v420.z.string(),
|
|
4960
|
+
description: import_v420.z.string().optional(),
|
|
4961
|
+
input_schema: import_v420.z.any(),
|
|
4962
|
+
annotations: import_v420.z.record(import_v420.z.string(), import_v420.z.unknown()).optional()
|
|
4839
4963
|
})
|
|
4840
4964
|
),
|
|
4841
|
-
error:
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
type:
|
|
4845
|
-
code:
|
|
4846
|
-
message:
|
|
4965
|
+
error: import_v420.z.union([
|
|
4966
|
+
import_v420.z.string(),
|
|
4967
|
+
import_v420.z.object({
|
|
4968
|
+
type: import_v420.z.string().optional(),
|
|
4969
|
+
code: import_v420.z.union([import_v420.z.number(), import_v420.z.string()]).optional(),
|
|
4970
|
+
message: import_v420.z.string().optional()
|
|
4847
4971
|
}).loose()
|
|
4848
4972
|
]).optional()
|
|
4849
4973
|
}),
|
|
4850
|
-
|
|
4851
|
-
type:
|
|
4852
|
-
id:
|
|
4853
|
-
server_label:
|
|
4854
|
-
name:
|
|
4855
|
-
arguments:
|
|
4856
|
-
approval_request_id:
|
|
4974
|
+
import_v420.z.object({
|
|
4975
|
+
type: import_v420.z.literal("mcp_approval_request"),
|
|
4976
|
+
id: import_v420.z.string(),
|
|
4977
|
+
server_label: import_v420.z.string(),
|
|
4978
|
+
name: import_v420.z.string(),
|
|
4979
|
+
arguments: import_v420.z.string(),
|
|
4980
|
+
approval_request_id: import_v420.z.string().optional()
|
|
4857
4981
|
}),
|
|
4858
|
-
|
|
4859
|
-
type:
|
|
4860
|
-
id:
|
|
4861
|
-
call_id:
|
|
4862
|
-
status:
|
|
4863
|
-
operation:
|
|
4864
|
-
|
|
4865
|
-
type:
|
|
4866
|
-
path:
|
|
4867
|
-
diff:
|
|
4982
|
+
import_v420.z.object({
|
|
4983
|
+
type: import_v420.z.literal("apply_patch_call"),
|
|
4984
|
+
id: import_v420.z.string(),
|
|
4985
|
+
call_id: import_v420.z.string(),
|
|
4986
|
+
status: import_v420.z.enum(["in_progress", "completed"]),
|
|
4987
|
+
operation: import_v420.z.discriminatedUnion("type", [
|
|
4988
|
+
import_v420.z.object({
|
|
4989
|
+
type: import_v420.z.literal("create_file"),
|
|
4990
|
+
path: import_v420.z.string(),
|
|
4991
|
+
diff: import_v420.z.string()
|
|
4868
4992
|
}),
|
|
4869
|
-
|
|
4870
|
-
type:
|
|
4871
|
-
path:
|
|
4993
|
+
import_v420.z.object({
|
|
4994
|
+
type: import_v420.z.literal("delete_file"),
|
|
4995
|
+
path: import_v420.z.string()
|
|
4872
4996
|
}),
|
|
4873
|
-
|
|
4874
|
-
type:
|
|
4875
|
-
path:
|
|
4876
|
-
diff:
|
|
4997
|
+
import_v420.z.object({
|
|
4998
|
+
type: import_v420.z.literal("update_file"),
|
|
4999
|
+
path: import_v420.z.string(),
|
|
5000
|
+
diff: import_v420.z.string()
|
|
4877
5001
|
})
|
|
4878
5002
|
])
|
|
4879
5003
|
}),
|
|
4880
|
-
|
|
4881
|
-
type:
|
|
4882
|
-
id:
|
|
4883
|
-
call_id:
|
|
4884
|
-
status:
|
|
4885
|
-
action:
|
|
4886
|
-
commands:
|
|
5004
|
+
import_v420.z.object({
|
|
5005
|
+
type: import_v420.z.literal("shell_call"),
|
|
5006
|
+
id: import_v420.z.string(),
|
|
5007
|
+
call_id: import_v420.z.string(),
|
|
5008
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5009
|
+
action: import_v420.z.object({
|
|
5010
|
+
commands: import_v420.z.array(import_v420.z.string())
|
|
4887
5011
|
})
|
|
4888
5012
|
}),
|
|
4889
|
-
|
|
4890
|
-
type:
|
|
4891
|
-
id:
|
|
4892
|
-
call_id:
|
|
4893
|
-
status:
|
|
4894
|
-
output:
|
|
4895
|
-
|
|
4896
|
-
stdout:
|
|
4897
|
-
stderr:
|
|
4898
|
-
outcome:
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
type:
|
|
4902
|
-
exit_code:
|
|
5013
|
+
import_v420.z.object({
|
|
5014
|
+
type: import_v420.z.literal("shell_call_output"),
|
|
5015
|
+
id: import_v420.z.string(),
|
|
5016
|
+
call_id: import_v420.z.string(),
|
|
5017
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5018
|
+
output: import_v420.z.array(
|
|
5019
|
+
import_v420.z.object({
|
|
5020
|
+
stdout: import_v420.z.string(),
|
|
5021
|
+
stderr: import_v420.z.string(),
|
|
5022
|
+
outcome: import_v420.z.discriminatedUnion("type", [
|
|
5023
|
+
import_v420.z.object({ type: import_v420.z.literal("timeout") }),
|
|
5024
|
+
import_v420.z.object({
|
|
5025
|
+
type: import_v420.z.literal("exit"),
|
|
5026
|
+
exit_code: import_v420.z.number()
|
|
4903
5027
|
})
|
|
4904
5028
|
])
|
|
4905
5029
|
})
|
|
4906
5030
|
)
|
|
4907
5031
|
}),
|
|
4908
|
-
|
|
4909
|
-
type:
|
|
4910
|
-
id:
|
|
4911
|
-
execution:
|
|
4912
|
-
call_id:
|
|
4913
|
-
status:
|
|
4914
|
-
arguments:
|
|
5032
|
+
import_v420.z.object({
|
|
5033
|
+
type: import_v420.z.literal("tool_search_call"),
|
|
5034
|
+
id: import_v420.z.string(),
|
|
5035
|
+
execution: import_v420.z.enum(["server", "client"]),
|
|
5036
|
+
call_id: import_v420.z.string().nullable(),
|
|
5037
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5038
|
+
arguments: import_v420.z.unknown()
|
|
4915
5039
|
}),
|
|
4916
|
-
|
|
4917
|
-
type:
|
|
4918
|
-
id:
|
|
4919
|
-
execution:
|
|
4920
|
-
call_id:
|
|
4921
|
-
status:
|
|
4922
|
-
tools:
|
|
5040
|
+
import_v420.z.object({
|
|
5041
|
+
type: import_v420.z.literal("tool_search_output"),
|
|
5042
|
+
id: import_v420.z.string(),
|
|
5043
|
+
execution: import_v420.z.enum(["server", "client"]),
|
|
5044
|
+
call_id: import_v420.z.string().nullable(),
|
|
5045
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5046
|
+
tools: import_v420.z.array(import_v420.z.record(import_v420.z.string(), jsonValueSchema.optional()))
|
|
4923
5047
|
})
|
|
4924
5048
|
])
|
|
4925
5049
|
}),
|
|
4926
|
-
|
|
4927
|
-
type:
|
|
4928
|
-
item_id:
|
|
4929
|
-
output_index:
|
|
4930
|
-
delta:
|
|
5050
|
+
import_v420.z.object({
|
|
5051
|
+
type: import_v420.z.literal("response.function_call_arguments.delta"),
|
|
5052
|
+
item_id: import_v420.z.string(),
|
|
5053
|
+
output_index: import_v420.z.number(),
|
|
5054
|
+
delta: import_v420.z.string()
|
|
4931
5055
|
}),
|
|
4932
|
-
|
|
5056
|
+
import_v420.z.object({
|
|
4933
5057
|
// `name` is documented as required but omitted from live API events:
|
|
4934
5058
|
// https://github.com/openai/openai-openapi/issues/545
|
|
4935
|
-
type:
|
|
4936
|
-
item_id:
|
|
4937
|
-
output_index:
|
|
4938
|
-
arguments:
|
|
5059
|
+
type: import_v420.z.literal("response.function_call_arguments.done"),
|
|
5060
|
+
item_id: import_v420.z.string(),
|
|
5061
|
+
output_index: import_v420.z.number(),
|
|
5062
|
+
arguments: import_v420.z.string()
|
|
4939
5063
|
}),
|
|
4940
|
-
|
|
4941
|
-
type:
|
|
4942
|
-
item_id:
|
|
4943
|
-
output_index:
|
|
4944
|
-
delta:
|
|
5064
|
+
import_v420.z.object({
|
|
5065
|
+
type: import_v420.z.literal("response.custom_tool_call_input.delta"),
|
|
5066
|
+
item_id: import_v420.z.string(),
|
|
5067
|
+
output_index: import_v420.z.number(),
|
|
5068
|
+
delta: import_v420.z.string()
|
|
4945
5069
|
}),
|
|
4946
|
-
|
|
4947
|
-
type:
|
|
4948
|
-
item_id:
|
|
4949
|
-
output_index:
|
|
4950
|
-
partial_image_b64:
|
|
5070
|
+
import_v420.z.object({
|
|
5071
|
+
type: import_v420.z.literal("response.image_generation_call.partial_image"),
|
|
5072
|
+
item_id: import_v420.z.string(),
|
|
5073
|
+
output_index: import_v420.z.number(),
|
|
5074
|
+
partial_image_b64: import_v420.z.string()
|
|
4951
5075
|
}),
|
|
4952
|
-
|
|
4953
|
-
type:
|
|
4954
|
-
item_id:
|
|
4955
|
-
output_index:
|
|
4956
|
-
delta:
|
|
5076
|
+
import_v420.z.object({
|
|
5077
|
+
type: import_v420.z.literal("response.code_interpreter_call_code.delta"),
|
|
5078
|
+
item_id: import_v420.z.string(),
|
|
5079
|
+
output_index: import_v420.z.number(),
|
|
5080
|
+
delta: import_v420.z.string()
|
|
4957
5081
|
}),
|
|
4958
|
-
|
|
4959
|
-
type:
|
|
4960
|
-
item_id:
|
|
4961
|
-
output_index:
|
|
4962
|
-
code:
|
|
5082
|
+
import_v420.z.object({
|
|
5083
|
+
type: import_v420.z.literal("response.code_interpreter_call_code.done"),
|
|
5084
|
+
item_id: import_v420.z.string(),
|
|
5085
|
+
output_index: import_v420.z.number(),
|
|
5086
|
+
code: import_v420.z.string()
|
|
4963
5087
|
}),
|
|
4964
|
-
|
|
4965
|
-
type:
|
|
4966
|
-
annotation:
|
|
4967
|
-
|
|
4968
|
-
type:
|
|
4969
|
-
start_index:
|
|
4970
|
-
end_index:
|
|
4971
|
-
url:
|
|
4972
|
-
title:
|
|
5088
|
+
import_v420.z.object({
|
|
5089
|
+
type: import_v420.z.literal("response.output_text.annotation.added"),
|
|
5090
|
+
annotation: import_v420.z.discriminatedUnion("type", [
|
|
5091
|
+
import_v420.z.object({
|
|
5092
|
+
type: import_v420.z.literal("url_citation"),
|
|
5093
|
+
start_index: import_v420.z.number(),
|
|
5094
|
+
end_index: import_v420.z.number(),
|
|
5095
|
+
url: import_v420.z.string(),
|
|
5096
|
+
title: import_v420.z.string()
|
|
4973
5097
|
}),
|
|
4974
|
-
|
|
4975
|
-
type:
|
|
4976
|
-
file_id:
|
|
4977
|
-
filename:
|
|
4978
|
-
index:
|
|
5098
|
+
import_v420.z.object({
|
|
5099
|
+
type: import_v420.z.literal("file_citation"),
|
|
5100
|
+
file_id: import_v420.z.string(),
|
|
5101
|
+
filename: import_v420.z.string(),
|
|
5102
|
+
index: import_v420.z.number()
|
|
4979
5103
|
}),
|
|
4980
|
-
|
|
4981
|
-
type:
|
|
4982
|
-
container_id:
|
|
4983
|
-
file_id:
|
|
4984
|
-
filename:
|
|
4985
|
-
start_index:
|
|
4986
|
-
end_index:
|
|
5104
|
+
import_v420.z.object({
|
|
5105
|
+
type: import_v420.z.literal("container_file_citation"),
|
|
5106
|
+
container_id: import_v420.z.string(),
|
|
5107
|
+
file_id: import_v420.z.string(),
|
|
5108
|
+
filename: import_v420.z.string(),
|
|
5109
|
+
start_index: import_v420.z.number(),
|
|
5110
|
+
end_index: import_v420.z.number()
|
|
4987
5111
|
}),
|
|
4988
|
-
|
|
4989
|
-
type:
|
|
4990
|
-
file_id:
|
|
4991
|
-
index:
|
|
5112
|
+
import_v420.z.object({
|
|
5113
|
+
type: import_v420.z.literal("file_path"),
|
|
5114
|
+
file_id: import_v420.z.string(),
|
|
5115
|
+
index: import_v420.z.number()
|
|
4992
5116
|
})
|
|
4993
5117
|
])
|
|
4994
5118
|
}),
|
|
4995
|
-
|
|
4996
|
-
type:
|
|
4997
|
-
item_id:
|
|
4998
|
-
summary_index:
|
|
5119
|
+
import_v420.z.object({
|
|
5120
|
+
type: import_v420.z.literal("response.reasoning_summary_part.added"),
|
|
5121
|
+
item_id: import_v420.z.string(),
|
|
5122
|
+
summary_index: import_v420.z.number()
|
|
4999
5123
|
}),
|
|
5000
|
-
|
|
5001
|
-
type:
|
|
5002
|
-
item_id:
|
|
5003
|
-
summary_index:
|
|
5004
|
-
delta:
|
|
5124
|
+
import_v420.z.object({
|
|
5125
|
+
type: import_v420.z.literal("response.reasoning_summary_text.delta"),
|
|
5126
|
+
item_id: import_v420.z.string(),
|
|
5127
|
+
summary_index: import_v420.z.number(),
|
|
5128
|
+
delta: import_v420.z.string()
|
|
5005
5129
|
}),
|
|
5006
|
-
|
|
5007
|
-
type:
|
|
5008
|
-
item_id:
|
|
5009
|
-
summary_index:
|
|
5130
|
+
import_v420.z.object({
|
|
5131
|
+
type: import_v420.z.literal("response.reasoning_summary_part.done"),
|
|
5132
|
+
item_id: import_v420.z.string(),
|
|
5133
|
+
summary_index: import_v420.z.number()
|
|
5010
5134
|
}),
|
|
5011
|
-
|
|
5012
|
-
type:
|
|
5013
|
-
item_id:
|
|
5014
|
-
output_index:
|
|
5015
|
-
delta:
|
|
5016
|
-
obfuscation:
|
|
5135
|
+
import_v420.z.object({
|
|
5136
|
+
type: import_v420.z.literal("response.apply_patch_call_operation_diff.delta"),
|
|
5137
|
+
item_id: import_v420.z.string(),
|
|
5138
|
+
output_index: import_v420.z.number(),
|
|
5139
|
+
delta: import_v420.z.string(),
|
|
5140
|
+
obfuscation: import_v420.z.string().nullish()
|
|
5017
5141
|
}),
|
|
5018
|
-
|
|
5019
|
-
type:
|
|
5020
|
-
item_id:
|
|
5021
|
-
output_index:
|
|
5022
|
-
diff:
|
|
5142
|
+
import_v420.z.object({
|
|
5143
|
+
type: import_v420.z.literal("response.apply_patch_call_operation_diff.done"),
|
|
5144
|
+
item_id: import_v420.z.string(),
|
|
5145
|
+
output_index: import_v420.z.number(),
|
|
5146
|
+
diff: import_v420.z.string()
|
|
5023
5147
|
}),
|
|
5024
5148
|
openaiResponsesNestedErrorChunkSchema,
|
|
5025
5149
|
openaiResponsesErrorChunkSchema,
|
|
5026
|
-
|
|
5150
|
+
import_v420.z.object({ type: import_v420.z.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {
|
|
5027
5151
|
message: "Known response chunk failed schema validation"
|
|
5028
5152
|
}).transform((value) => ({
|
|
5029
5153
|
type: "unknown_chunk",
|
|
@@ -5033,292 +5157,292 @@ var openaiResponsesChunkSchema = (0, import_provider_utils27.lazySchema)(
|
|
|
5033
5157
|
])
|
|
5034
5158
|
)
|
|
5035
5159
|
);
|
|
5036
|
-
var openaiResponsesResponseSchema = (0,
|
|
5037
|
-
() => (0,
|
|
5038
|
-
|
|
5039
|
-
id:
|
|
5040
|
-
created_at:
|
|
5041
|
-
error:
|
|
5042
|
-
message:
|
|
5043
|
-
type:
|
|
5044
|
-
param:
|
|
5045
|
-
code:
|
|
5160
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils28.lazySchema)(
|
|
5161
|
+
() => (0, import_provider_utils28.zodSchema)(
|
|
5162
|
+
import_v420.z.object({
|
|
5163
|
+
id: import_v420.z.string().optional(),
|
|
5164
|
+
created_at: import_v420.z.number().optional(),
|
|
5165
|
+
error: import_v420.z.object({
|
|
5166
|
+
message: import_v420.z.string(),
|
|
5167
|
+
type: import_v420.z.string(),
|
|
5168
|
+
param: import_v420.z.string().nullish(),
|
|
5169
|
+
code: import_v420.z.string()
|
|
5046
5170
|
}).nullish(),
|
|
5047
|
-
model:
|
|
5048
|
-
output:
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
type:
|
|
5052
|
-
role:
|
|
5053
|
-
id:
|
|
5054
|
-
phase:
|
|
5055
|
-
content:
|
|
5056
|
-
|
|
5057
|
-
type:
|
|
5058
|
-
text:
|
|
5059
|
-
logprobs:
|
|
5060
|
-
|
|
5061
|
-
token:
|
|
5062
|
-
logprob:
|
|
5063
|
-
top_logprobs:
|
|
5064
|
-
|
|
5065
|
-
token:
|
|
5066
|
-
logprob:
|
|
5171
|
+
model: import_v420.z.string().optional(),
|
|
5172
|
+
output: import_v420.z.array(
|
|
5173
|
+
import_v420.z.discriminatedUnion("type", [
|
|
5174
|
+
import_v420.z.object({
|
|
5175
|
+
type: import_v420.z.literal("message"),
|
|
5176
|
+
role: import_v420.z.literal("assistant"),
|
|
5177
|
+
id: import_v420.z.string(),
|
|
5178
|
+
phase: import_v420.z.enum(["commentary", "final_answer"]).nullish(),
|
|
5179
|
+
content: import_v420.z.array(
|
|
5180
|
+
import_v420.z.object({
|
|
5181
|
+
type: import_v420.z.literal("output_text"),
|
|
5182
|
+
text: import_v420.z.string(),
|
|
5183
|
+
logprobs: import_v420.z.array(
|
|
5184
|
+
import_v420.z.object({
|
|
5185
|
+
token: import_v420.z.string(),
|
|
5186
|
+
logprob: import_v420.z.number(),
|
|
5187
|
+
top_logprobs: import_v420.z.array(
|
|
5188
|
+
import_v420.z.object({
|
|
5189
|
+
token: import_v420.z.string(),
|
|
5190
|
+
logprob: import_v420.z.number()
|
|
5067
5191
|
})
|
|
5068
5192
|
)
|
|
5069
5193
|
})
|
|
5070
5194
|
).nullish(),
|
|
5071
|
-
annotations:
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
type:
|
|
5075
|
-
start_index:
|
|
5076
|
-
end_index:
|
|
5077
|
-
url:
|
|
5078
|
-
title:
|
|
5195
|
+
annotations: import_v420.z.array(
|
|
5196
|
+
import_v420.z.discriminatedUnion("type", [
|
|
5197
|
+
import_v420.z.object({
|
|
5198
|
+
type: import_v420.z.literal("url_citation"),
|
|
5199
|
+
start_index: import_v420.z.number(),
|
|
5200
|
+
end_index: import_v420.z.number(),
|
|
5201
|
+
url: import_v420.z.string(),
|
|
5202
|
+
title: import_v420.z.string()
|
|
5079
5203
|
}),
|
|
5080
|
-
|
|
5081
|
-
type:
|
|
5082
|
-
file_id:
|
|
5083
|
-
filename:
|
|
5084
|
-
index:
|
|
5204
|
+
import_v420.z.object({
|
|
5205
|
+
type: import_v420.z.literal("file_citation"),
|
|
5206
|
+
file_id: import_v420.z.string(),
|
|
5207
|
+
filename: import_v420.z.string(),
|
|
5208
|
+
index: import_v420.z.number()
|
|
5085
5209
|
}),
|
|
5086
|
-
|
|
5087
|
-
type:
|
|
5088
|
-
container_id:
|
|
5089
|
-
file_id:
|
|
5090
|
-
filename:
|
|
5091
|
-
start_index:
|
|
5092
|
-
end_index:
|
|
5210
|
+
import_v420.z.object({
|
|
5211
|
+
type: import_v420.z.literal("container_file_citation"),
|
|
5212
|
+
container_id: import_v420.z.string(),
|
|
5213
|
+
file_id: import_v420.z.string(),
|
|
5214
|
+
filename: import_v420.z.string(),
|
|
5215
|
+
start_index: import_v420.z.number(),
|
|
5216
|
+
end_index: import_v420.z.number()
|
|
5093
5217
|
}),
|
|
5094
|
-
|
|
5095
|
-
type:
|
|
5096
|
-
file_id:
|
|
5097
|
-
index:
|
|
5218
|
+
import_v420.z.object({
|
|
5219
|
+
type: import_v420.z.literal("file_path"),
|
|
5220
|
+
file_id: import_v420.z.string(),
|
|
5221
|
+
index: import_v420.z.number()
|
|
5098
5222
|
})
|
|
5099
5223
|
])
|
|
5100
5224
|
)
|
|
5101
5225
|
})
|
|
5102
5226
|
)
|
|
5103
5227
|
}),
|
|
5104
|
-
|
|
5105
|
-
type:
|
|
5106
|
-
id:
|
|
5107
|
-
status:
|
|
5108
|
-
action:
|
|
5109
|
-
|
|
5110
|
-
type:
|
|
5111
|
-
query:
|
|
5112
|
-
queries:
|
|
5113
|
-
sources:
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
type:
|
|
5118
|
-
name:
|
|
5228
|
+
import_v420.z.object({
|
|
5229
|
+
type: import_v420.z.literal("web_search_call"),
|
|
5230
|
+
id: import_v420.z.string(),
|
|
5231
|
+
status: import_v420.z.string(),
|
|
5232
|
+
action: import_v420.z.discriminatedUnion("type", [
|
|
5233
|
+
import_v420.z.object({
|
|
5234
|
+
type: import_v420.z.literal("search"),
|
|
5235
|
+
query: import_v420.z.string().nullish(),
|
|
5236
|
+
queries: import_v420.z.array(import_v420.z.string()).nullish(),
|
|
5237
|
+
sources: import_v420.z.array(
|
|
5238
|
+
import_v420.z.discriminatedUnion("type", [
|
|
5239
|
+
import_v420.z.object({ type: import_v420.z.literal("url"), url: import_v420.z.string() }),
|
|
5240
|
+
import_v420.z.object({
|
|
5241
|
+
type: import_v420.z.literal("api"),
|
|
5242
|
+
name: import_v420.z.string()
|
|
5119
5243
|
})
|
|
5120
5244
|
])
|
|
5121
5245
|
).nullish()
|
|
5122
5246
|
}),
|
|
5123
|
-
|
|
5124
|
-
type:
|
|
5125
|
-
url:
|
|
5247
|
+
import_v420.z.object({
|
|
5248
|
+
type: import_v420.z.literal("open_page"),
|
|
5249
|
+
url: import_v420.z.string().nullish()
|
|
5126
5250
|
}),
|
|
5127
|
-
|
|
5128
|
-
type:
|
|
5129
|
-
url:
|
|
5130
|
-
pattern:
|
|
5251
|
+
import_v420.z.object({
|
|
5252
|
+
type: import_v420.z.literal("find_in_page"),
|
|
5253
|
+
url: import_v420.z.string().nullish(),
|
|
5254
|
+
pattern: import_v420.z.string().nullish()
|
|
5131
5255
|
})
|
|
5132
5256
|
]).nullish()
|
|
5133
5257
|
}),
|
|
5134
|
-
|
|
5135
|
-
type:
|
|
5136
|
-
id:
|
|
5137
|
-
queries:
|
|
5138
|
-
results:
|
|
5139
|
-
|
|
5140
|
-
attributes:
|
|
5141
|
-
|
|
5142
|
-
|
|
5258
|
+
import_v420.z.object({
|
|
5259
|
+
type: import_v420.z.literal("file_search_call"),
|
|
5260
|
+
id: import_v420.z.string(),
|
|
5261
|
+
queries: import_v420.z.array(import_v420.z.string()),
|
|
5262
|
+
results: import_v420.z.array(
|
|
5263
|
+
import_v420.z.object({
|
|
5264
|
+
attributes: import_v420.z.record(
|
|
5265
|
+
import_v420.z.string(),
|
|
5266
|
+
import_v420.z.union([import_v420.z.string(), import_v420.z.number(), import_v420.z.boolean()])
|
|
5143
5267
|
),
|
|
5144
|
-
file_id:
|
|
5145
|
-
filename:
|
|
5146
|
-
score:
|
|
5147
|
-
text:
|
|
5268
|
+
file_id: import_v420.z.string(),
|
|
5269
|
+
filename: import_v420.z.string(),
|
|
5270
|
+
score: import_v420.z.number(),
|
|
5271
|
+
text: import_v420.z.string()
|
|
5148
5272
|
})
|
|
5149
5273
|
).nullish()
|
|
5150
5274
|
}),
|
|
5151
|
-
|
|
5152
|
-
type:
|
|
5153
|
-
id:
|
|
5154
|
-
code:
|
|
5155
|
-
container_id:
|
|
5156
|
-
outputs:
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5275
|
+
import_v420.z.object({
|
|
5276
|
+
type: import_v420.z.literal("code_interpreter_call"),
|
|
5277
|
+
id: import_v420.z.string(),
|
|
5278
|
+
code: import_v420.z.string().nullable(),
|
|
5279
|
+
container_id: import_v420.z.string(),
|
|
5280
|
+
outputs: import_v420.z.array(
|
|
5281
|
+
import_v420.z.discriminatedUnion("type", [
|
|
5282
|
+
import_v420.z.object({ type: import_v420.z.literal("logs"), logs: import_v420.z.string() }),
|
|
5283
|
+
import_v420.z.object({ type: import_v420.z.literal("image"), url: import_v420.z.string() })
|
|
5160
5284
|
])
|
|
5161
5285
|
).nullable()
|
|
5162
5286
|
}),
|
|
5163
|
-
|
|
5164
|
-
type:
|
|
5165
|
-
id:
|
|
5166
|
-
result:
|
|
5287
|
+
import_v420.z.object({
|
|
5288
|
+
type: import_v420.z.literal("image_generation_call"),
|
|
5289
|
+
id: import_v420.z.string(),
|
|
5290
|
+
result: import_v420.z.string()
|
|
5167
5291
|
}),
|
|
5168
5292
|
openaiResponsesLocalShellCallSchema,
|
|
5169
|
-
|
|
5170
|
-
type:
|
|
5171
|
-
call_id:
|
|
5172
|
-
name:
|
|
5173
|
-
arguments:
|
|
5174
|
-
id:
|
|
5175
|
-
async:
|
|
5176
|
-
namespace:
|
|
5293
|
+
import_v420.z.object({
|
|
5294
|
+
type: import_v420.z.literal("function_call"),
|
|
5295
|
+
call_id: import_v420.z.string(),
|
|
5296
|
+
name: import_v420.z.string(),
|
|
5297
|
+
arguments: import_v420.z.string(),
|
|
5298
|
+
id: import_v420.z.string(),
|
|
5299
|
+
async: import_v420.z.boolean().nullish(),
|
|
5300
|
+
namespace: import_v420.z.string().nullish()
|
|
5177
5301
|
}),
|
|
5178
|
-
|
|
5179
|
-
type:
|
|
5180
|
-
call_id:
|
|
5181
|
-
name:
|
|
5182
|
-
input:
|
|
5183
|
-
id:
|
|
5184
|
-
async:
|
|
5302
|
+
import_v420.z.object({
|
|
5303
|
+
type: import_v420.z.literal("custom_tool_call"),
|
|
5304
|
+
call_id: import_v420.z.string(),
|
|
5305
|
+
name: import_v420.z.string(),
|
|
5306
|
+
input: import_v420.z.string(),
|
|
5307
|
+
id: import_v420.z.string(),
|
|
5308
|
+
async: import_v420.z.boolean().nullish()
|
|
5185
5309
|
}),
|
|
5186
|
-
|
|
5187
|
-
type:
|
|
5188
|
-
id:
|
|
5189
|
-
status:
|
|
5310
|
+
import_v420.z.object({
|
|
5311
|
+
type: import_v420.z.literal("computer_call"),
|
|
5312
|
+
id: import_v420.z.string(),
|
|
5313
|
+
status: import_v420.z.string().optional()
|
|
5190
5314
|
}),
|
|
5191
|
-
|
|
5192
|
-
type:
|
|
5193
|
-
id:
|
|
5194
|
-
encrypted_content:
|
|
5195
|
-
summary:
|
|
5196
|
-
|
|
5197
|
-
type:
|
|
5198
|
-
text:
|
|
5315
|
+
import_v420.z.object({
|
|
5316
|
+
type: import_v420.z.literal("reasoning"),
|
|
5317
|
+
id: import_v420.z.string(),
|
|
5318
|
+
encrypted_content: import_v420.z.string().nullish(),
|
|
5319
|
+
summary: import_v420.z.array(
|
|
5320
|
+
import_v420.z.object({
|
|
5321
|
+
type: import_v420.z.literal("summary_text"),
|
|
5322
|
+
text: import_v420.z.string()
|
|
5199
5323
|
})
|
|
5200
5324
|
)
|
|
5201
5325
|
}),
|
|
5202
|
-
|
|
5203
|
-
type:
|
|
5204
|
-
id:
|
|
5205
|
-
status:
|
|
5206
|
-
arguments:
|
|
5207
|
-
name:
|
|
5208
|
-
server_label:
|
|
5209
|
-
output:
|
|
5210
|
-
error:
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
type:
|
|
5214
|
-
code:
|
|
5215
|
-
message:
|
|
5326
|
+
import_v420.z.object({
|
|
5327
|
+
type: import_v420.z.literal("mcp_call"),
|
|
5328
|
+
id: import_v420.z.string(),
|
|
5329
|
+
status: import_v420.z.string(),
|
|
5330
|
+
arguments: import_v420.z.string(),
|
|
5331
|
+
name: import_v420.z.string(),
|
|
5332
|
+
server_label: import_v420.z.string(),
|
|
5333
|
+
output: import_v420.z.string().nullish(),
|
|
5334
|
+
error: import_v420.z.union([
|
|
5335
|
+
import_v420.z.string(),
|
|
5336
|
+
import_v420.z.object({
|
|
5337
|
+
type: import_v420.z.string().optional(),
|
|
5338
|
+
code: import_v420.z.union([import_v420.z.number(), import_v420.z.string()]).optional(),
|
|
5339
|
+
message: import_v420.z.string().optional()
|
|
5216
5340
|
}).loose()
|
|
5217
5341
|
]).nullish(),
|
|
5218
|
-
approval_request_id:
|
|
5342
|
+
approval_request_id: import_v420.z.string().nullish()
|
|
5219
5343
|
}),
|
|
5220
|
-
|
|
5221
|
-
type:
|
|
5222
|
-
id:
|
|
5223
|
-
server_label:
|
|
5224
|
-
tools:
|
|
5225
|
-
|
|
5226
|
-
name:
|
|
5227
|
-
description:
|
|
5228
|
-
input_schema:
|
|
5229
|
-
annotations:
|
|
5344
|
+
import_v420.z.object({
|
|
5345
|
+
type: import_v420.z.literal("mcp_list_tools"),
|
|
5346
|
+
id: import_v420.z.string(),
|
|
5347
|
+
server_label: import_v420.z.string(),
|
|
5348
|
+
tools: import_v420.z.array(
|
|
5349
|
+
import_v420.z.object({
|
|
5350
|
+
name: import_v420.z.string(),
|
|
5351
|
+
description: import_v420.z.string().optional(),
|
|
5352
|
+
input_schema: import_v420.z.any(),
|
|
5353
|
+
annotations: import_v420.z.record(import_v420.z.string(), import_v420.z.unknown()).optional()
|
|
5230
5354
|
})
|
|
5231
5355
|
),
|
|
5232
|
-
error:
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
type:
|
|
5236
|
-
code:
|
|
5237
|
-
message:
|
|
5356
|
+
error: import_v420.z.union([
|
|
5357
|
+
import_v420.z.string(),
|
|
5358
|
+
import_v420.z.object({
|
|
5359
|
+
type: import_v420.z.string().optional(),
|
|
5360
|
+
code: import_v420.z.union([import_v420.z.number(), import_v420.z.string()]).optional(),
|
|
5361
|
+
message: import_v420.z.string().optional()
|
|
5238
5362
|
}).loose()
|
|
5239
5363
|
]).optional()
|
|
5240
5364
|
}),
|
|
5241
|
-
|
|
5242
|
-
type:
|
|
5243
|
-
id:
|
|
5244
|
-
server_label:
|
|
5245
|
-
name:
|
|
5246
|
-
arguments:
|
|
5247
|
-
approval_request_id:
|
|
5365
|
+
import_v420.z.object({
|
|
5366
|
+
type: import_v420.z.literal("mcp_approval_request"),
|
|
5367
|
+
id: import_v420.z.string(),
|
|
5368
|
+
server_label: import_v420.z.string(),
|
|
5369
|
+
name: import_v420.z.string(),
|
|
5370
|
+
arguments: import_v420.z.string(),
|
|
5371
|
+
approval_request_id: import_v420.z.string().optional()
|
|
5248
5372
|
}),
|
|
5249
|
-
|
|
5250
|
-
type:
|
|
5251
|
-
id:
|
|
5252
|
-
call_id:
|
|
5253
|
-
status:
|
|
5254
|
-
operation:
|
|
5255
|
-
|
|
5256
|
-
type:
|
|
5257
|
-
path:
|
|
5258
|
-
diff:
|
|
5373
|
+
import_v420.z.object({
|
|
5374
|
+
type: import_v420.z.literal("apply_patch_call"),
|
|
5375
|
+
id: import_v420.z.string(),
|
|
5376
|
+
call_id: import_v420.z.string(),
|
|
5377
|
+
status: import_v420.z.enum(["in_progress", "completed"]),
|
|
5378
|
+
operation: import_v420.z.discriminatedUnion("type", [
|
|
5379
|
+
import_v420.z.object({
|
|
5380
|
+
type: import_v420.z.literal("create_file"),
|
|
5381
|
+
path: import_v420.z.string(),
|
|
5382
|
+
diff: import_v420.z.string()
|
|
5259
5383
|
}),
|
|
5260
|
-
|
|
5261
|
-
type:
|
|
5262
|
-
path:
|
|
5384
|
+
import_v420.z.object({
|
|
5385
|
+
type: import_v420.z.literal("delete_file"),
|
|
5386
|
+
path: import_v420.z.string()
|
|
5263
5387
|
}),
|
|
5264
|
-
|
|
5265
|
-
type:
|
|
5266
|
-
path:
|
|
5267
|
-
diff:
|
|
5388
|
+
import_v420.z.object({
|
|
5389
|
+
type: import_v420.z.literal("update_file"),
|
|
5390
|
+
path: import_v420.z.string(),
|
|
5391
|
+
diff: import_v420.z.string()
|
|
5268
5392
|
})
|
|
5269
5393
|
])
|
|
5270
5394
|
}),
|
|
5271
|
-
|
|
5272
|
-
type:
|
|
5273
|
-
id:
|
|
5274
|
-
call_id:
|
|
5275
|
-
status:
|
|
5276
|
-
action:
|
|
5277
|
-
commands:
|
|
5395
|
+
import_v420.z.object({
|
|
5396
|
+
type: import_v420.z.literal("shell_call"),
|
|
5397
|
+
id: import_v420.z.string(),
|
|
5398
|
+
call_id: import_v420.z.string(),
|
|
5399
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5400
|
+
action: import_v420.z.object({
|
|
5401
|
+
commands: import_v420.z.array(import_v420.z.string())
|
|
5278
5402
|
})
|
|
5279
5403
|
}),
|
|
5280
|
-
|
|
5281
|
-
type:
|
|
5282
|
-
id:
|
|
5283
|
-
call_id:
|
|
5284
|
-
status:
|
|
5285
|
-
output:
|
|
5286
|
-
|
|
5287
|
-
stdout:
|
|
5288
|
-
stderr:
|
|
5289
|
-
outcome:
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
type:
|
|
5293
|
-
exit_code:
|
|
5404
|
+
import_v420.z.object({
|
|
5405
|
+
type: import_v420.z.literal("shell_call_output"),
|
|
5406
|
+
id: import_v420.z.string(),
|
|
5407
|
+
call_id: import_v420.z.string(),
|
|
5408
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5409
|
+
output: import_v420.z.array(
|
|
5410
|
+
import_v420.z.object({
|
|
5411
|
+
stdout: import_v420.z.string(),
|
|
5412
|
+
stderr: import_v420.z.string(),
|
|
5413
|
+
outcome: import_v420.z.discriminatedUnion("type", [
|
|
5414
|
+
import_v420.z.object({ type: import_v420.z.literal("timeout") }),
|
|
5415
|
+
import_v420.z.object({
|
|
5416
|
+
type: import_v420.z.literal("exit"),
|
|
5417
|
+
exit_code: import_v420.z.number()
|
|
5294
5418
|
})
|
|
5295
5419
|
])
|
|
5296
5420
|
})
|
|
5297
5421
|
)
|
|
5298
5422
|
}),
|
|
5299
|
-
|
|
5300
|
-
type:
|
|
5301
|
-
id:
|
|
5302
|
-
execution:
|
|
5303
|
-
call_id:
|
|
5304
|
-
status:
|
|
5305
|
-
arguments:
|
|
5423
|
+
import_v420.z.object({
|
|
5424
|
+
type: import_v420.z.literal("tool_search_call"),
|
|
5425
|
+
id: import_v420.z.string(),
|
|
5426
|
+
execution: import_v420.z.enum(["server", "client"]),
|
|
5427
|
+
call_id: import_v420.z.string().nullable(),
|
|
5428
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5429
|
+
arguments: import_v420.z.unknown()
|
|
5306
5430
|
}),
|
|
5307
|
-
|
|
5308
|
-
type:
|
|
5309
|
-
id:
|
|
5310
|
-
execution:
|
|
5311
|
-
call_id:
|
|
5312
|
-
status:
|
|
5313
|
-
tools:
|
|
5431
|
+
import_v420.z.object({
|
|
5432
|
+
type: import_v420.z.literal("tool_search_output"),
|
|
5433
|
+
id: import_v420.z.string(),
|
|
5434
|
+
execution: import_v420.z.enum(["server", "client"]),
|
|
5435
|
+
call_id: import_v420.z.string().nullable(),
|
|
5436
|
+
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5437
|
+
tools: import_v420.z.array(import_v420.z.record(import_v420.z.string(), jsonValueSchema.optional()))
|
|
5314
5438
|
})
|
|
5315
5439
|
])
|
|
5316
5440
|
).optional(),
|
|
5317
|
-
service_tier:
|
|
5318
|
-
reasoning:
|
|
5319
|
-
context:
|
|
5441
|
+
service_tier: import_v420.z.string().nullish(),
|
|
5442
|
+
reasoning: import_v420.z.object({
|
|
5443
|
+
context: import_v420.z.string().nullish()
|
|
5320
5444
|
}).nullish(),
|
|
5321
|
-
incomplete_details:
|
|
5445
|
+
incomplete_details: import_v420.z.object({ reason: import_v420.z.string() }).nullish(),
|
|
5322
5446
|
usage: openaiResponsesUsageSchema.nullish()
|
|
5323
5447
|
})
|
|
5324
5448
|
)
|
|
@@ -5329,41 +5453,41 @@ var import_provider9 = require("@ai-sdk/provider");
|
|
|
5329
5453
|
var import_provider_utils35 = require("@ai-sdk/provider-utils");
|
|
5330
5454
|
|
|
5331
5455
|
// src/tool/code-interpreter.ts
|
|
5332
|
-
var
|
|
5333
|
-
var
|
|
5334
|
-
var codeInterpreterInputSchema = (0,
|
|
5335
|
-
() => (0,
|
|
5336
|
-
|
|
5337
|
-
code:
|
|
5338
|
-
containerId:
|
|
5456
|
+
var import_provider_utils29 = require("@ai-sdk/provider-utils");
|
|
5457
|
+
var import_v421 = require("zod/v4");
|
|
5458
|
+
var codeInterpreterInputSchema = (0, import_provider_utils29.lazySchema)(
|
|
5459
|
+
() => (0, import_provider_utils29.zodSchema)(
|
|
5460
|
+
import_v421.z.object({
|
|
5461
|
+
code: import_v421.z.string().nullish(),
|
|
5462
|
+
containerId: import_v421.z.string()
|
|
5339
5463
|
})
|
|
5340
5464
|
)
|
|
5341
5465
|
);
|
|
5342
|
-
var codeInterpreterOutputSchema = (0,
|
|
5343
|
-
() => (0,
|
|
5344
|
-
|
|
5345
|
-
outputs:
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5466
|
+
var codeInterpreterOutputSchema = (0, import_provider_utils29.lazySchema)(
|
|
5467
|
+
() => (0, import_provider_utils29.zodSchema)(
|
|
5468
|
+
import_v421.z.object({
|
|
5469
|
+
outputs: import_v421.z.array(
|
|
5470
|
+
import_v421.z.discriminatedUnion("type", [
|
|
5471
|
+
import_v421.z.object({ type: import_v421.z.literal("logs"), logs: import_v421.z.string() }),
|
|
5472
|
+
import_v421.z.object({ type: import_v421.z.literal("image"), url: import_v421.z.string() })
|
|
5349
5473
|
])
|
|
5350
5474
|
).nullish()
|
|
5351
5475
|
})
|
|
5352
5476
|
)
|
|
5353
5477
|
);
|
|
5354
|
-
var codeInterpreterArgsSchema = (0,
|
|
5355
|
-
() => (0,
|
|
5356
|
-
|
|
5357
|
-
container:
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
fileIds:
|
|
5478
|
+
var codeInterpreterArgsSchema = (0, import_provider_utils29.lazySchema)(
|
|
5479
|
+
() => (0, import_provider_utils29.zodSchema)(
|
|
5480
|
+
import_v421.z.object({
|
|
5481
|
+
container: import_v421.z.union([
|
|
5482
|
+
import_v421.z.string(),
|
|
5483
|
+
import_v421.z.object({
|
|
5484
|
+
fileIds: import_v421.z.array(import_v421.z.string()).optional()
|
|
5361
5485
|
})
|
|
5362
5486
|
]).optional()
|
|
5363
5487
|
})
|
|
5364
5488
|
)
|
|
5365
5489
|
);
|
|
5366
|
-
var codeInterpreterToolFactory = (0,
|
|
5490
|
+
var codeInterpreterToolFactory = (0, import_provider_utils29.createProviderToolFactoryWithOutputSchema)({
|
|
5367
5491
|
id: "openai.code_interpreter",
|
|
5368
5492
|
inputSchema: codeInterpreterInputSchema,
|
|
5369
5493
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -5373,81 +5497,81 @@ var codeInterpreter = (args = {}) => {
|
|
|
5373
5497
|
};
|
|
5374
5498
|
|
|
5375
5499
|
// src/tool/file-search.ts
|
|
5376
|
-
var
|
|
5377
|
-
var
|
|
5378
|
-
var comparisonFilterSchema =
|
|
5379
|
-
key:
|
|
5380
|
-
type:
|
|
5381
|
-
value:
|
|
5500
|
+
var import_provider_utils30 = require("@ai-sdk/provider-utils");
|
|
5501
|
+
var import_v422 = require("zod/v4");
|
|
5502
|
+
var comparisonFilterSchema = import_v422.z.object({
|
|
5503
|
+
key: import_v422.z.string(),
|
|
5504
|
+
type: import_v422.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
5505
|
+
value: import_v422.z.union([import_v422.z.string(), import_v422.z.number(), import_v422.z.boolean(), import_v422.z.array(import_v422.z.string())])
|
|
5382
5506
|
});
|
|
5383
|
-
var compoundFilterSchema =
|
|
5384
|
-
type:
|
|
5385
|
-
filters:
|
|
5386
|
-
|
|
5507
|
+
var compoundFilterSchema = import_v422.z.object({
|
|
5508
|
+
type: import_v422.z.enum(["and", "or"]),
|
|
5509
|
+
filters: import_v422.z.array(
|
|
5510
|
+
import_v422.z.union([comparisonFilterSchema, import_v422.z.lazy(() => compoundFilterSchema)])
|
|
5387
5511
|
)
|
|
5388
5512
|
});
|
|
5389
|
-
var fileSearchArgsSchema = (0,
|
|
5390
|
-
() => (0,
|
|
5391
|
-
|
|
5392
|
-
vectorStoreIds:
|
|
5393
|
-
maxNumResults:
|
|
5394
|
-
ranking:
|
|
5395
|
-
ranker:
|
|
5396
|
-
scoreThreshold:
|
|
5513
|
+
var fileSearchArgsSchema = (0, import_provider_utils30.lazySchema)(
|
|
5514
|
+
() => (0, import_provider_utils30.zodSchema)(
|
|
5515
|
+
import_v422.z.object({
|
|
5516
|
+
vectorStoreIds: import_v422.z.array(import_v422.z.string()),
|
|
5517
|
+
maxNumResults: import_v422.z.number().optional(),
|
|
5518
|
+
ranking: import_v422.z.object({
|
|
5519
|
+
ranker: import_v422.z.string().optional(),
|
|
5520
|
+
scoreThreshold: import_v422.z.number().optional()
|
|
5397
5521
|
}).optional(),
|
|
5398
|
-
filters:
|
|
5522
|
+
filters: import_v422.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
5399
5523
|
})
|
|
5400
5524
|
)
|
|
5401
5525
|
);
|
|
5402
|
-
var fileSearchOutputSchema = (0,
|
|
5403
|
-
() => (0,
|
|
5404
|
-
|
|
5405
|
-
queries:
|
|
5406
|
-
results:
|
|
5407
|
-
|
|
5408
|
-
attributes:
|
|
5409
|
-
fileId:
|
|
5410
|
-
filename:
|
|
5411
|
-
score:
|
|
5412
|
-
text:
|
|
5526
|
+
var fileSearchOutputSchema = (0, import_provider_utils30.lazySchema)(
|
|
5527
|
+
() => (0, import_provider_utils30.zodSchema)(
|
|
5528
|
+
import_v422.z.object({
|
|
5529
|
+
queries: import_v422.z.array(import_v422.z.string()),
|
|
5530
|
+
results: import_v422.z.array(
|
|
5531
|
+
import_v422.z.object({
|
|
5532
|
+
attributes: import_v422.z.record(import_v422.z.string(), import_v422.z.unknown()),
|
|
5533
|
+
fileId: import_v422.z.string(),
|
|
5534
|
+
filename: import_v422.z.string(),
|
|
5535
|
+
score: import_v422.z.number(),
|
|
5536
|
+
text: import_v422.z.string()
|
|
5413
5537
|
})
|
|
5414
5538
|
).nullable()
|
|
5415
5539
|
})
|
|
5416
5540
|
)
|
|
5417
5541
|
);
|
|
5418
|
-
var fileSearch = (0,
|
|
5542
|
+
var fileSearch = (0, import_provider_utils30.createProviderToolFactoryWithOutputSchema)({
|
|
5419
5543
|
id: "openai.file_search",
|
|
5420
|
-
inputSchema:
|
|
5544
|
+
inputSchema: import_v422.z.object({}),
|
|
5421
5545
|
outputSchema: fileSearchOutputSchema
|
|
5422
5546
|
});
|
|
5423
5547
|
|
|
5424
5548
|
// src/tool/image-generation.ts
|
|
5425
|
-
var
|
|
5426
|
-
var
|
|
5427
|
-
var imageGenerationArgsSchema = (0,
|
|
5428
|
-
() => (0,
|
|
5429
|
-
|
|
5430
|
-
background:
|
|
5431
|
-
inputFidelity:
|
|
5432
|
-
inputImageMask:
|
|
5433
|
-
fileId:
|
|
5434
|
-
imageUrl:
|
|
5549
|
+
var import_provider_utils31 = require("@ai-sdk/provider-utils");
|
|
5550
|
+
var import_v423 = require("zod/v4");
|
|
5551
|
+
var imageGenerationArgsSchema = (0, import_provider_utils31.lazySchema)(
|
|
5552
|
+
() => (0, import_provider_utils31.zodSchema)(
|
|
5553
|
+
import_v423.z.object({
|
|
5554
|
+
background: import_v423.z.enum(["auto", "opaque", "transparent"]).optional(),
|
|
5555
|
+
inputFidelity: import_v423.z.enum(["low", "high"]).optional(),
|
|
5556
|
+
inputImageMask: import_v423.z.object({
|
|
5557
|
+
fileId: import_v423.z.string().optional(),
|
|
5558
|
+
imageUrl: import_v423.z.string().optional()
|
|
5435
5559
|
}).optional(),
|
|
5436
|
-
model:
|
|
5437
|
-
moderation:
|
|
5438
|
-
outputCompression:
|
|
5439
|
-
outputFormat:
|
|
5440
|
-
partialImages:
|
|
5441
|
-
quality:
|
|
5442
|
-
size:
|
|
5560
|
+
model: import_v423.z.string().optional(),
|
|
5561
|
+
moderation: import_v423.z.enum(["auto"]).optional(),
|
|
5562
|
+
outputCompression: import_v423.z.number().int().min(0).max(100).optional(),
|
|
5563
|
+
outputFormat: import_v423.z.enum(["png", "jpeg", "webp"]).optional(),
|
|
5564
|
+
partialImages: import_v423.z.number().int().min(0).max(3).optional(),
|
|
5565
|
+
quality: import_v423.z.enum(["auto", "low", "medium", "high", "xhigh", "max"]).optional(),
|
|
5566
|
+
size: import_v423.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
5443
5567
|
}).strict()
|
|
5444
5568
|
)
|
|
5445
5569
|
);
|
|
5446
|
-
var imageGenerationInputSchema = (0,
|
|
5447
|
-
var imageGenerationOutputSchema = (0,
|
|
5448
|
-
() => (0,
|
|
5570
|
+
var imageGenerationInputSchema = (0, import_provider_utils31.lazySchema)(() => (0, import_provider_utils31.zodSchema)(import_v423.z.object({})));
|
|
5571
|
+
var imageGenerationOutputSchema = (0, import_provider_utils31.lazySchema)(
|
|
5572
|
+
() => (0, import_provider_utils31.zodSchema)(import_v423.z.object({ result: import_v423.z.string() }))
|
|
5449
5573
|
);
|
|
5450
|
-
var imageGenerationToolFactory = (0,
|
|
5574
|
+
var imageGenerationToolFactory = (0, import_provider_utils31.createProviderToolFactoryWithOutputSchema)({
|
|
5451
5575
|
id: "openai.image_generation",
|
|
5452
5576
|
inputSchema: imageGenerationInputSchema,
|
|
5453
5577
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -5457,153 +5581,95 @@ var imageGeneration = (args = {}) => {
|
|
|
5457
5581
|
};
|
|
5458
5582
|
|
|
5459
5583
|
// src/tool/custom.ts
|
|
5460
|
-
var
|
|
5461
|
-
var
|
|
5462
|
-
var customArgsSchema = (0,
|
|
5463
|
-
() => (0,
|
|
5464
|
-
|
|
5465
|
-
name:
|
|
5466
|
-
description:
|
|
5467
|
-
async:
|
|
5468
|
-
format:
|
|
5469
|
-
|
|
5470
|
-
type:
|
|
5471
|
-
syntax:
|
|
5472
|
-
definition:
|
|
5584
|
+
var import_provider_utils32 = require("@ai-sdk/provider-utils");
|
|
5585
|
+
var import_v424 = require("zod/v4");
|
|
5586
|
+
var customArgsSchema = (0, import_provider_utils32.lazySchema)(
|
|
5587
|
+
() => (0, import_provider_utils32.zodSchema)(
|
|
5588
|
+
import_v424.z.object({
|
|
5589
|
+
name: import_v424.z.string(),
|
|
5590
|
+
description: import_v424.z.string().optional(),
|
|
5591
|
+
async: import_v424.z.boolean().optional(),
|
|
5592
|
+
format: import_v424.z.union([
|
|
5593
|
+
import_v424.z.object({
|
|
5594
|
+
type: import_v424.z.literal("grammar"),
|
|
5595
|
+
syntax: import_v424.z.enum(["regex", "lark"]),
|
|
5596
|
+
definition: import_v424.z.string()
|
|
5473
5597
|
}),
|
|
5474
|
-
|
|
5475
|
-
type:
|
|
5598
|
+
import_v424.z.object({
|
|
5599
|
+
type: import_v424.z.literal("text")
|
|
5476
5600
|
})
|
|
5477
5601
|
]).optional()
|
|
5478
5602
|
})
|
|
5479
5603
|
)
|
|
5480
5604
|
);
|
|
5481
|
-
var customInputSchema = (0,
|
|
5482
|
-
var customToolFactory = (0,
|
|
5605
|
+
var customInputSchema = (0, import_provider_utils32.lazySchema)(() => (0, import_provider_utils32.zodSchema)(import_v424.z.string()));
|
|
5606
|
+
var customToolFactory = (0, import_provider_utils32.createProviderToolFactory)({
|
|
5483
5607
|
id: "openai.custom",
|
|
5484
5608
|
inputSchema: customInputSchema
|
|
5485
5609
|
});
|
|
5486
5610
|
|
|
5487
5611
|
// src/tool/mcp.ts
|
|
5488
|
-
var
|
|
5489
|
-
var
|
|
5490
|
-
var jsonValueSchema2 =
|
|
5491
|
-
() =>
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5612
|
+
var import_provider_utils33 = require("@ai-sdk/provider-utils");
|
|
5613
|
+
var import_v425 = require("zod/v4");
|
|
5614
|
+
var jsonValueSchema2 = import_v425.z.lazy(
|
|
5615
|
+
() => import_v425.z.union([
|
|
5616
|
+
import_v425.z.string(),
|
|
5617
|
+
import_v425.z.number(),
|
|
5618
|
+
import_v425.z.boolean(),
|
|
5619
|
+
import_v425.z.null(),
|
|
5620
|
+
import_v425.z.array(jsonValueSchema2),
|
|
5621
|
+
import_v425.z.record(import_v425.z.string(), jsonValueSchema2)
|
|
5498
5622
|
])
|
|
5499
5623
|
);
|
|
5500
|
-
var mcpArgsSchema = (0,
|
|
5501
|
-
() => (0,
|
|
5502
|
-
|
|
5503
|
-
serverLabel:
|
|
5504
|
-
allowedTools:
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
readOnly:
|
|
5508
|
-
toolNames:
|
|
5624
|
+
var mcpArgsSchema = (0, import_provider_utils33.lazySchema)(
|
|
5625
|
+
() => (0, import_provider_utils33.zodSchema)(
|
|
5626
|
+
import_v425.z.object({
|
|
5627
|
+
serverLabel: import_v425.z.string(),
|
|
5628
|
+
allowedTools: import_v425.z.union([
|
|
5629
|
+
import_v425.z.array(import_v425.z.string()),
|
|
5630
|
+
import_v425.z.object({
|
|
5631
|
+
readOnly: import_v425.z.boolean().optional(),
|
|
5632
|
+
toolNames: import_v425.z.array(import_v425.z.string()).optional()
|
|
5509
5633
|
})
|
|
5510
5634
|
]).optional(),
|
|
5511
|
-
authorization:
|
|
5512
|
-
connectorId:
|
|
5513
|
-
headers:
|
|
5514
|
-
requireApproval:
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
never:
|
|
5518
|
-
toolNames:
|
|
5635
|
+
authorization: import_v425.z.string().optional(),
|
|
5636
|
+
connectorId: import_v425.z.string().optional(),
|
|
5637
|
+
headers: import_v425.z.record(import_v425.z.string(), import_v425.z.string()).optional(),
|
|
5638
|
+
requireApproval: import_v425.z.union([
|
|
5639
|
+
import_v425.z.enum(["always", "never"]),
|
|
5640
|
+
import_v425.z.object({
|
|
5641
|
+
never: import_v425.z.object({
|
|
5642
|
+
toolNames: import_v425.z.array(import_v425.z.string()).optional()
|
|
5519
5643
|
}).optional()
|
|
5520
5644
|
})
|
|
5521
5645
|
]).optional(),
|
|
5522
|
-
serverDescription:
|
|
5523
|
-
serverUrl:
|
|
5646
|
+
serverDescription: import_v425.z.string().optional(),
|
|
5647
|
+
serverUrl: import_v425.z.string().optional()
|
|
5524
5648
|
}).refine(
|
|
5525
5649
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
5526
5650
|
"One of serverUrl or connectorId must be provided."
|
|
5527
5651
|
)
|
|
5528
5652
|
)
|
|
5529
5653
|
);
|
|
5530
|
-
var mcpInputSchema = (0,
|
|
5531
|
-
var mcpOutputSchema = (0,
|
|
5532
|
-
() => (0,
|
|
5533
|
-
|
|
5534
|
-
type:
|
|
5535
|
-
serverLabel:
|
|
5536
|
-
name:
|
|
5537
|
-
arguments:
|
|
5538
|
-
output:
|
|
5539
|
-
error:
|
|
5654
|
+
var mcpInputSchema = (0, import_provider_utils33.lazySchema)(() => (0, import_provider_utils33.zodSchema)(import_v425.z.object({})));
|
|
5655
|
+
var mcpOutputSchema = (0, import_provider_utils33.lazySchema)(
|
|
5656
|
+
() => (0, import_provider_utils33.zodSchema)(
|
|
5657
|
+
import_v425.z.object({
|
|
5658
|
+
type: import_v425.z.literal("call"),
|
|
5659
|
+
serverLabel: import_v425.z.string(),
|
|
5660
|
+
name: import_v425.z.string(),
|
|
5661
|
+
arguments: import_v425.z.string(),
|
|
5662
|
+
output: import_v425.z.string().nullish(),
|
|
5663
|
+
error: import_v425.z.union([import_v425.z.string(), jsonValueSchema2]).optional()
|
|
5540
5664
|
})
|
|
5541
5665
|
)
|
|
5542
5666
|
);
|
|
5543
|
-
var mcpToolFactory = (0,
|
|
5667
|
+
var mcpToolFactory = (0, import_provider_utils33.createProviderToolFactoryWithOutputSchema)({
|
|
5544
5668
|
id: "openai.mcp",
|
|
5545
5669
|
inputSchema: mcpInputSchema,
|
|
5546
5670
|
outputSchema: mcpOutputSchema
|
|
5547
5671
|
});
|
|
5548
5672
|
|
|
5549
|
-
// src/tool/web-search.ts
|
|
5550
|
-
var import_provider_utils33 = require("@ai-sdk/provider-utils");
|
|
5551
|
-
var import_v425 = require("zod/v4");
|
|
5552
|
-
var webSearchArgsSchema = (0, import_provider_utils33.lazySchema)(
|
|
5553
|
-
() => (0, import_provider_utils33.zodSchema)(
|
|
5554
|
-
import_v425.z.object({
|
|
5555
|
-
externalWebAccess: import_v425.z.boolean().optional(),
|
|
5556
|
-
filters: import_v425.z.object({
|
|
5557
|
-
allowedDomains: import_v425.z.array(import_v425.z.string()).optional(),
|
|
5558
|
-
blockedDomains: import_v425.z.array(import_v425.z.string()).optional()
|
|
5559
|
-
}).optional(),
|
|
5560
|
-
searchContextSize: import_v425.z.enum(["low", "medium", "high"]).optional(),
|
|
5561
|
-
userLocation: import_v425.z.object({
|
|
5562
|
-
type: import_v425.z.literal("approximate"),
|
|
5563
|
-
country: import_v425.z.string().optional(),
|
|
5564
|
-
city: import_v425.z.string().optional(),
|
|
5565
|
-
region: import_v425.z.string().optional(),
|
|
5566
|
-
timezone: import_v425.z.string().optional()
|
|
5567
|
-
}).optional()
|
|
5568
|
-
})
|
|
5569
|
-
)
|
|
5570
|
-
);
|
|
5571
|
-
var webSearchInputSchema = (0, import_provider_utils33.lazySchema)(() => (0, import_provider_utils33.zodSchema)(import_v425.z.object({})));
|
|
5572
|
-
var webSearchOutputSchema = (0, import_provider_utils33.lazySchema)(
|
|
5573
|
-
() => (0, import_provider_utils33.zodSchema)(
|
|
5574
|
-
import_v425.z.object({
|
|
5575
|
-
action: import_v425.z.discriminatedUnion("type", [
|
|
5576
|
-
import_v425.z.object({
|
|
5577
|
-
type: import_v425.z.literal("search"),
|
|
5578
|
-
query: import_v425.z.string().optional(),
|
|
5579
|
-
queries: import_v425.z.array(import_v425.z.string()).optional()
|
|
5580
|
-
}),
|
|
5581
|
-
import_v425.z.object({
|
|
5582
|
-
type: import_v425.z.literal("openPage"),
|
|
5583
|
-
url: import_v425.z.string().nullish()
|
|
5584
|
-
}),
|
|
5585
|
-
import_v425.z.object({
|
|
5586
|
-
type: import_v425.z.literal("findInPage"),
|
|
5587
|
-
url: import_v425.z.string().nullish(),
|
|
5588
|
-
pattern: import_v425.z.string().nullish()
|
|
5589
|
-
})
|
|
5590
|
-
]).optional(),
|
|
5591
|
-
sources: import_v425.z.array(
|
|
5592
|
-
import_v425.z.discriminatedUnion("type", [
|
|
5593
|
-
import_v425.z.object({ type: import_v425.z.literal("url"), url: import_v425.z.string() }),
|
|
5594
|
-
import_v425.z.object({ type: import_v425.z.literal("api"), name: import_v425.z.string() })
|
|
5595
|
-
])
|
|
5596
|
-
).optional()
|
|
5597
|
-
})
|
|
5598
|
-
)
|
|
5599
|
-
);
|
|
5600
|
-
var webSearchToolFactory = (0, import_provider_utils33.createProviderToolFactoryWithOutputSchema)({
|
|
5601
|
-
id: "openai.web_search",
|
|
5602
|
-
inputSchema: webSearchInputSchema,
|
|
5603
|
-
outputSchema: webSearchOutputSchema
|
|
5604
|
-
});
|
|
5605
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
5606
|
-
|
|
5607
5673
|
// src/tool/web-search-preview.ts
|
|
5608
5674
|
var import_provider_utils34 = require("@ai-sdk/provider-utils");
|
|
5609
5675
|
var import_v426 = require("zod/v4");
|