@ai-sdk/openai 3.0.123 → 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 +13 -0
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +167 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +168 -9
- 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 +1058 -900
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1050 -891
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/chat/openai-chat-language-model.ts +2 -1
- package/src/normalize-openai-json-schema.ts +142 -0
- package/src/responses/convert-to-openai-responses-input.ts +89 -0
- package/src/responses/openai-responses-api.ts +9 -1
- package/src/responses/openai-responses-language-model.ts +2 -1
package/dist/internal/index.js
CHANGED
|
@@ -128,6 +128,98 @@ function getGptVersion(modelId) {
|
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
// src/normalize-openai-json-schema.ts
|
|
132
|
+
function normalizeOpenAIJsonSchema(schema) {
|
|
133
|
+
const normalizedSchema = normalizeSchema(schema, true);
|
|
134
|
+
const reference = getSingletonReference(normalizedSchema);
|
|
135
|
+
if (reference == null) {
|
|
136
|
+
return normalizedSchema;
|
|
137
|
+
}
|
|
138
|
+
const { allOf: _allOf, ...schemaWithoutAllOf } = normalizedSchema;
|
|
139
|
+
const referencedSchema = getLocalReferenceSchema(reference, normalizedSchema);
|
|
140
|
+
return typeof referencedSchema !== "object" || referencedSchema == null ? normalizedSchema : { ...referencedSchema, ...schemaWithoutAllOf };
|
|
141
|
+
function normalizeSchema(schema2, isRoot = false) {
|
|
142
|
+
if (typeof schema2 !== "object" || schema2 == null) {
|
|
143
|
+
return schema2;
|
|
144
|
+
}
|
|
145
|
+
const normalizedSchema2 = { ...schema2 };
|
|
146
|
+
if (normalizedSchema2.properties != null) {
|
|
147
|
+
normalizedSchema2.properties = normalizeSchemaRecord(
|
|
148
|
+
normalizedSchema2.properties
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
if (normalizedSchema2.patternProperties != null) {
|
|
152
|
+
normalizedSchema2.patternProperties = normalizeSchemaRecord(
|
|
153
|
+
normalizedSchema2.patternProperties
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
if (normalizedSchema2.definitions != null) {
|
|
157
|
+
normalizedSchema2.definitions = normalizeSchemaRecord(
|
|
158
|
+
normalizedSchema2.definitions
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
if (normalizedSchema2.$defs != null) {
|
|
162
|
+
normalizedSchema2.$defs = normalizeSchemaRecord(normalizedSchema2.$defs);
|
|
163
|
+
}
|
|
164
|
+
if (normalizedSchema2.items != null) {
|
|
165
|
+
normalizedSchema2.items = Array.isArray(normalizedSchema2.items) ? normalizedSchema2.items.map((item) => normalizeSchema(item)) : normalizeSchema(normalizedSchema2.items);
|
|
166
|
+
}
|
|
167
|
+
if (normalizedSchema2.allOf != null) {
|
|
168
|
+
normalizedSchema2.allOf = normalizedSchema2.allOf.map(
|
|
169
|
+
(item) => normalizeSchema(item)
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
if (normalizedSchema2.anyOf != null) {
|
|
173
|
+
normalizedSchema2.anyOf = normalizedSchema2.anyOf.map(
|
|
174
|
+
(item) => normalizeSchema(item)
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
if (normalizedSchema2.oneOf != null) {
|
|
178
|
+
normalizedSchema2.oneOf = normalizedSchema2.oneOf.map(
|
|
179
|
+
(item) => normalizeSchema(item)
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
if (typeof normalizedSchema2.additionalProperties === "object" && normalizedSchema2.additionalProperties != null) {
|
|
183
|
+
normalizedSchema2.additionalProperties = normalizeSchema(
|
|
184
|
+
normalizedSchema2.additionalProperties
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
const reference2 = getSingletonReference(normalizedSchema2);
|
|
188
|
+
if (reference2 == null || isRoot) {
|
|
189
|
+
return normalizedSchema2;
|
|
190
|
+
}
|
|
191
|
+
const { allOf: _allOf2, ...schemaWithoutAllOf2 } = normalizedSchema2;
|
|
192
|
+
return { ...schemaWithoutAllOf2, $ref: reference2 };
|
|
193
|
+
}
|
|
194
|
+
function normalizeSchemaRecord(record) {
|
|
195
|
+
return Object.fromEntries(
|
|
196
|
+
Object.entries(record).map(([key, value]) => [
|
|
197
|
+
key,
|
|
198
|
+
normalizeSchema(value)
|
|
199
|
+
])
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
function getSingletonReference(schema2) {
|
|
203
|
+
var _a2;
|
|
204
|
+
if (((_a2 = schema2.allOf) == null ? void 0 : _a2.length) !== 1) {
|
|
205
|
+
return void 0;
|
|
206
|
+
}
|
|
207
|
+
const [allOfSchema] = schema2.allOf;
|
|
208
|
+
return typeof allOfSchema === "object" && allOfSchema != null && Object.keys(allOfSchema).length === 1 && typeof allOfSchema.$ref === "string" ? allOfSchema.$ref : void 0;
|
|
209
|
+
}
|
|
210
|
+
function getLocalReferenceSchema(reference2, schema2) {
|
|
211
|
+
var _a2, _b;
|
|
212
|
+
const match = /^#\/(definitions|\$defs)\/(.+)$/.exec(reference2);
|
|
213
|
+
if (match == null) {
|
|
214
|
+
return void 0;
|
|
215
|
+
}
|
|
216
|
+
const [, keyword, encodedName] = match;
|
|
217
|
+
const name = encodedName.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
218
|
+
const definition = keyword === "definitions" ? (_a2 = schema2.definitions) == null ? void 0 : _a2[name] : (_b = schema2.$defs) == null ? void 0 : _b[name];
|
|
219
|
+
return definition;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
131
223
|
// src/openai-stream-error.ts
|
|
132
224
|
var import_provider = require("@ai-sdk/provider");
|
|
133
225
|
function createOpenAIProviderStreamError(frame) {
|
|
@@ -1022,7 +1114,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
1022
1114
|
response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? responseFormat.schema != null ? {
|
|
1023
1115
|
type: "json_schema",
|
|
1024
1116
|
json_schema: {
|
|
1025
|
-
schema: responseFormat.schema,
|
|
1117
|
+
schema: normalizeOpenAIJsonSchema(responseFormat.schema),
|
|
1026
1118
|
strict: strictJsonSchema,
|
|
1027
1119
|
name: (_e = responseFormat.name) != null ? _e : "response",
|
|
1028
1120
|
description: responseFormat.description
|
|
@@ -2724,8 +2816,8 @@ function convertOpenAIResponsesUsage(usage) {
|
|
|
2724
2816
|
|
|
2725
2817
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2726
2818
|
var import_provider8 = require("@ai-sdk/provider");
|
|
2727
|
-
var
|
|
2728
|
-
var
|
|
2819
|
+
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
2820
|
+
var import_v419 = require("zod/v4");
|
|
2729
2821
|
|
|
2730
2822
|
// src/responses/openai-responses-options.ts
|
|
2731
2823
|
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
@@ -3225,9 +3317,67 @@ var toolSearchToolFactory = (0, import_provider_utils24.createProviderToolFactor
|
|
|
3225
3317
|
outputSchema: toolSearchOutputSchema
|
|
3226
3318
|
});
|
|
3227
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
|
+
|
|
3228
3378
|
// src/responses/expand-parallel-tool-call.ts
|
|
3229
3379
|
var import_provider7 = require("@ai-sdk/provider");
|
|
3230
|
-
var
|
|
3380
|
+
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
3231
3381
|
var parallelToolName = "parallel";
|
|
3232
3382
|
var recipientNamePrefix = "functions.";
|
|
3233
3383
|
function getParallelToolCallMetadata({
|
|
@@ -3256,7 +3406,7 @@ async function expandParallelToolCall({
|
|
|
3256
3406
|
if (!isUndeclaredParallelToolCall({ toolName: toolCall.toolName, tools })) {
|
|
3257
3407
|
return void 0;
|
|
3258
3408
|
}
|
|
3259
|
-
const parsedInput = await (0,
|
|
3409
|
+
const parsedInput = await (0, import_provider_utils26.safeParseJSON)({ text: toolCall.input });
|
|
3260
3410
|
if (!parsedInput.success || !(0, import_provider7.isJSONObject)(parsedInput.value)) {
|
|
3261
3411
|
return void 0;
|
|
3262
3412
|
}
|
|
@@ -3305,6 +3455,57 @@ async function expandParallelToolCall({
|
|
|
3305
3455
|
function serializeToolCallArguments2(input) {
|
|
3306
3456
|
return JSON.stringify(input === void 0 ? {} : input);
|
|
3307
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
|
+
}
|
|
3308
3509
|
async function convertFunctionToolResultOutput({
|
|
3309
3510
|
output,
|
|
3310
3511
|
promptCacheBreakpoint,
|
|
@@ -3414,7 +3615,7 @@ async function convertFunctionToolResultOutput({
|
|
|
3414
3615
|
return void 0;
|
|
3415
3616
|
}
|
|
3416
3617
|
}
|
|
3417
|
-
}).filter(
|
|
3618
|
+
}).filter(import_provider_utils27.isNonNullable);
|
|
3418
3619
|
}
|
|
3419
3620
|
}
|
|
3420
3621
|
function hasSameParallelToolCall(first, second) {
|
|
@@ -3465,7 +3666,7 @@ function collectCompleteParallelToolResultGroups({
|
|
|
3465
3666
|
{ length: group.metadata.count },
|
|
3466
3667
|
(_, index) => group.results.get(index)
|
|
3467
3668
|
);
|
|
3468
|
-
if (results.every(
|
|
3669
|
+
if (results.every(import_provider_utils27.isNonNullable)) {
|
|
3469
3670
|
completeGroups.set(toolCallId, {
|
|
3470
3671
|
metadata: group.metadata,
|
|
3471
3672
|
results
|
|
@@ -3511,7 +3712,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3511
3712
|
toolSearchToolName,
|
|
3512
3713
|
customProviderToolNames
|
|
3513
3714
|
}) {
|
|
3514
|
-
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;
|
|
3515
3716
|
let input = [];
|
|
3516
3717
|
const warnings = [];
|
|
3517
3718
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -3524,13 +3725,13 @@ async function convertToOpenAIResponsesInput({
|
|
|
3524
3725
|
for (const { role, content, providerOptions } of prompt) {
|
|
3525
3726
|
switch (role) {
|
|
3526
3727
|
case "system": {
|
|
3527
|
-
let options = await (0,
|
|
3728
|
+
let options = await (0, import_provider_utils27.parseProviderOptions)({
|
|
3528
3729
|
provider: providerOptionsName,
|
|
3529
3730
|
providerOptions,
|
|
3530
3731
|
schema: openaiResponsesSystemMessageOptionsSchema
|
|
3531
3732
|
});
|
|
3532
3733
|
if (options == null && providerOptionsName !== "openai") {
|
|
3533
|
-
options = await (0,
|
|
3734
|
+
options = await (0, import_provider_utils27.parseProviderOptions)({
|
|
3534
3735
|
provider: "openai",
|
|
3535
3736
|
providerOptions,
|
|
3536
3737
|
schema: openaiResponsesSystemMessageOptionsSchema
|
|
@@ -3634,7 +3835,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3634
3835
|
return {
|
|
3635
3836
|
type: "input_image",
|
|
3636
3837
|
...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
3637
|
-
image_url: `data:${mediaType};base64,${(0,
|
|
3838
|
+
image_url: `data:${mediaType};base64,${(0, import_provider_utils27.convertToBase64)(part.data)}`
|
|
3638
3839
|
},
|
|
3639
3840
|
detail: (_b2 = (_a3 = part.providerOptions) == null ? void 0 : _a3[providerOptionsName]) == null ? void 0 : _b2.imageDetail,
|
|
3640
3841
|
...promptCacheBreakpoint != null && {
|
|
@@ -3660,7 +3861,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3660
3861
|
type: "input_file",
|
|
3661
3862
|
...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
3662
3863
|
filename: (_c2 = part.filename) != null ? _c2 : mediaType === "application/pdf" ? `part-${index}.pdf` : `part-${index}`,
|
|
3663
|
-
file_data: `data:${mediaType};base64,${(0,
|
|
3864
|
+
file_data: `data:${mediaType};base64,${(0, import_provider_utils27.convertToBase64)(part.data)}`
|
|
3664
3865
|
},
|
|
3665
3866
|
...promptCacheBreakpoint != null && {
|
|
3666
3867
|
prompt_cache_breakpoint: promptCacheBreakpoint
|
|
@@ -3739,10 +3940,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
3739
3940
|
input.push({ type: "item_reference", id });
|
|
3740
3941
|
break;
|
|
3741
3942
|
}
|
|
3742
|
-
const parsedInput = typeof part.input === "string" ? await (0,
|
|
3943
|
+
const parsedInput = typeof part.input === "string" ? await (0, import_provider_utils27.parseJSON)({
|
|
3743
3944
|
text: part.input,
|
|
3744
3945
|
schema: toolSearchInputSchema
|
|
3745
|
-
}) : await (0,
|
|
3946
|
+
}) : await (0, import_provider_utils27.validateTypes)({
|
|
3746
3947
|
value: part.input,
|
|
3747
3948
|
schema: toolSearchInputSchema
|
|
3748
3949
|
});
|
|
@@ -3774,7 +3975,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3774
3975
|
break;
|
|
3775
3976
|
}
|
|
3776
3977
|
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
3777
|
-
const parsedInput = await (0,
|
|
3978
|
+
const parsedInput = await (0, import_provider_utils27.validateTypes)({
|
|
3778
3979
|
value: part.input,
|
|
3779
3980
|
schema: localShellInputSchema
|
|
3780
3981
|
});
|
|
@@ -3794,7 +3995,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3794
3995
|
break;
|
|
3795
3996
|
}
|
|
3796
3997
|
if (hasShellTool && resolvedToolName === "shell") {
|
|
3797
|
-
const parsedInput = await (0,
|
|
3998
|
+
const parsedInput = await (0, import_provider_utils27.validateTypes)({
|
|
3798
3999
|
value: part.input,
|
|
3799
4000
|
schema: shellInputSchema
|
|
3800
4001
|
});
|
|
@@ -3812,7 +4013,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3812
4013
|
break;
|
|
3813
4014
|
}
|
|
3814
4015
|
if (hasApplyPatchTool && resolvedToolName === "apply_patch") {
|
|
3815
|
-
const parsedInput = await (0,
|
|
4016
|
+
const parsedInput = await (0, import_provider_utils27.validateTypes)({
|
|
3816
4017
|
value: part.input,
|
|
3817
4018
|
schema: applyPatchInputSchema
|
|
3818
4019
|
});
|
|
@@ -3857,12 +4058,27 @@ async function convertToOpenAIResponsesInput({
|
|
|
3857
4058
|
const resolvedResultToolName = toolNameMapping.toProviderToolName(
|
|
3858
4059
|
part.toolName
|
|
3859
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
|
+
}
|
|
3860
4076
|
if (part.toolName === toolSearchToolName) {
|
|
3861
|
-
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;
|
|
3862
4078
|
if (store) {
|
|
3863
4079
|
input.push({ type: "item_reference", id: itemId });
|
|
3864
4080
|
} else if (part.output.type === "json") {
|
|
3865
|
-
const parsedOutput = await (0,
|
|
4081
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
3866
4082
|
value: part.output.value,
|
|
3867
4083
|
schema: toolSearchOutputSchema
|
|
3868
4084
|
});
|
|
@@ -3879,7 +4095,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3879
4095
|
}
|
|
3880
4096
|
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
3881
4097
|
if (part.output.type === "json") {
|
|
3882
|
-
const parsedOutput = await (0,
|
|
4098
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
3883
4099
|
value: part.output.value,
|
|
3884
4100
|
schema: shellOutputSchema
|
|
3885
4101
|
});
|
|
@@ -3899,7 +4115,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3899
4115
|
break;
|
|
3900
4116
|
}
|
|
3901
4117
|
if (store) {
|
|
3902
|
-
const itemId = (
|
|
4118
|
+
const itemId = (_D = (_C = (_B = part.providerOptions) == null ? void 0 : _B[providerOptionsName]) == null ? void 0 : _C.itemId) != null ? _D : part.toolCallId;
|
|
3903
4119
|
input.push({ type: "item_reference", id: itemId });
|
|
3904
4120
|
} else {
|
|
3905
4121
|
warnings.push({
|
|
@@ -3910,7 +4126,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3910
4126
|
break;
|
|
3911
4127
|
}
|
|
3912
4128
|
case "reasoning": {
|
|
3913
|
-
const providerOptions2 = await (0,
|
|
4129
|
+
const providerOptions2 = await (0, import_provider_utils27.parseProviderOptions)({
|
|
3914
4130
|
provider: providerOptionsName,
|
|
3915
4131
|
providerOptions: part.providerOptions,
|
|
3916
4132
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -4066,7 +4282,7 @@ ${text}`,
|
|
|
4066
4282
|
}
|
|
4067
4283
|
const output = part.output;
|
|
4068
4284
|
if (output.type === "execution-denied") {
|
|
4069
|
-
const approvalId = (
|
|
4285
|
+
const approvalId = (_F = (_E = output.providerOptions) == null ? void 0 : _E.openai) == null ? void 0 : _F.approvalId;
|
|
4070
4286
|
if (approvalId) {
|
|
4071
4287
|
continue;
|
|
4072
4288
|
}
|
|
@@ -4075,7 +4291,7 @@ ${text}`,
|
|
|
4075
4291
|
part.toolName
|
|
4076
4292
|
);
|
|
4077
4293
|
if (part.toolName === toolSearchToolName && output.type === "json") {
|
|
4078
|
-
const parsedOutput = await (0,
|
|
4294
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
4079
4295
|
value: output.value,
|
|
4080
4296
|
schema: toolSearchOutputSchema
|
|
4081
4297
|
});
|
|
@@ -4089,7 +4305,7 @@ ${text}`,
|
|
|
4089
4305
|
continue;
|
|
4090
4306
|
}
|
|
4091
4307
|
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
4092
|
-
const parsedOutput = await (0,
|
|
4308
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
4093
4309
|
value: output.value,
|
|
4094
4310
|
schema: localShellOutputSchema
|
|
4095
4311
|
});
|
|
@@ -4101,7 +4317,7 @@ ${text}`,
|
|
|
4101
4317
|
continue;
|
|
4102
4318
|
}
|
|
4103
4319
|
if (hasShellTool && resolvedToolName === "shell" && output.type === "json") {
|
|
4104
|
-
const parsedOutput = await (0,
|
|
4320
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
4105
4321
|
value: output.value,
|
|
4106
4322
|
schema: shellOutputSchema
|
|
4107
4323
|
});
|
|
@@ -4120,7 +4336,7 @@ ${text}`,
|
|
|
4120
4336
|
continue;
|
|
4121
4337
|
}
|
|
4122
4338
|
if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
|
|
4123
|
-
const parsedOutput = await (0,
|
|
4339
|
+
const parsedOutput = await (0, import_provider_utils27.validateTypes)({
|
|
4124
4340
|
value: output.value,
|
|
4125
4341
|
schema: applyPatchOutputSchema
|
|
4126
4342
|
});
|
|
@@ -4153,7 +4369,7 @@ ${text}`,
|
|
|
4153
4369
|
break;
|
|
4154
4370
|
case "execution-denied":
|
|
4155
4371
|
outputValue = convertScalarOutput(
|
|
4156
|
-
(
|
|
4372
|
+
(_G = output.reason) != null ? _G : "Tool call execution denied."
|
|
4157
4373
|
);
|
|
4158
4374
|
break;
|
|
4159
4375
|
case "json":
|
|
@@ -4218,7 +4434,7 @@ ${text}`,
|
|
|
4218
4434
|
});
|
|
4219
4435
|
return void 0;
|
|
4220
4436
|
}
|
|
4221
|
-
}).filter(
|
|
4437
|
+
}).filter(import_provider_utils27.isNonNullable);
|
|
4222
4438
|
break;
|
|
4223
4439
|
default:
|
|
4224
4440
|
outputValue = "";
|
|
@@ -4267,9 +4483,9 @@ ${text}`,
|
|
|
4267
4483
|
}
|
|
4268
4484
|
return { input, warnings };
|
|
4269
4485
|
}
|
|
4270
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4271
|
-
itemId:
|
|
4272
|
-
reasoningEncryptedContent:
|
|
4486
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v419.z.object({
|
|
4487
|
+
itemId: import_v419.z.string().nullish(),
|
|
4488
|
+
reasoningEncryptedContent: import_v419.z.string().nullish()
|
|
4273
4489
|
});
|
|
4274
4490
|
|
|
4275
4491
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -4291,75 +4507,75 @@ function mapOpenAIResponseFinishReason({
|
|
|
4291
4507
|
}
|
|
4292
4508
|
|
|
4293
4509
|
// src/responses/openai-responses-api.ts
|
|
4294
|
-
var
|
|
4295
|
-
var
|
|
4296
|
-
var jsonValueSchema =
|
|
4297
|
-
() =>
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
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())
|
|
4304
4520
|
])
|
|
4305
4521
|
);
|
|
4306
|
-
var jsonObjectSchema =
|
|
4307
|
-
var openaiResponsesUsageSchema =
|
|
4522
|
+
var jsonObjectSchema = import_v420.z.record(import_v420.z.string(), jsonValueSchema.optional());
|
|
4523
|
+
var openaiResponsesUsageSchema = import_v420.z.intersection(
|
|
4308
4524
|
jsonObjectSchema,
|
|
4309
|
-
|
|
4310
|
-
input_tokens:
|
|
4311
|
-
input_tokens_details:
|
|
4525
|
+
import_v420.z.object({
|
|
4526
|
+
input_tokens: import_v420.z.number(),
|
|
4527
|
+
input_tokens_details: import_v420.z.intersection(
|
|
4312
4528
|
jsonObjectSchema,
|
|
4313
|
-
|
|
4314
|
-
cached_tokens:
|
|
4315
|
-
cache_write_tokens:
|
|
4316
|
-
orchestration_input_tokens:
|
|
4317
|
-
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()
|
|
4318
4534
|
})
|
|
4319
4535
|
).nullish(),
|
|
4320
|
-
output_tokens:
|
|
4321
|
-
output_tokens_details:
|
|
4536
|
+
output_tokens: import_v420.z.number(),
|
|
4537
|
+
output_tokens_details: import_v420.z.intersection(
|
|
4322
4538
|
jsonObjectSchema,
|
|
4323
|
-
|
|
4324
|
-
reasoning_tokens:
|
|
4325
|
-
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()
|
|
4326
4542
|
})
|
|
4327
4543
|
).nullish(),
|
|
4328
|
-
total_tokens:
|
|
4544
|
+
total_tokens: import_v420.z.number().optional()
|
|
4329
4545
|
})
|
|
4330
4546
|
);
|
|
4331
4547
|
function isRecord(value) {
|
|
4332
4548
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
4333
4549
|
}
|
|
4334
|
-
var openaiResponsesLocalShellCallSchema =
|
|
4335
|
-
type:
|
|
4336
|
-
id:
|
|
4337
|
-
call_id:
|
|
4338
|
-
action:
|
|
4339
|
-
type:
|
|
4340
|
-
command:
|
|
4341
|
-
timeout_ms:
|
|
4342
|
-
user:
|
|
4343
|
-
working_directory:
|
|
4344
|
-
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()
|
|
4345
4561
|
})
|
|
4346
4562
|
});
|
|
4347
|
-
var openaiResponsesNestedErrorChunkSchema =
|
|
4348
|
-
type:
|
|
4349
|
-
sequence_number:
|
|
4350
|
-
error:
|
|
4351
|
-
type:
|
|
4352
|
-
code:
|
|
4353
|
-
message:
|
|
4354
|
-
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()
|
|
4355
4571
|
})
|
|
4356
4572
|
});
|
|
4357
|
-
var openaiResponsesErrorChunkSchema =
|
|
4358
|
-
type:
|
|
4359
|
-
sequence_number:
|
|
4360
|
-
code:
|
|
4361
|
-
message:
|
|
4362
|
-
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()
|
|
4363
4579
|
});
|
|
4364
4580
|
var openaiResponsesModeledChunkTypes = /* @__PURE__ */ new Set([
|
|
4365
4581
|
"error",
|
|
@@ -4415,523 +4631,523 @@ function isModeledOpenAIResponsesChunk(value) {
|
|
|
4415
4631
|
}
|
|
4416
4632
|
return openaiResponsesModeledOutputItemTypes.has(value.item.type);
|
|
4417
4633
|
}
|
|
4418
|
-
var openaiResponsesChunkSchema = (0,
|
|
4419
|
-
() => (0,
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
type:
|
|
4423
|
-
item_id:
|
|
4424
|
-
delta:
|
|
4425
|
-
logprobs:
|
|
4426
|
-
|
|
4427
|
-
token:
|
|
4428
|
-
logprob:
|
|
4429
|
-
top_logprobs:
|
|
4430
|
-
|
|
4431
|
-
token:
|
|
4432
|
-
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()
|
|
4433
4649
|
})
|
|
4434
4650
|
)
|
|
4435
4651
|
})
|
|
4436
4652
|
).nullish()
|
|
4437
4653
|
}),
|
|
4438
|
-
|
|
4439
|
-
type:
|
|
4440
|
-
response:
|
|
4441
|
-
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(),
|
|
4442
4658
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4443
|
-
reasoning:
|
|
4444
|
-
context:
|
|
4659
|
+
reasoning: import_v420.z.object({
|
|
4660
|
+
context: import_v420.z.string().nullish()
|
|
4445
4661
|
}).nullish(),
|
|
4446
|
-
service_tier:
|
|
4662
|
+
service_tier: import_v420.z.string().nullish()
|
|
4447
4663
|
})
|
|
4448
4664
|
}),
|
|
4449
|
-
|
|
4450
|
-
type:
|
|
4451
|
-
sequence_number:
|
|
4452
|
-
response:
|
|
4453
|
-
error:
|
|
4454
|
-
code:
|
|
4455
|
-
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()
|
|
4456
4672
|
}).nullish(),
|
|
4457
|
-
incomplete_details:
|
|
4673
|
+
incomplete_details: import_v420.z.object({ reason: import_v420.z.string() }).nullish(),
|
|
4458
4674
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4459
|
-
reasoning:
|
|
4460
|
-
context:
|
|
4675
|
+
reasoning: import_v420.z.object({
|
|
4676
|
+
context: import_v420.z.string().nullish()
|
|
4461
4677
|
}).nullish(),
|
|
4462
|
-
service_tier:
|
|
4678
|
+
service_tier: import_v420.z.string().nullish()
|
|
4463
4679
|
})
|
|
4464
4680
|
}),
|
|
4465
|
-
|
|
4466
|
-
type:
|
|
4467
|
-
response:
|
|
4468
|
-
id:
|
|
4469
|
-
created_at:
|
|
4470
|
-
model:
|
|
4471
|
-
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()
|
|
4472
4688
|
})
|
|
4473
4689
|
}),
|
|
4474
|
-
|
|
4475
|
-
type:
|
|
4476
|
-
output_index:
|
|
4477
|
-
item:
|
|
4478
|
-
|
|
4479
|
-
type:
|
|
4480
|
-
id:
|
|
4481
|
-
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()
|
|
4482
4698
|
}),
|
|
4483
|
-
|
|
4484
|
-
type:
|
|
4485
|
-
id:
|
|
4486
|
-
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()
|
|
4487
4703
|
}),
|
|
4488
|
-
|
|
4489
|
-
type:
|
|
4490
|
-
id:
|
|
4491
|
-
call_id:
|
|
4492
|
-
name:
|
|
4493
|
-
arguments:
|
|
4494
|
-
async:
|
|
4495
|
-
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()
|
|
4496
4712
|
}),
|
|
4497
|
-
|
|
4498
|
-
type:
|
|
4499
|
-
id:
|
|
4500
|
-
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()
|
|
4501
4717
|
}),
|
|
4502
|
-
|
|
4503
|
-
type:
|
|
4504
|
-
id:
|
|
4505
|
-
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()
|
|
4506
4722
|
}),
|
|
4507
|
-
|
|
4508
|
-
type:
|
|
4509
|
-
id:
|
|
4723
|
+
import_v420.z.object({
|
|
4724
|
+
type: import_v420.z.literal("file_search_call"),
|
|
4725
|
+
id: import_v420.z.string()
|
|
4510
4726
|
}),
|
|
4511
4727
|
openaiResponsesLocalShellCallSchema,
|
|
4512
|
-
|
|
4513
|
-
type:
|
|
4514
|
-
id:
|
|
4728
|
+
import_v420.z.object({
|
|
4729
|
+
type: import_v420.z.literal("image_generation_call"),
|
|
4730
|
+
id: import_v420.z.string()
|
|
4515
4731
|
}),
|
|
4516
|
-
|
|
4517
|
-
type:
|
|
4518
|
-
id:
|
|
4519
|
-
container_id:
|
|
4520
|
-
code:
|
|
4521
|
-
outputs:
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
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() })
|
|
4525
4741
|
])
|
|
4526
4742
|
).nullable(),
|
|
4527
|
-
status:
|
|
4743
|
+
status: import_v420.z.string()
|
|
4528
4744
|
}),
|
|
4529
|
-
|
|
4530
|
-
type:
|
|
4531
|
-
id:
|
|
4532
|
-
status:
|
|
4533
|
-
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()
|
|
4534
4750
|
}),
|
|
4535
|
-
|
|
4536
|
-
type:
|
|
4537
|
-
id:
|
|
4751
|
+
import_v420.z.object({
|
|
4752
|
+
type: import_v420.z.literal("mcp_list_tools"),
|
|
4753
|
+
id: import_v420.z.string()
|
|
4538
4754
|
}),
|
|
4539
|
-
|
|
4540
|
-
type:
|
|
4541
|
-
id:
|
|
4755
|
+
import_v420.z.object({
|
|
4756
|
+
type: import_v420.z.literal("mcp_approval_request"),
|
|
4757
|
+
id: import_v420.z.string()
|
|
4542
4758
|
}),
|
|
4543
|
-
|
|
4544
|
-
type:
|
|
4545
|
-
id:
|
|
4546
|
-
call_id:
|
|
4547
|
-
status:
|
|
4548
|
-
operation:
|
|
4549
|
-
|
|
4550
|
-
type:
|
|
4551
|
-
path:
|
|
4552
|
-
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()
|
|
4553
4769
|
}),
|
|
4554
|
-
|
|
4555
|
-
type:
|
|
4556
|
-
path:
|
|
4770
|
+
import_v420.z.object({
|
|
4771
|
+
type: import_v420.z.literal("delete_file"),
|
|
4772
|
+
path: import_v420.z.string()
|
|
4557
4773
|
}),
|
|
4558
|
-
|
|
4559
|
-
type:
|
|
4560
|
-
path:
|
|
4561
|
-
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()
|
|
4562
4778
|
})
|
|
4563
4779
|
])
|
|
4564
4780
|
}),
|
|
4565
|
-
|
|
4566
|
-
type:
|
|
4567
|
-
id:
|
|
4568
|
-
call_id:
|
|
4569
|
-
name:
|
|
4570
|
-
input:
|
|
4571
|
-
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()
|
|
4572
4788
|
}),
|
|
4573
|
-
|
|
4574
|
-
type:
|
|
4575
|
-
id:
|
|
4576
|
-
call_id:
|
|
4577
|
-
status:
|
|
4578
|
-
action:
|
|
4579
|
-
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())
|
|
4580
4796
|
})
|
|
4581
4797
|
}),
|
|
4582
|
-
|
|
4583
|
-
type:
|
|
4584
|
-
id:
|
|
4585
|
-
call_id:
|
|
4586
|
-
status:
|
|
4587
|
-
output:
|
|
4588
|
-
|
|
4589
|
-
stdout:
|
|
4590
|
-
stderr:
|
|
4591
|
-
outcome:
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
type:
|
|
4595
|
-
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()
|
|
4596
4812
|
})
|
|
4597
4813
|
])
|
|
4598
4814
|
})
|
|
4599
4815
|
)
|
|
4600
4816
|
}),
|
|
4601
|
-
|
|
4602
|
-
type:
|
|
4603
|
-
id:
|
|
4604
|
-
execution:
|
|
4605
|
-
call_id:
|
|
4606
|
-
status:
|
|
4607
|
-
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()
|
|
4608
4824
|
}),
|
|
4609
|
-
|
|
4610
|
-
type:
|
|
4611
|
-
id:
|
|
4612
|
-
execution:
|
|
4613
|
-
call_id:
|
|
4614
|
-
status:
|
|
4615
|
-
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()))
|
|
4616
4832
|
})
|
|
4617
4833
|
])
|
|
4618
4834
|
}),
|
|
4619
|
-
|
|
4620
|
-
type:
|
|
4621
|
-
output_index:
|
|
4622
|
-
item:
|
|
4623
|
-
|
|
4624
|
-
type:
|
|
4625
|
-
id:
|
|
4626
|
-
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()
|
|
4627
4843
|
}),
|
|
4628
|
-
|
|
4629
|
-
type:
|
|
4630
|
-
id:
|
|
4631
|
-
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()
|
|
4632
4848
|
}),
|
|
4633
|
-
|
|
4634
|
-
type:
|
|
4635
|
-
id:
|
|
4636
|
-
call_id:
|
|
4637
|
-
name:
|
|
4638
|
-
arguments:
|
|
4639
|
-
async:
|
|
4640
|
-
status:
|
|
4641
|
-
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()
|
|
4642
4858
|
}),
|
|
4643
|
-
|
|
4644
|
-
type:
|
|
4645
|
-
id:
|
|
4646
|
-
call_id:
|
|
4647
|
-
name:
|
|
4648
|
-
input:
|
|
4649
|
-
async:
|
|
4650
|
-
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"])
|
|
4651
4867
|
}),
|
|
4652
|
-
|
|
4653
|
-
type:
|
|
4654
|
-
id:
|
|
4655
|
-
code:
|
|
4656
|
-
container_id:
|
|
4657
|
-
outputs:
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
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() })
|
|
4661
4877
|
])
|
|
4662
4878
|
).nullable()
|
|
4663
4879
|
}),
|
|
4664
|
-
|
|
4665
|
-
type:
|
|
4666
|
-
id:
|
|
4667
|
-
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()
|
|
4668
4884
|
}),
|
|
4669
|
-
|
|
4670
|
-
type:
|
|
4671
|
-
id:
|
|
4672
|
-
status:
|
|
4673
|
-
action:
|
|
4674
|
-
|
|
4675
|
-
type:
|
|
4676
|
-
query:
|
|
4677
|
-
queries:
|
|
4678
|
-
sources:
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
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() })
|
|
4682
4898
|
])
|
|
4683
4899
|
).nullish()
|
|
4684
4900
|
}),
|
|
4685
|
-
|
|
4686
|
-
type:
|
|
4687
|
-
url:
|
|
4901
|
+
import_v420.z.object({
|
|
4902
|
+
type: import_v420.z.literal("open_page"),
|
|
4903
|
+
url: import_v420.z.string().nullish()
|
|
4688
4904
|
}),
|
|
4689
|
-
|
|
4690
|
-
type:
|
|
4691
|
-
url:
|
|
4692
|
-
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()
|
|
4693
4909
|
})
|
|
4694
4910
|
]).nullish()
|
|
4695
4911
|
}),
|
|
4696
|
-
|
|
4697
|
-
type:
|
|
4698
|
-
id:
|
|
4699
|
-
queries:
|
|
4700
|
-
results:
|
|
4701
|
-
|
|
4702
|
-
attributes:
|
|
4703
|
-
|
|
4704
|
-
|
|
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()])
|
|
4705
4921
|
),
|
|
4706
|
-
file_id:
|
|
4707
|
-
filename:
|
|
4708
|
-
score:
|
|
4709
|
-
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()
|
|
4710
4926
|
})
|
|
4711
4927
|
).nullish()
|
|
4712
4928
|
}),
|
|
4713
4929
|
openaiResponsesLocalShellCallSchema,
|
|
4714
|
-
|
|
4715
|
-
type:
|
|
4716
|
-
id:
|
|
4717
|
-
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")
|
|
4718
4934
|
}),
|
|
4719
|
-
|
|
4720
|
-
type:
|
|
4721
|
-
id:
|
|
4722
|
-
status:
|
|
4723
|
-
arguments:
|
|
4724
|
-
name:
|
|
4725
|
-
server_label:
|
|
4726
|
-
output:
|
|
4727
|
-
error:
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
type:
|
|
4731
|
-
code:
|
|
4732
|
-
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()
|
|
4733
4949
|
}).loose()
|
|
4734
4950
|
]).nullish(),
|
|
4735
|
-
approval_request_id:
|
|
4951
|
+
approval_request_id: import_v420.z.string().nullish()
|
|
4736
4952
|
}),
|
|
4737
|
-
|
|
4738
|
-
type:
|
|
4739
|
-
id:
|
|
4740
|
-
server_label:
|
|
4741
|
-
tools:
|
|
4742
|
-
|
|
4743
|
-
name:
|
|
4744
|
-
description:
|
|
4745
|
-
input_schema:
|
|
4746
|
-
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()
|
|
4747
4963
|
})
|
|
4748
4964
|
),
|
|
4749
|
-
error:
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
type:
|
|
4753
|
-
code:
|
|
4754
|
-
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()
|
|
4755
4971
|
}).loose()
|
|
4756
4972
|
]).optional()
|
|
4757
4973
|
}),
|
|
4758
|
-
|
|
4759
|
-
type:
|
|
4760
|
-
id:
|
|
4761
|
-
server_label:
|
|
4762
|
-
name:
|
|
4763
|
-
arguments:
|
|
4764
|
-
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()
|
|
4765
4981
|
}),
|
|
4766
|
-
|
|
4767
|
-
type:
|
|
4768
|
-
id:
|
|
4769
|
-
call_id:
|
|
4770
|
-
status:
|
|
4771
|
-
operation:
|
|
4772
|
-
|
|
4773
|
-
type:
|
|
4774
|
-
path:
|
|
4775
|
-
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()
|
|
4776
4992
|
}),
|
|
4777
|
-
|
|
4778
|
-
type:
|
|
4779
|
-
path:
|
|
4993
|
+
import_v420.z.object({
|
|
4994
|
+
type: import_v420.z.literal("delete_file"),
|
|
4995
|
+
path: import_v420.z.string()
|
|
4780
4996
|
}),
|
|
4781
|
-
|
|
4782
|
-
type:
|
|
4783
|
-
path:
|
|
4784
|
-
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()
|
|
4785
5001
|
})
|
|
4786
5002
|
])
|
|
4787
5003
|
}),
|
|
4788
|
-
|
|
4789
|
-
type:
|
|
4790
|
-
id:
|
|
4791
|
-
call_id:
|
|
4792
|
-
status:
|
|
4793
|
-
action:
|
|
4794
|
-
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())
|
|
4795
5011
|
})
|
|
4796
5012
|
}),
|
|
4797
|
-
|
|
4798
|
-
type:
|
|
4799
|
-
id:
|
|
4800
|
-
call_id:
|
|
4801
|
-
status:
|
|
4802
|
-
output:
|
|
4803
|
-
|
|
4804
|
-
stdout:
|
|
4805
|
-
stderr:
|
|
4806
|
-
outcome:
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
type:
|
|
4810
|
-
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()
|
|
4811
5027
|
})
|
|
4812
5028
|
])
|
|
4813
5029
|
})
|
|
4814
5030
|
)
|
|
4815
5031
|
}),
|
|
4816
|
-
|
|
4817
|
-
type:
|
|
4818
|
-
id:
|
|
4819
|
-
execution:
|
|
4820
|
-
call_id:
|
|
4821
|
-
status:
|
|
4822
|
-
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()
|
|
4823
5039
|
}),
|
|
4824
|
-
|
|
4825
|
-
type:
|
|
4826
|
-
id:
|
|
4827
|
-
execution:
|
|
4828
|
-
call_id:
|
|
4829
|
-
status:
|
|
4830
|
-
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()))
|
|
4831
5047
|
})
|
|
4832
5048
|
])
|
|
4833
5049
|
}),
|
|
4834
|
-
|
|
4835
|
-
type:
|
|
4836
|
-
item_id:
|
|
4837
|
-
output_index:
|
|
4838
|
-
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()
|
|
4839
5055
|
}),
|
|
4840
|
-
|
|
5056
|
+
import_v420.z.object({
|
|
4841
5057
|
// `name` is documented as required but omitted from live API events:
|
|
4842
5058
|
// https://github.com/openai/openai-openapi/issues/545
|
|
4843
|
-
type:
|
|
4844
|
-
item_id:
|
|
4845
|
-
output_index:
|
|
4846
|
-
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()
|
|
4847
5063
|
}),
|
|
4848
|
-
|
|
4849
|
-
type:
|
|
4850
|
-
item_id:
|
|
4851
|
-
output_index:
|
|
4852
|
-
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()
|
|
4853
5069
|
}),
|
|
4854
|
-
|
|
4855
|
-
type:
|
|
4856
|
-
item_id:
|
|
4857
|
-
output_index:
|
|
4858
|
-
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()
|
|
4859
5075
|
}),
|
|
4860
|
-
|
|
4861
|
-
type:
|
|
4862
|
-
item_id:
|
|
4863
|
-
output_index:
|
|
4864
|
-
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()
|
|
4865
5081
|
}),
|
|
4866
|
-
|
|
4867
|
-
type:
|
|
4868
|
-
item_id:
|
|
4869
|
-
output_index:
|
|
4870
|
-
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()
|
|
4871
5087
|
}),
|
|
4872
|
-
|
|
4873
|
-
type:
|
|
4874
|
-
annotation:
|
|
4875
|
-
|
|
4876
|
-
type:
|
|
4877
|
-
start_index:
|
|
4878
|
-
end_index:
|
|
4879
|
-
url:
|
|
4880
|
-
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()
|
|
4881
5097
|
}),
|
|
4882
|
-
|
|
4883
|
-
type:
|
|
4884
|
-
file_id:
|
|
4885
|
-
filename:
|
|
4886
|
-
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()
|
|
4887
5103
|
}),
|
|
4888
|
-
|
|
4889
|
-
type:
|
|
4890
|
-
container_id:
|
|
4891
|
-
file_id:
|
|
4892
|
-
filename:
|
|
4893
|
-
start_index:
|
|
4894
|
-
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()
|
|
4895
5111
|
}),
|
|
4896
|
-
|
|
4897
|
-
type:
|
|
4898
|
-
file_id:
|
|
4899
|
-
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()
|
|
4900
5116
|
})
|
|
4901
5117
|
])
|
|
4902
5118
|
}),
|
|
4903
|
-
|
|
4904
|
-
type:
|
|
4905
|
-
item_id:
|
|
4906
|
-
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()
|
|
4907
5123
|
}),
|
|
4908
|
-
|
|
4909
|
-
type:
|
|
4910
|
-
item_id:
|
|
4911
|
-
summary_index:
|
|
4912
|
-
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()
|
|
4913
5129
|
}),
|
|
4914
|
-
|
|
4915
|
-
type:
|
|
4916
|
-
item_id:
|
|
4917
|
-
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()
|
|
4918
5134
|
}),
|
|
4919
|
-
|
|
4920
|
-
type:
|
|
4921
|
-
item_id:
|
|
4922
|
-
output_index:
|
|
4923
|
-
delta:
|
|
4924
|
-
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()
|
|
4925
5141
|
}),
|
|
4926
|
-
|
|
4927
|
-
type:
|
|
4928
|
-
item_id:
|
|
4929
|
-
output_index:
|
|
4930
|
-
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()
|
|
4931
5147
|
}),
|
|
4932
5148
|
openaiResponsesNestedErrorChunkSchema,
|
|
4933
5149
|
openaiResponsesErrorChunkSchema,
|
|
4934
|
-
|
|
5150
|
+
import_v420.z.object({ type: import_v420.z.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {
|
|
4935
5151
|
message: "Known response chunk failed schema validation"
|
|
4936
5152
|
}).transform((value) => ({
|
|
4937
5153
|
type: "unknown_chunk",
|
|
@@ -4941,292 +5157,292 @@ var openaiResponsesChunkSchema = (0, import_provider_utils27.lazySchema)(
|
|
|
4941
5157
|
])
|
|
4942
5158
|
)
|
|
4943
5159
|
);
|
|
4944
|
-
var openaiResponsesResponseSchema = (0,
|
|
4945
|
-
() => (0,
|
|
4946
|
-
|
|
4947
|
-
id:
|
|
4948
|
-
created_at:
|
|
4949
|
-
error:
|
|
4950
|
-
message:
|
|
4951
|
-
type:
|
|
4952
|
-
param:
|
|
4953
|
-
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()
|
|
4954
5170
|
}).nullish(),
|
|
4955
|
-
model:
|
|
4956
|
-
output:
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
type:
|
|
4960
|
-
role:
|
|
4961
|
-
id:
|
|
4962
|
-
phase:
|
|
4963
|
-
content:
|
|
4964
|
-
|
|
4965
|
-
type:
|
|
4966
|
-
text:
|
|
4967
|
-
logprobs:
|
|
4968
|
-
|
|
4969
|
-
token:
|
|
4970
|
-
logprob:
|
|
4971
|
-
top_logprobs:
|
|
4972
|
-
|
|
4973
|
-
token:
|
|
4974
|
-
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()
|
|
4975
5191
|
})
|
|
4976
5192
|
)
|
|
4977
5193
|
})
|
|
4978
5194
|
).nullish(),
|
|
4979
|
-
annotations:
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
type:
|
|
4983
|
-
start_index:
|
|
4984
|
-
end_index:
|
|
4985
|
-
url:
|
|
4986
|
-
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()
|
|
4987
5203
|
}),
|
|
4988
|
-
|
|
4989
|
-
type:
|
|
4990
|
-
file_id:
|
|
4991
|
-
filename:
|
|
4992
|
-
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()
|
|
4993
5209
|
}),
|
|
4994
|
-
|
|
4995
|
-
type:
|
|
4996
|
-
container_id:
|
|
4997
|
-
file_id:
|
|
4998
|
-
filename:
|
|
4999
|
-
start_index:
|
|
5000
|
-
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()
|
|
5001
5217
|
}),
|
|
5002
|
-
|
|
5003
|
-
type:
|
|
5004
|
-
file_id:
|
|
5005
|
-
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()
|
|
5006
5222
|
})
|
|
5007
5223
|
])
|
|
5008
5224
|
)
|
|
5009
5225
|
})
|
|
5010
5226
|
)
|
|
5011
5227
|
}),
|
|
5012
|
-
|
|
5013
|
-
type:
|
|
5014
|
-
id:
|
|
5015
|
-
status:
|
|
5016
|
-
action:
|
|
5017
|
-
|
|
5018
|
-
type:
|
|
5019
|
-
query:
|
|
5020
|
-
queries:
|
|
5021
|
-
sources:
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
type:
|
|
5026
|
-
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()
|
|
5027
5243
|
})
|
|
5028
5244
|
])
|
|
5029
5245
|
).nullish()
|
|
5030
5246
|
}),
|
|
5031
|
-
|
|
5032
|
-
type:
|
|
5033
|
-
url:
|
|
5247
|
+
import_v420.z.object({
|
|
5248
|
+
type: import_v420.z.literal("open_page"),
|
|
5249
|
+
url: import_v420.z.string().nullish()
|
|
5034
5250
|
}),
|
|
5035
|
-
|
|
5036
|
-
type:
|
|
5037
|
-
url:
|
|
5038
|
-
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()
|
|
5039
5255
|
})
|
|
5040
5256
|
]).nullish()
|
|
5041
5257
|
}),
|
|
5042
|
-
|
|
5043
|
-
type:
|
|
5044
|
-
id:
|
|
5045
|
-
queries:
|
|
5046
|
-
results:
|
|
5047
|
-
|
|
5048
|
-
attributes:
|
|
5049
|
-
|
|
5050
|
-
|
|
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()])
|
|
5051
5267
|
),
|
|
5052
|
-
file_id:
|
|
5053
|
-
filename:
|
|
5054
|
-
score:
|
|
5055
|
-
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()
|
|
5056
5272
|
})
|
|
5057
5273
|
).nullish()
|
|
5058
5274
|
}),
|
|
5059
|
-
|
|
5060
|
-
type:
|
|
5061
|
-
id:
|
|
5062
|
-
code:
|
|
5063
|
-
container_id:
|
|
5064
|
-
outputs:
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
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() })
|
|
5068
5284
|
])
|
|
5069
5285
|
).nullable()
|
|
5070
5286
|
}),
|
|
5071
|
-
|
|
5072
|
-
type:
|
|
5073
|
-
id:
|
|
5074
|
-
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()
|
|
5075
5291
|
}),
|
|
5076
5292
|
openaiResponsesLocalShellCallSchema,
|
|
5077
|
-
|
|
5078
|
-
type:
|
|
5079
|
-
call_id:
|
|
5080
|
-
name:
|
|
5081
|
-
arguments:
|
|
5082
|
-
id:
|
|
5083
|
-
async:
|
|
5084
|
-
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()
|
|
5085
5301
|
}),
|
|
5086
|
-
|
|
5087
|
-
type:
|
|
5088
|
-
call_id:
|
|
5089
|
-
name:
|
|
5090
|
-
input:
|
|
5091
|
-
id:
|
|
5092
|
-
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()
|
|
5093
5309
|
}),
|
|
5094
|
-
|
|
5095
|
-
type:
|
|
5096
|
-
id:
|
|
5097
|
-
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()
|
|
5098
5314
|
}),
|
|
5099
|
-
|
|
5100
|
-
type:
|
|
5101
|
-
id:
|
|
5102
|
-
encrypted_content:
|
|
5103
|
-
summary:
|
|
5104
|
-
|
|
5105
|
-
type:
|
|
5106
|
-
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()
|
|
5107
5323
|
})
|
|
5108
5324
|
)
|
|
5109
5325
|
}),
|
|
5110
|
-
|
|
5111
|
-
type:
|
|
5112
|
-
id:
|
|
5113
|
-
status:
|
|
5114
|
-
arguments:
|
|
5115
|
-
name:
|
|
5116
|
-
server_label:
|
|
5117
|
-
output:
|
|
5118
|
-
error:
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
type:
|
|
5122
|
-
code:
|
|
5123
|
-
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()
|
|
5124
5340
|
}).loose()
|
|
5125
5341
|
]).nullish(),
|
|
5126
|
-
approval_request_id:
|
|
5342
|
+
approval_request_id: import_v420.z.string().nullish()
|
|
5127
5343
|
}),
|
|
5128
|
-
|
|
5129
|
-
type:
|
|
5130
|
-
id:
|
|
5131
|
-
server_label:
|
|
5132
|
-
tools:
|
|
5133
|
-
|
|
5134
|
-
name:
|
|
5135
|
-
description:
|
|
5136
|
-
input_schema:
|
|
5137
|
-
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()
|
|
5138
5354
|
})
|
|
5139
5355
|
),
|
|
5140
|
-
error:
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
type:
|
|
5144
|
-
code:
|
|
5145
|
-
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()
|
|
5146
5362
|
}).loose()
|
|
5147
5363
|
]).optional()
|
|
5148
5364
|
}),
|
|
5149
|
-
|
|
5150
|
-
type:
|
|
5151
|
-
id:
|
|
5152
|
-
server_label:
|
|
5153
|
-
name:
|
|
5154
|
-
arguments:
|
|
5155
|
-
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()
|
|
5156
5372
|
}),
|
|
5157
|
-
|
|
5158
|
-
type:
|
|
5159
|
-
id:
|
|
5160
|
-
call_id:
|
|
5161
|
-
status:
|
|
5162
|
-
operation:
|
|
5163
|
-
|
|
5164
|
-
type:
|
|
5165
|
-
path:
|
|
5166
|
-
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()
|
|
5167
5383
|
}),
|
|
5168
|
-
|
|
5169
|
-
type:
|
|
5170
|
-
path:
|
|
5384
|
+
import_v420.z.object({
|
|
5385
|
+
type: import_v420.z.literal("delete_file"),
|
|
5386
|
+
path: import_v420.z.string()
|
|
5171
5387
|
}),
|
|
5172
|
-
|
|
5173
|
-
type:
|
|
5174
|
-
path:
|
|
5175
|
-
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()
|
|
5176
5392
|
})
|
|
5177
5393
|
])
|
|
5178
5394
|
}),
|
|
5179
|
-
|
|
5180
|
-
type:
|
|
5181
|
-
id:
|
|
5182
|
-
call_id:
|
|
5183
|
-
status:
|
|
5184
|
-
action:
|
|
5185
|
-
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())
|
|
5186
5402
|
})
|
|
5187
5403
|
}),
|
|
5188
|
-
|
|
5189
|
-
type:
|
|
5190
|
-
id:
|
|
5191
|
-
call_id:
|
|
5192
|
-
status:
|
|
5193
|
-
output:
|
|
5194
|
-
|
|
5195
|
-
stdout:
|
|
5196
|
-
stderr:
|
|
5197
|
-
outcome:
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
type:
|
|
5201
|
-
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()
|
|
5202
5418
|
})
|
|
5203
5419
|
])
|
|
5204
5420
|
})
|
|
5205
5421
|
)
|
|
5206
5422
|
}),
|
|
5207
|
-
|
|
5208
|
-
type:
|
|
5209
|
-
id:
|
|
5210
|
-
execution:
|
|
5211
|
-
call_id:
|
|
5212
|
-
status:
|
|
5213
|
-
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()
|
|
5214
5430
|
}),
|
|
5215
|
-
|
|
5216
|
-
type:
|
|
5217
|
-
id:
|
|
5218
|
-
execution:
|
|
5219
|
-
call_id:
|
|
5220
|
-
status:
|
|
5221
|
-
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()))
|
|
5222
5438
|
})
|
|
5223
5439
|
])
|
|
5224
5440
|
).optional(),
|
|
5225
|
-
service_tier:
|
|
5226
|
-
reasoning:
|
|
5227
|
-
context:
|
|
5441
|
+
service_tier: import_v420.z.string().nullish(),
|
|
5442
|
+
reasoning: import_v420.z.object({
|
|
5443
|
+
context: import_v420.z.string().nullish()
|
|
5228
5444
|
}).nullish(),
|
|
5229
|
-
incomplete_details:
|
|
5445
|
+
incomplete_details: import_v420.z.object({ reason: import_v420.z.string() }).nullish(),
|
|
5230
5446
|
usage: openaiResponsesUsageSchema.nullish()
|
|
5231
5447
|
})
|
|
5232
5448
|
)
|
|
@@ -5237,41 +5453,41 @@ var import_provider9 = require("@ai-sdk/provider");
|
|
|
5237
5453
|
var import_provider_utils35 = require("@ai-sdk/provider-utils");
|
|
5238
5454
|
|
|
5239
5455
|
// src/tool/code-interpreter.ts
|
|
5240
|
-
var
|
|
5241
|
-
var
|
|
5242
|
-
var codeInterpreterInputSchema = (0,
|
|
5243
|
-
() => (0,
|
|
5244
|
-
|
|
5245
|
-
code:
|
|
5246
|
-
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()
|
|
5247
5463
|
})
|
|
5248
5464
|
)
|
|
5249
5465
|
);
|
|
5250
|
-
var codeInterpreterOutputSchema = (0,
|
|
5251
|
-
() => (0,
|
|
5252
|
-
|
|
5253
|
-
outputs:
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
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() })
|
|
5257
5473
|
])
|
|
5258
5474
|
).nullish()
|
|
5259
5475
|
})
|
|
5260
5476
|
)
|
|
5261
5477
|
);
|
|
5262
|
-
var codeInterpreterArgsSchema = (0,
|
|
5263
|
-
() => (0,
|
|
5264
|
-
|
|
5265
|
-
container:
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
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()
|
|
5269
5485
|
})
|
|
5270
5486
|
]).optional()
|
|
5271
5487
|
})
|
|
5272
5488
|
)
|
|
5273
5489
|
);
|
|
5274
|
-
var codeInterpreterToolFactory = (0,
|
|
5490
|
+
var codeInterpreterToolFactory = (0, import_provider_utils29.createProviderToolFactoryWithOutputSchema)({
|
|
5275
5491
|
id: "openai.code_interpreter",
|
|
5276
5492
|
inputSchema: codeInterpreterInputSchema,
|
|
5277
5493
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -5281,81 +5497,81 @@ var codeInterpreter = (args = {}) => {
|
|
|
5281
5497
|
};
|
|
5282
5498
|
|
|
5283
5499
|
// src/tool/file-search.ts
|
|
5284
|
-
var
|
|
5285
|
-
var
|
|
5286
|
-
var comparisonFilterSchema =
|
|
5287
|
-
key:
|
|
5288
|
-
type:
|
|
5289
|
-
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())])
|
|
5290
5506
|
});
|
|
5291
|
-
var compoundFilterSchema =
|
|
5292
|
-
type:
|
|
5293
|
-
filters:
|
|
5294
|
-
|
|
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)])
|
|
5295
5511
|
)
|
|
5296
5512
|
});
|
|
5297
|
-
var fileSearchArgsSchema = (0,
|
|
5298
|
-
() => (0,
|
|
5299
|
-
|
|
5300
|
-
vectorStoreIds:
|
|
5301
|
-
maxNumResults:
|
|
5302
|
-
ranking:
|
|
5303
|
-
ranker:
|
|
5304
|
-
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()
|
|
5305
5521
|
}).optional(),
|
|
5306
|
-
filters:
|
|
5522
|
+
filters: import_v422.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
5307
5523
|
})
|
|
5308
5524
|
)
|
|
5309
5525
|
);
|
|
5310
|
-
var fileSearchOutputSchema = (0,
|
|
5311
|
-
() => (0,
|
|
5312
|
-
|
|
5313
|
-
queries:
|
|
5314
|
-
results:
|
|
5315
|
-
|
|
5316
|
-
attributes:
|
|
5317
|
-
fileId:
|
|
5318
|
-
filename:
|
|
5319
|
-
score:
|
|
5320
|
-
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()
|
|
5321
5537
|
})
|
|
5322
5538
|
).nullable()
|
|
5323
5539
|
})
|
|
5324
5540
|
)
|
|
5325
5541
|
);
|
|
5326
|
-
var fileSearch = (0,
|
|
5542
|
+
var fileSearch = (0, import_provider_utils30.createProviderToolFactoryWithOutputSchema)({
|
|
5327
5543
|
id: "openai.file_search",
|
|
5328
|
-
inputSchema:
|
|
5544
|
+
inputSchema: import_v422.z.object({}),
|
|
5329
5545
|
outputSchema: fileSearchOutputSchema
|
|
5330
5546
|
});
|
|
5331
5547
|
|
|
5332
5548
|
// src/tool/image-generation.ts
|
|
5333
|
-
var
|
|
5334
|
-
var
|
|
5335
|
-
var imageGenerationArgsSchema = (0,
|
|
5336
|
-
() => (0,
|
|
5337
|
-
|
|
5338
|
-
background:
|
|
5339
|
-
inputFidelity:
|
|
5340
|
-
inputImageMask:
|
|
5341
|
-
fileId:
|
|
5342
|
-
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()
|
|
5343
5559
|
}).optional(),
|
|
5344
|
-
model:
|
|
5345
|
-
moderation:
|
|
5346
|
-
outputCompression:
|
|
5347
|
-
outputFormat:
|
|
5348
|
-
partialImages:
|
|
5349
|
-
quality:
|
|
5350
|
-
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()
|
|
5351
5567
|
}).strict()
|
|
5352
5568
|
)
|
|
5353
5569
|
);
|
|
5354
|
-
var imageGenerationInputSchema = (0,
|
|
5355
|
-
var imageGenerationOutputSchema = (0,
|
|
5356
|
-
() => (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() }))
|
|
5357
5573
|
);
|
|
5358
|
-
var imageGenerationToolFactory = (0,
|
|
5574
|
+
var imageGenerationToolFactory = (0, import_provider_utils31.createProviderToolFactoryWithOutputSchema)({
|
|
5359
5575
|
id: "openai.image_generation",
|
|
5360
5576
|
inputSchema: imageGenerationInputSchema,
|
|
5361
5577
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -5365,153 +5581,95 @@ var imageGeneration = (args = {}) => {
|
|
|
5365
5581
|
};
|
|
5366
5582
|
|
|
5367
5583
|
// src/tool/custom.ts
|
|
5368
|
-
var
|
|
5369
|
-
var
|
|
5370
|
-
var customArgsSchema = (0,
|
|
5371
|
-
() => (0,
|
|
5372
|
-
|
|
5373
|
-
name:
|
|
5374
|
-
description:
|
|
5375
|
-
async:
|
|
5376
|
-
format:
|
|
5377
|
-
|
|
5378
|
-
type:
|
|
5379
|
-
syntax:
|
|
5380
|
-
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()
|
|
5381
5597
|
}),
|
|
5382
|
-
|
|
5383
|
-
type:
|
|
5598
|
+
import_v424.z.object({
|
|
5599
|
+
type: import_v424.z.literal("text")
|
|
5384
5600
|
})
|
|
5385
5601
|
]).optional()
|
|
5386
5602
|
})
|
|
5387
5603
|
)
|
|
5388
5604
|
);
|
|
5389
|
-
var customInputSchema = (0,
|
|
5390
|
-
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)({
|
|
5391
5607
|
id: "openai.custom",
|
|
5392
5608
|
inputSchema: customInputSchema
|
|
5393
5609
|
});
|
|
5394
5610
|
|
|
5395
5611
|
// src/tool/mcp.ts
|
|
5396
|
-
var
|
|
5397
|
-
var
|
|
5398
|
-
var jsonValueSchema2 =
|
|
5399
|
-
() =>
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
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)
|
|
5406
5622
|
])
|
|
5407
5623
|
);
|
|
5408
|
-
var mcpArgsSchema = (0,
|
|
5409
|
-
() => (0,
|
|
5410
|
-
|
|
5411
|
-
serverLabel:
|
|
5412
|
-
allowedTools:
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
readOnly:
|
|
5416
|
-
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()
|
|
5417
5633
|
})
|
|
5418
5634
|
]).optional(),
|
|
5419
|
-
authorization:
|
|
5420
|
-
connectorId:
|
|
5421
|
-
headers:
|
|
5422
|
-
requireApproval:
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
never:
|
|
5426
|
-
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()
|
|
5427
5643
|
}).optional()
|
|
5428
5644
|
})
|
|
5429
5645
|
]).optional(),
|
|
5430
|
-
serverDescription:
|
|
5431
|
-
serverUrl:
|
|
5646
|
+
serverDescription: import_v425.z.string().optional(),
|
|
5647
|
+
serverUrl: import_v425.z.string().optional()
|
|
5432
5648
|
}).refine(
|
|
5433
5649
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
5434
5650
|
"One of serverUrl or connectorId must be provided."
|
|
5435
5651
|
)
|
|
5436
5652
|
)
|
|
5437
5653
|
);
|
|
5438
|
-
var mcpInputSchema = (0,
|
|
5439
|
-
var mcpOutputSchema = (0,
|
|
5440
|
-
() => (0,
|
|
5441
|
-
|
|
5442
|
-
type:
|
|
5443
|
-
serverLabel:
|
|
5444
|
-
name:
|
|
5445
|
-
arguments:
|
|
5446
|
-
output:
|
|
5447
|
-
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()
|
|
5448
5664
|
})
|
|
5449
5665
|
)
|
|
5450
5666
|
);
|
|
5451
|
-
var mcpToolFactory = (0,
|
|
5667
|
+
var mcpToolFactory = (0, import_provider_utils33.createProviderToolFactoryWithOutputSchema)({
|
|
5452
5668
|
id: "openai.mcp",
|
|
5453
5669
|
inputSchema: mcpInputSchema,
|
|
5454
5670
|
outputSchema: mcpOutputSchema
|
|
5455
5671
|
});
|
|
5456
5672
|
|
|
5457
|
-
// src/tool/web-search.ts
|
|
5458
|
-
var import_provider_utils33 = require("@ai-sdk/provider-utils");
|
|
5459
|
-
var import_v425 = require("zod/v4");
|
|
5460
|
-
var webSearchArgsSchema = (0, import_provider_utils33.lazySchema)(
|
|
5461
|
-
() => (0, import_provider_utils33.zodSchema)(
|
|
5462
|
-
import_v425.z.object({
|
|
5463
|
-
externalWebAccess: import_v425.z.boolean().optional(),
|
|
5464
|
-
filters: import_v425.z.object({
|
|
5465
|
-
allowedDomains: import_v425.z.array(import_v425.z.string()).optional(),
|
|
5466
|
-
blockedDomains: import_v425.z.array(import_v425.z.string()).optional()
|
|
5467
|
-
}).optional(),
|
|
5468
|
-
searchContextSize: import_v425.z.enum(["low", "medium", "high"]).optional(),
|
|
5469
|
-
userLocation: import_v425.z.object({
|
|
5470
|
-
type: import_v425.z.literal("approximate"),
|
|
5471
|
-
country: import_v425.z.string().optional(),
|
|
5472
|
-
city: import_v425.z.string().optional(),
|
|
5473
|
-
region: import_v425.z.string().optional(),
|
|
5474
|
-
timezone: import_v425.z.string().optional()
|
|
5475
|
-
}).optional()
|
|
5476
|
-
})
|
|
5477
|
-
)
|
|
5478
|
-
);
|
|
5479
|
-
var webSearchInputSchema = (0, import_provider_utils33.lazySchema)(() => (0, import_provider_utils33.zodSchema)(import_v425.z.object({})));
|
|
5480
|
-
var webSearchOutputSchema = (0, import_provider_utils33.lazySchema)(
|
|
5481
|
-
() => (0, import_provider_utils33.zodSchema)(
|
|
5482
|
-
import_v425.z.object({
|
|
5483
|
-
action: import_v425.z.discriminatedUnion("type", [
|
|
5484
|
-
import_v425.z.object({
|
|
5485
|
-
type: import_v425.z.literal("search"),
|
|
5486
|
-
query: import_v425.z.string().optional(),
|
|
5487
|
-
queries: import_v425.z.array(import_v425.z.string()).optional()
|
|
5488
|
-
}),
|
|
5489
|
-
import_v425.z.object({
|
|
5490
|
-
type: import_v425.z.literal("openPage"),
|
|
5491
|
-
url: import_v425.z.string().nullish()
|
|
5492
|
-
}),
|
|
5493
|
-
import_v425.z.object({
|
|
5494
|
-
type: import_v425.z.literal("findInPage"),
|
|
5495
|
-
url: import_v425.z.string().nullish(),
|
|
5496
|
-
pattern: import_v425.z.string().nullish()
|
|
5497
|
-
})
|
|
5498
|
-
]).optional(),
|
|
5499
|
-
sources: import_v425.z.array(
|
|
5500
|
-
import_v425.z.discriminatedUnion("type", [
|
|
5501
|
-
import_v425.z.object({ type: import_v425.z.literal("url"), url: import_v425.z.string() }),
|
|
5502
|
-
import_v425.z.object({ type: import_v425.z.literal("api"), name: import_v425.z.string() })
|
|
5503
|
-
])
|
|
5504
|
-
).optional()
|
|
5505
|
-
})
|
|
5506
|
-
)
|
|
5507
|
-
);
|
|
5508
|
-
var webSearchToolFactory = (0, import_provider_utils33.createProviderToolFactoryWithOutputSchema)({
|
|
5509
|
-
id: "openai.web_search",
|
|
5510
|
-
inputSchema: webSearchInputSchema,
|
|
5511
|
-
outputSchema: webSearchOutputSchema
|
|
5512
|
-
});
|
|
5513
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
5514
|
-
|
|
5515
5673
|
// src/tool/web-search-preview.ts
|
|
5516
5674
|
var import_provider_utils34 = require("@ai-sdk/provider-utils");
|
|
5517
5675
|
var import_v426 = require("zod/v4");
|
|
@@ -6267,7 +6425,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6267
6425
|
strict: strictJsonSchema,
|
|
6268
6426
|
name: (_h = responseFormat.name) != null ? _h : "response",
|
|
6269
6427
|
description: responseFormat.description,
|
|
6270
|
-
schema: responseFormat.schema
|
|
6428
|
+
schema: normalizeOpenAIJsonSchema(responseFormat.schema)
|
|
6271
6429
|
} : { type: "json_object" }
|
|
6272
6430
|
},
|
|
6273
6431
|
...(openaiOptions == null ? void 0 : openaiOptions.textVerbosity) && {
|