@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.mjs
CHANGED
|
@@ -72,6 +72,98 @@ function getGptVersion(modelId) {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
// src/normalize-openai-json-schema.ts
|
|
76
|
+
function normalizeOpenAIJsonSchema(schema) {
|
|
77
|
+
const normalizedSchema = normalizeSchema(schema, true);
|
|
78
|
+
const reference = getSingletonReference(normalizedSchema);
|
|
79
|
+
if (reference == null) {
|
|
80
|
+
return normalizedSchema;
|
|
81
|
+
}
|
|
82
|
+
const { allOf: _allOf, ...schemaWithoutAllOf } = normalizedSchema;
|
|
83
|
+
const referencedSchema = getLocalReferenceSchema(reference, normalizedSchema);
|
|
84
|
+
return typeof referencedSchema !== "object" || referencedSchema == null ? normalizedSchema : { ...referencedSchema, ...schemaWithoutAllOf };
|
|
85
|
+
function normalizeSchema(schema2, isRoot = false) {
|
|
86
|
+
if (typeof schema2 !== "object" || schema2 == null) {
|
|
87
|
+
return schema2;
|
|
88
|
+
}
|
|
89
|
+
const normalizedSchema2 = { ...schema2 };
|
|
90
|
+
if (normalizedSchema2.properties != null) {
|
|
91
|
+
normalizedSchema2.properties = normalizeSchemaRecord(
|
|
92
|
+
normalizedSchema2.properties
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (normalizedSchema2.patternProperties != null) {
|
|
96
|
+
normalizedSchema2.patternProperties = normalizeSchemaRecord(
|
|
97
|
+
normalizedSchema2.patternProperties
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
if (normalizedSchema2.definitions != null) {
|
|
101
|
+
normalizedSchema2.definitions = normalizeSchemaRecord(
|
|
102
|
+
normalizedSchema2.definitions
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
if (normalizedSchema2.$defs != null) {
|
|
106
|
+
normalizedSchema2.$defs = normalizeSchemaRecord(normalizedSchema2.$defs);
|
|
107
|
+
}
|
|
108
|
+
if (normalizedSchema2.items != null) {
|
|
109
|
+
normalizedSchema2.items = Array.isArray(normalizedSchema2.items) ? normalizedSchema2.items.map((item) => normalizeSchema(item)) : normalizeSchema(normalizedSchema2.items);
|
|
110
|
+
}
|
|
111
|
+
if (normalizedSchema2.allOf != null) {
|
|
112
|
+
normalizedSchema2.allOf = normalizedSchema2.allOf.map(
|
|
113
|
+
(item) => normalizeSchema(item)
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
if (normalizedSchema2.anyOf != null) {
|
|
117
|
+
normalizedSchema2.anyOf = normalizedSchema2.anyOf.map(
|
|
118
|
+
(item) => normalizeSchema(item)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
if (normalizedSchema2.oneOf != null) {
|
|
122
|
+
normalizedSchema2.oneOf = normalizedSchema2.oneOf.map(
|
|
123
|
+
(item) => normalizeSchema(item)
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
if (typeof normalizedSchema2.additionalProperties === "object" && normalizedSchema2.additionalProperties != null) {
|
|
127
|
+
normalizedSchema2.additionalProperties = normalizeSchema(
|
|
128
|
+
normalizedSchema2.additionalProperties
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
const reference2 = getSingletonReference(normalizedSchema2);
|
|
132
|
+
if (reference2 == null || isRoot) {
|
|
133
|
+
return normalizedSchema2;
|
|
134
|
+
}
|
|
135
|
+
const { allOf: _allOf2, ...schemaWithoutAllOf2 } = normalizedSchema2;
|
|
136
|
+
return { ...schemaWithoutAllOf2, $ref: reference2 };
|
|
137
|
+
}
|
|
138
|
+
function normalizeSchemaRecord(record) {
|
|
139
|
+
return Object.fromEntries(
|
|
140
|
+
Object.entries(record).map(([key, value]) => [
|
|
141
|
+
key,
|
|
142
|
+
normalizeSchema(value)
|
|
143
|
+
])
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
function getSingletonReference(schema2) {
|
|
147
|
+
var _a2;
|
|
148
|
+
if (((_a2 = schema2.allOf) == null ? void 0 : _a2.length) !== 1) {
|
|
149
|
+
return void 0;
|
|
150
|
+
}
|
|
151
|
+
const [allOfSchema] = schema2.allOf;
|
|
152
|
+
return typeof allOfSchema === "object" && allOfSchema != null && Object.keys(allOfSchema).length === 1 && typeof allOfSchema.$ref === "string" ? allOfSchema.$ref : void 0;
|
|
153
|
+
}
|
|
154
|
+
function getLocalReferenceSchema(reference2, schema2) {
|
|
155
|
+
var _a2, _b;
|
|
156
|
+
const match = /^#\/(definitions|\$defs)\/(.+)$/.exec(reference2);
|
|
157
|
+
if (match == null) {
|
|
158
|
+
return void 0;
|
|
159
|
+
}
|
|
160
|
+
const [, keyword, encodedName] = match;
|
|
161
|
+
const name = encodedName.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
162
|
+
const definition = keyword === "definitions" ? (_a2 = schema2.definitions) == null ? void 0 : _a2[name] : (_b = schema2.$defs) == null ? void 0 : _b[name];
|
|
163
|
+
return definition;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
75
167
|
// src/openai-stream-error.ts
|
|
76
168
|
import { APICallError } from "@ai-sdk/provider";
|
|
77
169
|
function createOpenAIProviderStreamError(frame) {
|
|
@@ -976,7 +1068,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
976
1068
|
response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? responseFormat.schema != null ? {
|
|
977
1069
|
type: "json_schema",
|
|
978
1070
|
json_schema: {
|
|
979
|
-
schema: responseFormat.schema,
|
|
1071
|
+
schema: normalizeOpenAIJsonSchema(responseFormat.schema),
|
|
980
1072
|
strict: strictJsonSchema,
|
|
981
1073
|
name: (_e = responseFormat.name) != null ? _e : "response",
|
|
982
1074
|
description: responseFormat.description
|
|
@@ -2752,9 +2844,10 @@ import {
|
|
|
2752
2844
|
isNonNullable,
|
|
2753
2845
|
parseJSON,
|
|
2754
2846
|
parseProviderOptions as parseProviderOptions7,
|
|
2847
|
+
safeValidateTypes,
|
|
2755
2848
|
validateTypes
|
|
2756
2849
|
} from "@ai-sdk/provider-utils";
|
|
2757
|
-
import { z as
|
|
2850
|
+
import { z as z19 } from "zod/v4";
|
|
2758
2851
|
|
|
2759
2852
|
// src/responses/openai-responses-options.ts
|
|
2760
2853
|
import {
|
|
@@ -3273,6 +3366,68 @@ var toolSearchToolFactory = createProviderToolFactoryWithOutputSchema4({
|
|
|
3273
3366
|
outputSchema: toolSearchOutputSchema
|
|
3274
3367
|
});
|
|
3275
3368
|
|
|
3369
|
+
// src/tool/web-search.ts
|
|
3370
|
+
import {
|
|
3371
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
3372
|
+
lazySchema as lazySchema17,
|
|
3373
|
+
zodSchema as zodSchema17
|
|
3374
|
+
} from "@ai-sdk/provider-utils";
|
|
3375
|
+
import { z as z18 } from "zod/v4";
|
|
3376
|
+
var webSearchArgsSchema = lazySchema17(
|
|
3377
|
+
() => zodSchema17(
|
|
3378
|
+
z18.object({
|
|
3379
|
+
externalWebAccess: z18.boolean().optional(),
|
|
3380
|
+
filters: z18.object({
|
|
3381
|
+
allowedDomains: z18.array(z18.string()).optional(),
|
|
3382
|
+
blockedDomains: z18.array(z18.string()).optional()
|
|
3383
|
+
}).optional(),
|
|
3384
|
+
searchContextSize: z18.enum(["low", "medium", "high"]).optional(),
|
|
3385
|
+
userLocation: z18.object({
|
|
3386
|
+
type: z18.literal("approximate"),
|
|
3387
|
+
country: z18.string().optional(),
|
|
3388
|
+
city: z18.string().optional(),
|
|
3389
|
+
region: z18.string().optional(),
|
|
3390
|
+
timezone: z18.string().optional()
|
|
3391
|
+
}).optional()
|
|
3392
|
+
})
|
|
3393
|
+
)
|
|
3394
|
+
);
|
|
3395
|
+
var webSearchInputSchema = lazySchema17(() => zodSchema17(z18.object({})));
|
|
3396
|
+
var webSearchOutputSchema = lazySchema17(
|
|
3397
|
+
() => zodSchema17(
|
|
3398
|
+
z18.object({
|
|
3399
|
+
action: z18.discriminatedUnion("type", [
|
|
3400
|
+
z18.object({
|
|
3401
|
+
type: z18.literal("search"),
|
|
3402
|
+
query: z18.string().optional(),
|
|
3403
|
+
queries: z18.array(z18.string()).optional()
|
|
3404
|
+
}),
|
|
3405
|
+
z18.object({
|
|
3406
|
+
type: z18.literal("openPage"),
|
|
3407
|
+
url: z18.string().nullish()
|
|
3408
|
+
}),
|
|
3409
|
+
z18.object({
|
|
3410
|
+
type: z18.literal("findInPage"),
|
|
3411
|
+
url: z18.string().nullish(),
|
|
3412
|
+
pattern: z18.string().nullish()
|
|
3413
|
+
})
|
|
3414
|
+
]).optional(),
|
|
3415
|
+
sources: z18.array(
|
|
3416
|
+
z18.discriminatedUnion("type", [
|
|
3417
|
+
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
3418
|
+
z18.object({ type: z18.literal("api"), name: z18.string() })
|
|
3419
|
+
])
|
|
3420
|
+
).optional()
|
|
3421
|
+
})
|
|
3422
|
+
)
|
|
3423
|
+
);
|
|
3424
|
+
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema5({
|
|
3425
|
+
id: "openai.web_search",
|
|
3426
|
+
inputSchema: webSearchInputSchema,
|
|
3427
|
+
outputSchema: webSearchOutputSchema
|
|
3428
|
+
});
|
|
3429
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
3430
|
+
|
|
3276
3431
|
// src/responses/expand-parallel-tool-call.ts
|
|
3277
3432
|
import {
|
|
3278
3433
|
isJSONObject
|
|
@@ -3355,6 +3510,57 @@ async function expandParallelToolCall({
|
|
|
3355
3510
|
function serializeToolCallArguments2(input) {
|
|
3356
3511
|
return JSON.stringify(input === void 0 ? {} : input);
|
|
3357
3512
|
}
|
|
3513
|
+
async function convertWebSearchToolResultOutput({
|
|
3514
|
+
output,
|
|
3515
|
+
id
|
|
3516
|
+
}) {
|
|
3517
|
+
if (output.type !== "json") {
|
|
3518
|
+
return void 0;
|
|
3519
|
+
}
|
|
3520
|
+
const validation = await safeValidateTypes({
|
|
3521
|
+
value: output.value,
|
|
3522
|
+
schema: webSearchOutputSchema
|
|
3523
|
+
});
|
|
3524
|
+
if (!validation.success || validation.value.action == null) {
|
|
3525
|
+
return void 0;
|
|
3526
|
+
}
|
|
3527
|
+
const { action, sources } = validation.value;
|
|
3528
|
+
switch (action.type) {
|
|
3529
|
+
case "search":
|
|
3530
|
+
return {
|
|
3531
|
+
type: "web_search_call",
|
|
3532
|
+
id,
|
|
3533
|
+
status: "completed",
|
|
3534
|
+
action: {
|
|
3535
|
+
type: "search",
|
|
3536
|
+
...action.query != null && { query: action.query },
|
|
3537
|
+
...action.queries != null && { queries: action.queries },
|
|
3538
|
+
...sources != null && { sources }
|
|
3539
|
+
}
|
|
3540
|
+
};
|
|
3541
|
+
case "openPage":
|
|
3542
|
+
return {
|
|
3543
|
+
type: "web_search_call",
|
|
3544
|
+
id,
|
|
3545
|
+
status: "completed",
|
|
3546
|
+
action: {
|
|
3547
|
+
type: "open_page",
|
|
3548
|
+
url: action.url
|
|
3549
|
+
}
|
|
3550
|
+
};
|
|
3551
|
+
case "findInPage":
|
|
3552
|
+
return {
|
|
3553
|
+
type: "web_search_call",
|
|
3554
|
+
id,
|
|
3555
|
+
status: "completed",
|
|
3556
|
+
action: {
|
|
3557
|
+
type: "find_in_page",
|
|
3558
|
+
url: action.url,
|
|
3559
|
+
pattern: action.pattern
|
|
3560
|
+
}
|
|
3561
|
+
};
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3358
3564
|
async function convertFunctionToolResultOutput({
|
|
3359
3565
|
output,
|
|
3360
3566
|
promptCacheBreakpoint,
|
|
@@ -3561,7 +3767,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3561
3767
|
toolSearchToolName,
|
|
3562
3768
|
customProviderToolNames
|
|
3563
3769
|
}) {
|
|
3564
|
-
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;
|
|
3770
|
+
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;
|
|
3565
3771
|
let input = [];
|
|
3566
3772
|
const warnings = [];
|
|
3567
3773
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -3907,8 +4113,23 @@ async function convertToOpenAIResponsesInput({
|
|
|
3907
4113
|
const resolvedResultToolName = toolNameMapping.toProviderToolName(
|
|
3908
4114
|
part.toolName
|
|
3909
4115
|
);
|
|
4116
|
+
if (resolvedResultToolName === "web_search" || resolvedResultToolName === "web_search_preview") {
|
|
4117
|
+
const itemId = (_u = (_t = (_s = part.providerOptions) == null ? void 0 : _s[providerOptionsName]) == null ? void 0 : _t.itemId) != null ? _u : part.toolCallId;
|
|
4118
|
+
if (store) {
|
|
4119
|
+
input.push({ type: "item_reference", id: itemId });
|
|
4120
|
+
break;
|
|
4121
|
+
}
|
|
4122
|
+
const webSearchCall = await convertWebSearchToolResultOutput({
|
|
4123
|
+
output: part.output,
|
|
4124
|
+
id: itemId
|
|
4125
|
+
});
|
|
4126
|
+
if (webSearchCall != null) {
|
|
4127
|
+
input.push(webSearchCall);
|
|
4128
|
+
break;
|
|
4129
|
+
}
|
|
4130
|
+
}
|
|
3910
4131
|
if (part.toolName === toolSearchToolName) {
|
|
3911
|
-
const itemId = (
|
|
4132
|
+
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;
|
|
3912
4133
|
if (store) {
|
|
3913
4134
|
input.push({ type: "item_reference", id: itemId });
|
|
3914
4135
|
} else if (part.output.type === "json") {
|
|
@@ -3949,7 +4170,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3949
4170
|
break;
|
|
3950
4171
|
}
|
|
3951
4172
|
if (store) {
|
|
3952
|
-
const itemId = (
|
|
4173
|
+
const itemId = (_D = (_C = (_B = part.providerOptions) == null ? void 0 : _B[providerOptionsName]) == null ? void 0 : _C.itemId) != null ? _D : part.toolCallId;
|
|
3953
4174
|
input.push({ type: "item_reference", id: itemId });
|
|
3954
4175
|
} else {
|
|
3955
4176
|
warnings.push({
|
|
@@ -4116,7 +4337,7 @@ ${text}`,
|
|
|
4116
4337
|
}
|
|
4117
4338
|
const output = part.output;
|
|
4118
4339
|
if (output.type === "execution-denied") {
|
|
4119
|
-
const approvalId = (
|
|
4340
|
+
const approvalId = (_F = (_E = output.providerOptions) == null ? void 0 : _E.openai) == null ? void 0 : _F.approvalId;
|
|
4120
4341
|
if (approvalId) {
|
|
4121
4342
|
continue;
|
|
4122
4343
|
}
|
|
@@ -4203,7 +4424,7 @@ ${text}`,
|
|
|
4203
4424
|
break;
|
|
4204
4425
|
case "execution-denied":
|
|
4205
4426
|
outputValue = convertScalarOutput(
|
|
4206
|
-
(
|
|
4427
|
+
(_G = output.reason) != null ? _G : "Tool call execution denied."
|
|
4207
4428
|
);
|
|
4208
4429
|
break;
|
|
4209
4430
|
case "json":
|
|
@@ -4317,9 +4538,9 @@ ${text}`,
|
|
|
4317
4538
|
}
|
|
4318
4539
|
return { input, warnings };
|
|
4319
4540
|
}
|
|
4320
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4321
|
-
itemId:
|
|
4322
|
-
reasoningEncryptedContent:
|
|
4541
|
+
var openaiResponsesReasoningProviderOptionsSchema = z19.object({
|
|
4542
|
+
itemId: z19.string().nullish(),
|
|
4543
|
+
reasoningEncryptedContent: z19.string().nullish()
|
|
4323
4544
|
});
|
|
4324
4545
|
|
|
4325
4546
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -4342,77 +4563,77 @@ function mapOpenAIResponseFinishReason({
|
|
|
4342
4563
|
|
|
4343
4564
|
// src/responses/openai-responses-api.ts
|
|
4344
4565
|
import {
|
|
4345
|
-
lazySchema as
|
|
4346
|
-
zodSchema as
|
|
4566
|
+
lazySchema as lazySchema18,
|
|
4567
|
+
zodSchema as zodSchema18
|
|
4347
4568
|
} from "@ai-sdk/provider-utils";
|
|
4348
|
-
import { z as
|
|
4349
|
-
var jsonValueSchema =
|
|
4350
|
-
() =>
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4569
|
+
import { z as z20 } from "zod/v4";
|
|
4570
|
+
var jsonValueSchema = z20.lazy(
|
|
4571
|
+
() => z20.union([
|
|
4572
|
+
z20.string(),
|
|
4573
|
+
z20.number(),
|
|
4574
|
+
z20.boolean(),
|
|
4575
|
+
z20.null(),
|
|
4576
|
+
z20.array(jsonValueSchema),
|
|
4577
|
+
z20.record(z20.string(), jsonValueSchema.optional())
|
|
4357
4578
|
])
|
|
4358
4579
|
);
|
|
4359
|
-
var jsonObjectSchema =
|
|
4360
|
-
var openaiResponsesUsageSchema =
|
|
4580
|
+
var jsonObjectSchema = z20.record(z20.string(), jsonValueSchema.optional());
|
|
4581
|
+
var openaiResponsesUsageSchema = z20.intersection(
|
|
4361
4582
|
jsonObjectSchema,
|
|
4362
|
-
|
|
4363
|
-
input_tokens:
|
|
4364
|
-
input_tokens_details:
|
|
4583
|
+
z20.object({
|
|
4584
|
+
input_tokens: z20.number(),
|
|
4585
|
+
input_tokens_details: z20.intersection(
|
|
4365
4586
|
jsonObjectSchema,
|
|
4366
|
-
|
|
4367
|
-
cached_tokens:
|
|
4368
|
-
cache_write_tokens:
|
|
4369
|
-
orchestration_input_tokens:
|
|
4370
|
-
orchestration_input_cached_tokens:
|
|
4587
|
+
z20.object({
|
|
4588
|
+
cached_tokens: z20.number().nullish(),
|
|
4589
|
+
cache_write_tokens: z20.number().nullish(),
|
|
4590
|
+
orchestration_input_tokens: z20.number().nullish(),
|
|
4591
|
+
orchestration_input_cached_tokens: z20.number().nullish()
|
|
4371
4592
|
})
|
|
4372
4593
|
).nullish(),
|
|
4373
|
-
output_tokens:
|
|
4374
|
-
output_tokens_details:
|
|
4594
|
+
output_tokens: z20.number(),
|
|
4595
|
+
output_tokens_details: z20.intersection(
|
|
4375
4596
|
jsonObjectSchema,
|
|
4376
|
-
|
|
4377
|
-
reasoning_tokens:
|
|
4378
|
-
orchestration_output_tokens:
|
|
4597
|
+
z20.object({
|
|
4598
|
+
reasoning_tokens: z20.number().nullish(),
|
|
4599
|
+
orchestration_output_tokens: z20.number().nullish()
|
|
4379
4600
|
})
|
|
4380
4601
|
).nullish(),
|
|
4381
|
-
total_tokens:
|
|
4602
|
+
total_tokens: z20.number().optional()
|
|
4382
4603
|
})
|
|
4383
4604
|
);
|
|
4384
4605
|
function isRecord(value) {
|
|
4385
4606
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
4386
4607
|
}
|
|
4387
|
-
var openaiResponsesLocalShellCallSchema =
|
|
4388
|
-
type:
|
|
4389
|
-
id:
|
|
4390
|
-
call_id:
|
|
4391
|
-
action:
|
|
4392
|
-
type:
|
|
4393
|
-
command:
|
|
4394
|
-
timeout_ms:
|
|
4395
|
-
user:
|
|
4396
|
-
working_directory:
|
|
4397
|
-
env:
|
|
4608
|
+
var openaiResponsesLocalShellCallSchema = z20.object({
|
|
4609
|
+
type: z20.literal("local_shell_call"),
|
|
4610
|
+
id: z20.string(),
|
|
4611
|
+
call_id: z20.string(),
|
|
4612
|
+
action: z20.object({
|
|
4613
|
+
type: z20.literal("exec"),
|
|
4614
|
+
command: z20.array(z20.string()),
|
|
4615
|
+
timeout_ms: z20.number().optional(),
|
|
4616
|
+
user: z20.string().optional(),
|
|
4617
|
+
working_directory: z20.string().optional(),
|
|
4618
|
+
env: z20.record(z20.string(), z20.string()).optional()
|
|
4398
4619
|
})
|
|
4399
4620
|
});
|
|
4400
|
-
var openaiResponsesNestedErrorChunkSchema =
|
|
4401
|
-
type:
|
|
4402
|
-
sequence_number:
|
|
4403
|
-
error:
|
|
4404
|
-
type:
|
|
4405
|
-
code:
|
|
4406
|
-
message:
|
|
4407
|
-
param:
|
|
4621
|
+
var openaiResponsesNestedErrorChunkSchema = z20.object({
|
|
4622
|
+
type: z20.literal("error"),
|
|
4623
|
+
sequence_number: z20.number(),
|
|
4624
|
+
error: z20.object({
|
|
4625
|
+
type: z20.string(),
|
|
4626
|
+
code: z20.string().nullish(),
|
|
4627
|
+
message: z20.string(),
|
|
4628
|
+
param: z20.string().nullish()
|
|
4408
4629
|
})
|
|
4409
4630
|
});
|
|
4410
|
-
var openaiResponsesErrorChunkSchema =
|
|
4411
|
-
type:
|
|
4412
|
-
sequence_number:
|
|
4413
|
-
code:
|
|
4414
|
-
message:
|
|
4415
|
-
param:
|
|
4631
|
+
var openaiResponsesErrorChunkSchema = z20.object({
|
|
4632
|
+
type: z20.literal("error"),
|
|
4633
|
+
sequence_number: z20.number(),
|
|
4634
|
+
code: z20.string().nullish(),
|
|
4635
|
+
message: z20.string(),
|
|
4636
|
+
param: z20.string().nullish()
|
|
4416
4637
|
});
|
|
4417
4638
|
var openaiResponsesModeledChunkTypes = /* @__PURE__ */ new Set([
|
|
4418
4639
|
"error",
|
|
@@ -4468,523 +4689,523 @@ function isModeledOpenAIResponsesChunk(value) {
|
|
|
4468
4689
|
}
|
|
4469
4690
|
return openaiResponsesModeledOutputItemTypes.has(value.item.type);
|
|
4470
4691
|
}
|
|
4471
|
-
var openaiResponsesChunkSchema =
|
|
4472
|
-
() =>
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
type:
|
|
4476
|
-
item_id:
|
|
4477
|
-
delta:
|
|
4478
|
-
logprobs:
|
|
4479
|
-
|
|
4480
|
-
token:
|
|
4481
|
-
logprob:
|
|
4482
|
-
top_logprobs:
|
|
4483
|
-
|
|
4484
|
-
token:
|
|
4485
|
-
logprob:
|
|
4692
|
+
var openaiResponsesChunkSchema = lazySchema18(
|
|
4693
|
+
() => zodSchema18(
|
|
4694
|
+
z20.union([
|
|
4695
|
+
z20.object({
|
|
4696
|
+
type: z20.literal("response.output_text.delta"),
|
|
4697
|
+
item_id: z20.string(),
|
|
4698
|
+
delta: z20.string(),
|
|
4699
|
+
logprobs: z20.array(
|
|
4700
|
+
z20.object({
|
|
4701
|
+
token: z20.string(),
|
|
4702
|
+
logprob: z20.number(),
|
|
4703
|
+
top_logprobs: z20.array(
|
|
4704
|
+
z20.object({
|
|
4705
|
+
token: z20.string(),
|
|
4706
|
+
logprob: z20.number()
|
|
4486
4707
|
})
|
|
4487
4708
|
)
|
|
4488
4709
|
})
|
|
4489
4710
|
).nullish()
|
|
4490
4711
|
}),
|
|
4491
|
-
|
|
4492
|
-
type:
|
|
4493
|
-
response:
|
|
4494
|
-
incomplete_details:
|
|
4712
|
+
z20.object({
|
|
4713
|
+
type: z20.enum(["response.completed", "response.incomplete"]),
|
|
4714
|
+
response: z20.object({
|
|
4715
|
+
incomplete_details: z20.object({ reason: z20.string() }).nullish(),
|
|
4495
4716
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4496
|
-
reasoning:
|
|
4497
|
-
context:
|
|
4717
|
+
reasoning: z20.object({
|
|
4718
|
+
context: z20.string().nullish()
|
|
4498
4719
|
}).nullish(),
|
|
4499
|
-
service_tier:
|
|
4720
|
+
service_tier: z20.string().nullish()
|
|
4500
4721
|
})
|
|
4501
4722
|
}),
|
|
4502
|
-
|
|
4503
|
-
type:
|
|
4504
|
-
sequence_number:
|
|
4505
|
-
response:
|
|
4506
|
-
error:
|
|
4507
|
-
code:
|
|
4508
|
-
message:
|
|
4723
|
+
z20.object({
|
|
4724
|
+
type: z20.literal("response.failed"),
|
|
4725
|
+
sequence_number: z20.number(),
|
|
4726
|
+
response: z20.object({
|
|
4727
|
+
error: z20.object({
|
|
4728
|
+
code: z20.string().nullish(),
|
|
4729
|
+
message: z20.string()
|
|
4509
4730
|
}).nullish(),
|
|
4510
|
-
incomplete_details:
|
|
4731
|
+
incomplete_details: z20.object({ reason: z20.string() }).nullish(),
|
|
4511
4732
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4512
|
-
reasoning:
|
|
4513
|
-
context:
|
|
4733
|
+
reasoning: z20.object({
|
|
4734
|
+
context: z20.string().nullish()
|
|
4514
4735
|
}).nullish(),
|
|
4515
|
-
service_tier:
|
|
4736
|
+
service_tier: z20.string().nullish()
|
|
4516
4737
|
})
|
|
4517
4738
|
}),
|
|
4518
|
-
|
|
4519
|
-
type:
|
|
4520
|
-
response:
|
|
4521
|
-
id:
|
|
4522
|
-
created_at:
|
|
4523
|
-
model:
|
|
4524
|
-
service_tier:
|
|
4739
|
+
z20.object({
|
|
4740
|
+
type: z20.literal("response.created"),
|
|
4741
|
+
response: z20.object({
|
|
4742
|
+
id: z20.string(),
|
|
4743
|
+
created_at: z20.number(),
|
|
4744
|
+
model: z20.string(),
|
|
4745
|
+
service_tier: z20.string().nullish()
|
|
4525
4746
|
})
|
|
4526
4747
|
}),
|
|
4527
|
-
|
|
4528
|
-
type:
|
|
4529
|
-
output_index:
|
|
4530
|
-
item:
|
|
4531
|
-
|
|
4532
|
-
type:
|
|
4533
|
-
id:
|
|
4534
|
-
phase:
|
|
4748
|
+
z20.object({
|
|
4749
|
+
type: z20.literal("response.output_item.added"),
|
|
4750
|
+
output_index: z20.number(),
|
|
4751
|
+
item: z20.discriminatedUnion("type", [
|
|
4752
|
+
z20.object({
|
|
4753
|
+
type: z20.literal("message"),
|
|
4754
|
+
id: z20.string(),
|
|
4755
|
+
phase: z20.enum(["commentary", "final_answer"]).nullish()
|
|
4535
4756
|
}),
|
|
4536
|
-
|
|
4537
|
-
type:
|
|
4538
|
-
id:
|
|
4539
|
-
encrypted_content:
|
|
4757
|
+
z20.object({
|
|
4758
|
+
type: z20.literal("reasoning"),
|
|
4759
|
+
id: z20.string(),
|
|
4760
|
+
encrypted_content: z20.string().nullish()
|
|
4540
4761
|
}),
|
|
4541
|
-
|
|
4542
|
-
type:
|
|
4543
|
-
id:
|
|
4544
|
-
call_id:
|
|
4545
|
-
name:
|
|
4546
|
-
arguments:
|
|
4547
|
-
async:
|
|
4548
|
-
namespace:
|
|
4762
|
+
z20.object({
|
|
4763
|
+
type: z20.literal("function_call"),
|
|
4764
|
+
id: z20.string(),
|
|
4765
|
+
call_id: z20.string(),
|
|
4766
|
+
name: z20.string(),
|
|
4767
|
+
arguments: z20.string(),
|
|
4768
|
+
async: z20.boolean().nullish(),
|
|
4769
|
+
namespace: z20.string().nullish()
|
|
4549
4770
|
}),
|
|
4550
|
-
|
|
4551
|
-
type:
|
|
4552
|
-
id:
|
|
4553
|
-
status:
|
|
4771
|
+
z20.object({
|
|
4772
|
+
type: z20.literal("web_search_call"),
|
|
4773
|
+
id: z20.string(),
|
|
4774
|
+
status: z20.string()
|
|
4554
4775
|
}),
|
|
4555
|
-
|
|
4556
|
-
type:
|
|
4557
|
-
id:
|
|
4558
|
-
status:
|
|
4776
|
+
z20.object({
|
|
4777
|
+
type: z20.literal("computer_call"),
|
|
4778
|
+
id: z20.string(),
|
|
4779
|
+
status: z20.string()
|
|
4559
4780
|
}),
|
|
4560
|
-
|
|
4561
|
-
type:
|
|
4562
|
-
id:
|
|
4781
|
+
z20.object({
|
|
4782
|
+
type: z20.literal("file_search_call"),
|
|
4783
|
+
id: z20.string()
|
|
4563
4784
|
}),
|
|
4564
4785
|
openaiResponsesLocalShellCallSchema,
|
|
4565
|
-
|
|
4566
|
-
type:
|
|
4567
|
-
id:
|
|
4786
|
+
z20.object({
|
|
4787
|
+
type: z20.literal("image_generation_call"),
|
|
4788
|
+
id: z20.string()
|
|
4568
4789
|
}),
|
|
4569
|
-
|
|
4570
|
-
type:
|
|
4571
|
-
id:
|
|
4572
|
-
container_id:
|
|
4573
|
-
code:
|
|
4574
|
-
outputs:
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4790
|
+
z20.object({
|
|
4791
|
+
type: z20.literal("code_interpreter_call"),
|
|
4792
|
+
id: z20.string(),
|
|
4793
|
+
container_id: z20.string(),
|
|
4794
|
+
code: z20.string().nullable(),
|
|
4795
|
+
outputs: z20.array(
|
|
4796
|
+
z20.discriminatedUnion("type", [
|
|
4797
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
4798
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
4578
4799
|
])
|
|
4579
4800
|
).nullable(),
|
|
4580
|
-
status:
|
|
4801
|
+
status: z20.string()
|
|
4581
4802
|
}),
|
|
4582
|
-
|
|
4583
|
-
type:
|
|
4584
|
-
id:
|
|
4585
|
-
status:
|
|
4586
|
-
approval_request_id:
|
|
4803
|
+
z20.object({
|
|
4804
|
+
type: z20.literal("mcp_call"),
|
|
4805
|
+
id: z20.string(),
|
|
4806
|
+
status: z20.string(),
|
|
4807
|
+
approval_request_id: z20.string().nullish()
|
|
4587
4808
|
}),
|
|
4588
|
-
|
|
4589
|
-
type:
|
|
4590
|
-
id:
|
|
4809
|
+
z20.object({
|
|
4810
|
+
type: z20.literal("mcp_list_tools"),
|
|
4811
|
+
id: z20.string()
|
|
4591
4812
|
}),
|
|
4592
|
-
|
|
4593
|
-
type:
|
|
4594
|
-
id:
|
|
4813
|
+
z20.object({
|
|
4814
|
+
type: z20.literal("mcp_approval_request"),
|
|
4815
|
+
id: z20.string()
|
|
4595
4816
|
}),
|
|
4596
|
-
|
|
4597
|
-
type:
|
|
4598
|
-
id:
|
|
4599
|
-
call_id:
|
|
4600
|
-
status:
|
|
4601
|
-
operation:
|
|
4602
|
-
|
|
4603
|
-
type:
|
|
4604
|
-
path:
|
|
4605
|
-
diff:
|
|
4817
|
+
z20.object({
|
|
4818
|
+
type: z20.literal("apply_patch_call"),
|
|
4819
|
+
id: z20.string(),
|
|
4820
|
+
call_id: z20.string(),
|
|
4821
|
+
status: z20.enum(["in_progress", "completed"]),
|
|
4822
|
+
operation: z20.discriminatedUnion("type", [
|
|
4823
|
+
z20.object({
|
|
4824
|
+
type: z20.literal("create_file"),
|
|
4825
|
+
path: z20.string(),
|
|
4826
|
+
diff: z20.string()
|
|
4606
4827
|
}),
|
|
4607
|
-
|
|
4608
|
-
type:
|
|
4609
|
-
path:
|
|
4828
|
+
z20.object({
|
|
4829
|
+
type: z20.literal("delete_file"),
|
|
4830
|
+
path: z20.string()
|
|
4610
4831
|
}),
|
|
4611
|
-
|
|
4612
|
-
type:
|
|
4613
|
-
path:
|
|
4614
|
-
diff:
|
|
4832
|
+
z20.object({
|
|
4833
|
+
type: z20.literal("update_file"),
|
|
4834
|
+
path: z20.string(),
|
|
4835
|
+
diff: z20.string()
|
|
4615
4836
|
})
|
|
4616
4837
|
])
|
|
4617
4838
|
}),
|
|
4618
|
-
|
|
4619
|
-
type:
|
|
4620
|
-
id:
|
|
4621
|
-
call_id:
|
|
4622
|
-
name:
|
|
4623
|
-
input:
|
|
4624
|
-
async:
|
|
4839
|
+
z20.object({
|
|
4840
|
+
type: z20.literal("custom_tool_call"),
|
|
4841
|
+
id: z20.string(),
|
|
4842
|
+
call_id: z20.string(),
|
|
4843
|
+
name: z20.string(),
|
|
4844
|
+
input: z20.string(),
|
|
4845
|
+
async: z20.boolean().nullish()
|
|
4625
4846
|
}),
|
|
4626
|
-
|
|
4627
|
-
type:
|
|
4628
|
-
id:
|
|
4629
|
-
call_id:
|
|
4630
|
-
status:
|
|
4631
|
-
action:
|
|
4632
|
-
commands:
|
|
4847
|
+
z20.object({
|
|
4848
|
+
type: z20.literal("shell_call"),
|
|
4849
|
+
id: z20.string(),
|
|
4850
|
+
call_id: z20.string(),
|
|
4851
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4852
|
+
action: z20.object({
|
|
4853
|
+
commands: z20.array(z20.string())
|
|
4633
4854
|
})
|
|
4634
4855
|
}),
|
|
4635
|
-
|
|
4636
|
-
type:
|
|
4637
|
-
id:
|
|
4638
|
-
call_id:
|
|
4639
|
-
status:
|
|
4640
|
-
output:
|
|
4641
|
-
|
|
4642
|
-
stdout:
|
|
4643
|
-
stderr:
|
|
4644
|
-
outcome:
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
type:
|
|
4648
|
-
exit_code:
|
|
4856
|
+
z20.object({
|
|
4857
|
+
type: z20.literal("shell_call_output"),
|
|
4858
|
+
id: z20.string(),
|
|
4859
|
+
call_id: z20.string(),
|
|
4860
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4861
|
+
output: z20.array(
|
|
4862
|
+
z20.object({
|
|
4863
|
+
stdout: z20.string(),
|
|
4864
|
+
stderr: z20.string(),
|
|
4865
|
+
outcome: z20.discriminatedUnion("type", [
|
|
4866
|
+
z20.object({ type: z20.literal("timeout") }),
|
|
4867
|
+
z20.object({
|
|
4868
|
+
type: z20.literal("exit"),
|
|
4869
|
+
exit_code: z20.number()
|
|
4649
4870
|
})
|
|
4650
4871
|
])
|
|
4651
4872
|
})
|
|
4652
4873
|
)
|
|
4653
4874
|
}),
|
|
4654
|
-
|
|
4655
|
-
type:
|
|
4656
|
-
id:
|
|
4657
|
-
execution:
|
|
4658
|
-
call_id:
|
|
4659
|
-
status:
|
|
4660
|
-
arguments:
|
|
4875
|
+
z20.object({
|
|
4876
|
+
type: z20.literal("tool_search_call"),
|
|
4877
|
+
id: z20.string(),
|
|
4878
|
+
execution: z20.enum(["server", "client"]),
|
|
4879
|
+
call_id: z20.string().nullable(),
|
|
4880
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4881
|
+
arguments: z20.unknown()
|
|
4661
4882
|
}),
|
|
4662
|
-
|
|
4663
|
-
type:
|
|
4664
|
-
id:
|
|
4665
|
-
execution:
|
|
4666
|
-
call_id:
|
|
4667
|
-
status:
|
|
4668
|
-
tools:
|
|
4883
|
+
z20.object({
|
|
4884
|
+
type: z20.literal("tool_search_output"),
|
|
4885
|
+
id: z20.string(),
|
|
4886
|
+
execution: z20.enum(["server", "client"]),
|
|
4887
|
+
call_id: z20.string().nullable(),
|
|
4888
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4889
|
+
tools: z20.array(z20.record(z20.string(), jsonValueSchema.optional()))
|
|
4669
4890
|
})
|
|
4670
4891
|
])
|
|
4671
4892
|
}),
|
|
4672
|
-
|
|
4673
|
-
type:
|
|
4674
|
-
output_index:
|
|
4675
|
-
item:
|
|
4676
|
-
|
|
4677
|
-
type:
|
|
4678
|
-
id:
|
|
4679
|
-
phase:
|
|
4893
|
+
z20.object({
|
|
4894
|
+
type: z20.literal("response.output_item.done"),
|
|
4895
|
+
output_index: z20.number(),
|
|
4896
|
+
item: z20.discriminatedUnion("type", [
|
|
4897
|
+
z20.object({
|
|
4898
|
+
type: z20.literal("message"),
|
|
4899
|
+
id: z20.string(),
|
|
4900
|
+
phase: z20.enum(["commentary", "final_answer"]).nullish()
|
|
4680
4901
|
}),
|
|
4681
|
-
|
|
4682
|
-
type:
|
|
4683
|
-
id:
|
|
4684
|
-
encrypted_content:
|
|
4902
|
+
z20.object({
|
|
4903
|
+
type: z20.literal("reasoning"),
|
|
4904
|
+
id: z20.string(),
|
|
4905
|
+
encrypted_content: z20.string().nullish()
|
|
4685
4906
|
}),
|
|
4686
|
-
|
|
4687
|
-
type:
|
|
4688
|
-
id:
|
|
4689
|
-
call_id:
|
|
4690
|
-
name:
|
|
4691
|
-
arguments:
|
|
4692
|
-
async:
|
|
4693
|
-
status:
|
|
4694
|
-
namespace:
|
|
4907
|
+
z20.object({
|
|
4908
|
+
type: z20.literal("function_call"),
|
|
4909
|
+
id: z20.string(),
|
|
4910
|
+
call_id: z20.string(),
|
|
4911
|
+
name: z20.string(),
|
|
4912
|
+
arguments: z20.string(),
|
|
4913
|
+
async: z20.boolean().nullish(),
|
|
4914
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4915
|
+
namespace: z20.string().nullish()
|
|
4695
4916
|
}),
|
|
4696
|
-
|
|
4697
|
-
type:
|
|
4698
|
-
id:
|
|
4699
|
-
call_id:
|
|
4700
|
-
name:
|
|
4701
|
-
input:
|
|
4702
|
-
async:
|
|
4703
|
-
status:
|
|
4917
|
+
z20.object({
|
|
4918
|
+
type: z20.literal("custom_tool_call"),
|
|
4919
|
+
id: z20.string(),
|
|
4920
|
+
call_id: z20.string(),
|
|
4921
|
+
name: z20.string(),
|
|
4922
|
+
input: z20.string(),
|
|
4923
|
+
async: z20.boolean().nullish(),
|
|
4924
|
+
status: z20.enum(["in_progress", "completed", "incomplete"])
|
|
4704
4925
|
}),
|
|
4705
|
-
|
|
4706
|
-
type:
|
|
4707
|
-
id:
|
|
4708
|
-
code:
|
|
4709
|
-
container_id:
|
|
4710
|
-
outputs:
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4926
|
+
z20.object({
|
|
4927
|
+
type: z20.literal("code_interpreter_call"),
|
|
4928
|
+
id: z20.string(),
|
|
4929
|
+
code: z20.string().nullable(),
|
|
4930
|
+
container_id: z20.string(),
|
|
4931
|
+
outputs: z20.array(
|
|
4932
|
+
z20.discriminatedUnion("type", [
|
|
4933
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
4934
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
4714
4935
|
])
|
|
4715
4936
|
).nullable()
|
|
4716
4937
|
}),
|
|
4717
|
-
|
|
4718
|
-
type:
|
|
4719
|
-
id:
|
|
4720
|
-
result:
|
|
4938
|
+
z20.object({
|
|
4939
|
+
type: z20.literal("image_generation_call"),
|
|
4940
|
+
id: z20.string(),
|
|
4941
|
+
result: z20.string()
|
|
4721
4942
|
}),
|
|
4722
|
-
|
|
4723
|
-
type:
|
|
4724
|
-
id:
|
|
4725
|
-
status:
|
|
4726
|
-
action:
|
|
4727
|
-
|
|
4728
|
-
type:
|
|
4729
|
-
query:
|
|
4730
|
-
queries:
|
|
4731
|
-
sources:
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4943
|
+
z20.object({
|
|
4944
|
+
type: z20.literal("web_search_call"),
|
|
4945
|
+
id: z20.string(),
|
|
4946
|
+
status: z20.string(),
|
|
4947
|
+
action: z20.discriminatedUnion("type", [
|
|
4948
|
+
z20.object({
|
|
4949
|
+
type: z20.literal("search"),
|
|
4950
|
+
query: z20.string().nullish(),
|
|
4951
|
+
queries: z20.array(z20.string()).nullish(),
|
|
4952
|
+
sources: z20.array(
|
|
4953
|
+
z20.discriminatedUnion("type", [
|
|
4954
|
+
z20.object({ type: z20.literal("url"), url: z20.string() }),
|
|
4955
|
+
z20.object({ type: z20.literal("api"), name: z20.string() })
|
|
4735
4956
|
])
|
|
4736
4957
|
).nullish()
|
|
4737
4958
|
}),
|
|
4738
|
-
|
|
4739
|
-
type:
|
|
4740
|
-
url:
|
|
4959
|
+
z20.object({
|
|
4960
|
+
type: z20.literal("open_page"),
|
|
4961
|
+
url: z20.string().nullish()
|
|
4741
4962
|
}),
|
|
4742
|
-
|
|
4743
|
-
type:
|
|
4744
|
-
url:
|
|
4745
|
-
pattern:
|
|
4963
|
+
z20.object({
|
|
4964
|
+
type: z20.literal("find_in_page"),
|
|
4965
|
+
url: z20.string().nullish(),
|
|
4966
|
+
pattern: z20.string().nullish()
|
|
4746
4967
|
})
|
|
4747
4968
|
]).nullish()
|
|
4748
4969
|
}),
|
|
4749
|
-
|
|
4750
|
-
type:
|
|
4751
|
-
id:
|
|
4752
|
-
queries:
|
|
4753
|
-
results:
|
|
4754
|
-
|
|
4755
|
-
attributes:
|
|
4756
|
-
|
|
4757
|
-
|
|
4970
|
+
z20.object({
|
|
4971
|
+
type: z20.literal("file_search_call"),
|
|
4972
|
+
id: z20.string(),
|
|
4973
|
+
queries: z20.array(z20.string()),
|
|
4974
|
+
results: z20.array(
|
|
4975
|
+
z20.object({
|
|
4976
|
+
attributes: z20.record(
|
|
4977
|
+
z20.string(),
|
|
4978
|
+
z20.union([z20.string(), z20.number(), z20.boolean()])
|
|
4758
4979
|
),
|
|
4759
|
-
file_id:
|
|
4760
|
-
filename:
|
|
4761
|
-
score:
|
|
4762
|
-
text:
|
|
4980
|
+
file_id: z20.string(),
|
|
4981
|
+
filename: z20.string(),
|
|
4982
|
+
score: z20.number(),
|
|
4983
|
+
text: z20.string()
|
|
4763
4984
|
})
|
|
4764
4985
|
).nullish()
|
|
4765
4986
|
}),
|
|
4766
4987
|
openaiResponsesLocalShellCallSchema,
|
|
4767
|
-
|
|
4768
|
-
type:
|
|
4769
|
-
id:
|
|
4770
|
-
status:
|
|
4988
|
+
z20.object({
|
|
4989
|
+
type: z20.literal("computer_call"),
|
|
4990
|
+
id: z20.string(),
|
|
4991
|
+
status: z20.literal("completed")
|
|
4771
4992
|
}),
|
|
4772
|
-
|
|
4773
|
-
type:
|
|
4774
|
-
id:
|
|
4775
|
-
status:
|
|
4776
|
-
arguments:
|
|
4777
|
-
name:
|
|
4778
|
-
server_label:
|
|
4779
|
-
output:
|
|
4780
|
-
error:
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
type:
|
|
4784
|
-
code:
|
|
4785
|
-
message:
|
|
4993
|
+
z20.object({
|
|
4994
|
+
type: z20.literal("mcp_call"),
|
|
4995
|
+
id: z20.string(),
|
|
4996
|
+
status: z20.string(),
|
|
4997
|
+
arguments: z20.string(),
|
|
4998
|
+
name: z20.string(),
|
|
4999
|
+
server_label: z20.string(),
|
|
5000
|
+
output: z20.string().nullish(),
|
|
5001
|
+
error: z20.union([
|
|
5002
|
+
z20.string(),
|
|
5003
|
+
z20.object({
|
|
5004
|
+
type: z20.string().optional(),
|
|
5005
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
5006
|
+
message: z20.string().optional()
|
|
4786
5007
|
}).loose()
|
|
4787
5008
|
]).nullish(),
|
|
4788
|
-
approval_request_id:
|
|
5009
|
+
approval_request_id: z20.string().nullish()
|
|
4789
5010
|
}),
|
|
4790
|
-
|
|
4791
|
-
type:
|
|
4792
|
-
id:
|
|
4793
|
-
server_label:
|
|
4794
|
-
tools:
|
|
4795
|
-
|
|
4796
|
-
name:
|
|
4797
|
-
description:
|
|
4798
|
-
input_schema:
|
|
4799
|
-
annotations:
|
|
5011
|
+
z20.object({
|
|
5012
|
+
type: z20.literal("mcp_list_tools"),
|
|
5013
|
+
id: z20.string(),
|
|
5014
|
+
server_label: z20.string(),
|
|
5015
|
+
tools: z20.array(
|
|
5016
|
+
z20.object({
|
|
5017
|
+
name: z20.string(),
|
|
5018
|
+
description: z20.string().optional(),
|
|
5019
|
+
input_schema: z20.any(),
|
|
5020
|
+
annotations: z20.record(z20.string(), z20.unknown()).optional()
|
|
4800
5021
|
})
|
|
4801
5022
|
),
|
|
4802
|
-
error:
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
type:
|
|
4806
|
-
code:
|
|
4807
|
-
message:
|
|
5023
|
+
error: z20.union([
|
|
5024
|
+
z20.string(),
|
|
5025
|
+
z20.object({
|
|
5026
|
+
type: z20.string().optional(),
|
|
5027
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
5028
|
+
message: z20.string().optional()
|
|
4808
5029
|
}).loose()
|
|
4809
5030
|
]).optional()
|
|
4810
5031
|
}),
|
|
4811
|
-
|
|
4812
|
-
type:
|
|
4813
|
-
id:
|
|
4814
|
-
server_label:
|
|
4815
|
-
name:
|
|
4816
|
-
arguments:
|
|
4817
|
-
approval_request_id:
|
|
5032
|
+
z20.object({
|
|
5033
|
+
type: z20.literal("mcp_approval_request"),
|
|
5034
|
+
id: z20.string(),
|
|
5035
|
+
server_label: z20.string(),
|
|
5036
|
+
name: z20.string(),
|
|
5037
|
+
arguments: z20.string(),
|
|
5038
|
+
approval_request_id: z20.string().optional()
|
|
4818
5039
|
}),
|
|
4819
|
-
|
|
4820
|
-
type:
|
|
4821
|
-
id:
|
|
4822
|
-
call_id:
|
|
4823
|
-
status:
|
|
4824
|
-
operation:
|
|
4825
|
-
|
|
4826
|
-
type:
|
|
4827
|
-
path:
|
|
4828
|
-
diff:
|
|
5040
|
+
z20.object({
|
|
5041
|
+
type: z20.literal("apply_patch_call"),
|
|
5042
|
+
id: z20.string(),
|
|
5043
|
+
call_id: z20.string(),
|
|
5044
|
+
status: z20.enum(["in_progress", "completed"]),
|
|
5045
|
+
operation: z20.discriminatedUnion("type", [
|
|
5046
|
+
z20.object({
|
|
5047
|
+
type: z20.literal("create_file"),
|
|
5048
|
+
path: z20.string(),
|
|
5049
|
+
diff: z20.string()
|
|
4829
5050
|
}),
|
|
4830
|
-
|
|
4831
|
-
type:
|
|
4832
|
-
path:
|
|
5051
|
+
z20.object({
|
|
5052
|
+
type: z20.literal("delete_file"),
|
|
5053
|
+
path: z20.string()
|
|
4833
5054
|
}),
|
|
4834
|
-
|
|
4835
|
-
type:
|
|
4836
|
-
path:
|
|
4837
|
-
diff:
|
|
5055
|
+
z20.object({
|
|
5056
|
+
type: z20.literal("update_file"),
|
|
5057
|
+
path: z20.string(),
|
|
5058
|
+
diff: z20.string()
|
|
4838
5059
|
})
|
|
4839
5060
|
])
|
|
4840
5061
|
}),
|
|
4841
|
-
|
|
4842
|
-
type:
|
|
4843
|
-
id:
|
|
4844
|
-
call_id:
|
|
4845
|
-
status:
|
|
4846
|
-
action:
|
|
4847
|
-
commands:
|
|
5062
|
+
z20.object({
|
|
5063
|
+
type: z20.literal("shell_call"),
|
|
5064
|
+
id: z20.string(),
|
|
5065
|
+
call_id: z20.string(),
|
|
5066
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5067
|
+
action: z20.object({
|
|
5068
|
+
commands: z20.array(z20.string())
|
|
4848
5069
|
})
|
|
4849
5070
|
}),
|
|
4850
|
-
|
|
4851
|
-
type:
|
|
4852
|
-
id:
|
|
4853
|
-
call_id:
|
|
4854
|
-
status:
|
|
4855
|
-
output:
|
|
4856
|
-
|
|
4857
|
-
stdout:
|
|
4858
|
-
stderr:
|
|
4859
|
-
outcome:
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
type:
|
|
4863
|
-
exit_code:
|
|
5071
|
+
z20.object({
|
|
5072
|
+
type: z20.literal("shell_call_output"),
|
|
5073
|
+
id: z20.string(),
|
|
5074
|
+
call_id: z20.string(),
|
|
5075
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5076
|
+
output: z20.array(
|
|
5077
|
+
z20.object({
|
|
5078
|
+
stdout: z20.string(),
|
|
5079
|
+
stderr: z20.string(),
|
|
5080
|
+
outcome: z20.discriminatedUnion("type", [
|
|
5081
|
+
z20.object({ type: z20.literal("timeout") }),
|
|
5082
|
+
z20.object({
|
|
5083
|
+
type: z20.literal("exit"),
|
|
5084
|
+
exit_code: z20.number()
|
|
4864
5085
|
})
|
|
4865
5086
|
])
|
|
4866
5087
|
})
|
|
4867
5088
|
)
|
|
4868
5089
|
}),
|
|
4869
|
-
|
|
4870
|
-
type:
|
|
4871
|
-
id:
|
|
4872
|
-
execution:
|
|
4873
|
-
call_id:
|
|
4874
|
-
status:
|
|
4875
|
-
arguments:
|
|
5090
|
+
z20.object({
|
|
5091
|
+
type: z20.literal("tool_search_call"),
|
|
5092
|
+
id: z20.string(),
|
|
5093
|
+
execution: z20.enum(["server", "client"]),
|
|
5094
|
+
call_id: z20.string().nullable(),
|
|
5095
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5096
|
+
arguments: z20.unknown()
|
|
4876
5097
|
}),
|
|
4877
|
-
|
|
4878
|
-
type:
|
|
4879
|
-
id:
|
|
4880
|
-
execution:
|
|
4881
|
-
call_id:
|
|
4882
|
-
status:
|
|
4883
|
-
tools:
|
|
5098
|
+
z20.object({
|
|
5099
|
+
type: z20.literal("tool_search_output"),
|
|
5100
|
+
id: z20.string(),
|
|
5101
|
+
execution: z20.enum(["server", "client"]),
|
|
5102
|
+
call_id: z20.string().nullable(),
|
|
5103
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5104
|
+
tools: z20.array(z20.record(z20.string(), jsonValueSchema.optional()))
|
|
4884
5105
|
})
|
|
4885
5106
|
])
|
|
4886
5107
|
}),
|
|
4887
|
-
|
|
4888
|
-
type:
|
|
4889
|
-
item_id:
|
|
4890
|
-
output_index:
|
|
4891
|
-
delta:
|
|
5108
|
+
z20.object({
|
|
5109
|
+
type: z20.literal("response.function_call_arguments.delta"),
|
|
5110
|
+
item_id: z20.string(),
|
|
5111
|
+
output_index: z20.number(),
|
|
5112
|
+
delta: z20.string()
|
|
4892
5113
|
}),
|
|
4893
|
-
|
|
5114
|
+
z20.object({
|
|
4894
5115
|
// `name` is documented as required but omitted from live API events:
|
|
4895
5116
|
// https://github.com/openai/openai-openapi/issues/545
|
|
4896
|
-
type:
|
|
4897
|
-
item_id:
|
|
4898
|
-
output_index:
|
|
4899
|
-
arguments:
|
|
5117
|
+
type: z20.literal("response.function_call_arguments.done"),
|
|
5118
|
+
item_id: z20.string(),
|
|
5119
|
+
output_index: z20.number(),
|
|
5120
|
+
arguments: z20.string()
|
|
4900
5121
|
}),
|
|
4901
|
-
|
|
4902
|
-
type:
|
|
4903
|
-
item_id:
|
|
4904
|
-
output_index:
|
|
4905
|
-
delta:
|
|
5122
|
+
z20.object({
|
|
5123
|
+
type: z20.literal("response.custom_tool_call_input.delta"),
|
|
5124
|
+
item_id: z20.string(),
|
|
5125
|
+
output_index: z20.number(),
|
|
5126
|
+
delta: z20.string()
|
|
4906
5127
|
}),
|
|
4907
|
-
|
|
4908
|
-
type:
|
|
4909
|
-
item_id:
|
|
4910
|
-
output_index:
|
|
4911
|
-
partial_image_b64:
|
|
5128
|
+
z20.object({
|
|
5129
|
+
type: z20.literal("response.image_generation_call.partial_image"),
|
|
5130
|
+
item_id: z20.string(),
|
|
5131
|
+
output_index: z20.number(),
|
|
5132
|
+
partial_image_b64: z20.string()
|
|
4912
5133
|
}),
|
|
4913
|
-
|
|
4914
|
-
type:
|
|
4915
|
-
item_id:
|
|
4916
|
-
output_index:
|
|
4917
|
-
delta:
|
|
5134
|
+
z20.object({
|
|
5135
|
+
type: z20.literal("response.code_interpreter_call_code.delta"),
|
|
5136
|
+
item_id: z20.string(),
|
|
5137
|
+
output_index: z20.number(),
|
|
5138
|
+
delta: z20.string()
|
|
4918
5139
|
}),
|
|
4919
|
-
|
|
4920
|
-
type:
|
|
4921
|
-
item_id:
|
|
4922
|
-
output_index:
|
|
4923
|
-
code:
|
|
5140
|
+
z20.object({
|
|
5141
|
+
type: z20.literal("response.code_interpreter_call_code.done"),
|
|
5142
|
+
item_id: z20.string(),
|
|
5143
|
+
output_index: z20.number(),
|
|
5144
|
+
code: z20.string()
|
|
4924
5145
|
}),
|
|
4925
|
-
|
|
4926
|
-
type:
|
|
4927
|
-
annotation:
|
|
4928
|
-
|
|
4929
|
-
type:
|
|
4930
|
-
start_index:
|
|
4931
|
-
end_index:
|
|
4932
|
-
url:
|
|
4933
|
-
title:
|
|
5146
|
+
z20.object({
|
|
5147
|
+
type: z20.literal("response.output_text.annotation.added"),
|
|
5148
|
+
annotation: z20.discriminatedUnion("type", [
|
|
5149
|
+
z20.object({
|
|
5150
|
+
type: z20.literal("url_citation"),
|
|
5151
|
+
start_index: z20.number(),
|
|
5152
|
+
end_index: z20.number(),
|
|
5153
|
+
url: z20.string(),
|
|
5154
|
+
title: z20.string()
|
|
4934
5155
|
}),
|
|
4935
|
-
|
|
4936
|
-
type:
|
|
4937
|
-
file_id:
|
|
4938
|
-
filename:
|
|
4939
|
-
index:
|
|
5156
|
+
z20.object({
|
|
5157
|
+
type: z20.literal("file_citation"),
|
|
5158
|
+
file_id: z20.string(),
|
|
5159
|
+
filename: z20.string(),
|
|
5160
|
+
index: z20.number()
|
|
4940
5161
|
}),
|
|
4941
|
-
|
|
4942
|
-
type:
|
|
4943
|
-
container_id:
|
|
4944
|
-
file_id:
|
|
4945
|
-
filename:
|
|
4946
|
-
start_index:
|
|
4947
|
-
end_index:
|
|
5162
|
+
z20.object({
|
|
5163
|
+
type: z20.literal("container_file_citation"),
|
|
5164
|
+
container_id: z20.string(),
|
|
5165
|
+
file_id: z20.string(),
|
|
5166
|
+
filename: z20.string(),
|
|
5167
|
+
start_index: z20.number(),
|
|
5168
|
+
end_index: z20.number()
|
|
4948
5169
|
}),
|
|
4949
|
-
|
|
4950
|
-
type:
|
|
4951
|
-
file_id:
|
|
4952
|
-
index:
|
|
5170
|
+
z20.object({
|
|
5171
|
+
type: z20.literal("file_path"),
|
|
5172
|
+
file_id: z20.string(),
|
|
5173
|
+
index: z20.number()
|
|
4953
5174
|
})
|
|
4954
5175
|
])
|
|
4955
5176
|
}),
|
|
4956
|
-
|
|
4957
|
-
type:
|
|
4958
|
-
item_id:
|
|
4959
|
-
summary_index:
|
|
5177
|
+
z20.object({
|
|
5178
|
+
type: z20.literal("response.reasoning_summary_part.added"),
|
|
5179
|
+
item_id: z20.string(),
|
|
5180
|
+
summary_index: z20.number()
|
|
4960
5181
|
}),
|
|
4961
|
-
|
|
4962
|
-
type:
|
|
4963
|
-
item_id:
|
|
4964
|
-
summary_index:
|
|
4965
|
-
delta:
|
|
5182
|
+
z20.object({
|
|
5183
|
+
type: z20.literal("response.reasoning_summary_text.delta"),
|
|
5184
|
+
item_id: z20.string(),
|
|
5185
|
+
summary_index: z20.number(),
|
|
5186
|
+
delta: z20.string()
|
|
4966
5187
|
}),
|
|
4967
|
-
|
|
4968
|
-
type:
|
|
4969
|
-
item_id:
|
|
4970
|
-
summary_index:
|
|
5188
|
+
z20.object({
|
|
5189
|
+
type: z20.literal("response.reasoning_summary_part.done"),
|
|
5190
|
+
item_id: z20.string(),
|
|
5191
|
+
summary_index: z20.number()
|
|
4971
5192
|
}),
|
|
4972
|
-
|
|
4973
|
-
type:
|
|
4974
|
-
item_id:
|
|
4975
|
-
output_index:
|
|
4976
|
-
delta:
|
|
4977
|
-
obfuscation:
|
|
5193
|
+
z20.object({
|
|
5194
|
+
type: z20.literal("response.apply_patch_call_operation_diff.delta"),
|
|
5195
|
+
item_id: z20.string(),
|
|
5196
|
+
output_index: z20.number(),
|
|
5197
|
+
delta: z20.string(),
|
|
5198
|
+
obfuscation: z20.string().nullish()
|
|
4978
5199
|
}),
|
|
4979
|
-
|
|
4980
|
-
type:
|
|
4981
|
-
item_id:
|
|
4982
|
-
output_index:
|
|
4983
|
-
diff:
|
|
5200
|
+
z20.object({
|
|
5201
|
+
type: z20.literal("response.apply_patch_call_operation_diff.done"),
|
|
5202
|
+
item_id: z20.string(),
|
|
5203
|
+
output_index: z20.number(),
|
|
5204
|
+
diff: z20.string()
|
|
4984
5205
|
}),
|
|
4985
5206
|
openaiResponsesNestedErrorChunkSchema,
|
|
4986
5207
|
openaiResponsesErrorChunkSchema,
|
|
4987
|
-
|
|
5208
|
+
z20.object({ type: z20.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {
|
|
4988
5209
|
message: "Known response chunk failed schema validation"
|
|
4989
5210
|
}).transform((value) => ({
|
|
4990
5211
|
type: "unknown_chunk",
|
|
@@ -4994,292 +5215,292 @@ var openaiResponsesChunkSchema = lazySchema17(
|
|
|
4994
5215
|
])
|
|
4995
5216
|
)
|
|
4996
5217
|
);
|
|
4997
|
-
var openaiResponsesResponseSchema =
|
|
4998
|
-
() =>
|
|
4999
|
-
|
|
5000
|
-
id:
|
|
5001
|
-
created_at:
|
|
5002
|
-
error:
|
|
5003
|
-
message:
|
|
5004
|
-
type:
|
|
5005
|
-
param:
|
|
5006
|
-
code:
|
|
5218
|
+
var openaiResponsesResponseSchema = lazySchema18(
|
|
5219
|
+
() => zodSchema18(
|
|
5220
|
+
z20.object({
|
|
5221
|
+
id: z20.string().optional(),
|
|
5222
|
+
created_at: z20.number().optional(),
|
|
5223
|
+
error: z20.object({
|
|
5224
|
+
message: z20.string(),
|
|
5225
|
+
type: z20.string(),
|
|
5226
|
+
param: z20.string().nullish(),
|
|
5227
|
+
code: z20.string()
|
|
5007
5228
|
}).nullish(),
|
|
5008
|
-
model:
|
|
5009
|
-
output:
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
type:
|
|
5013
|
-
role:
|
|
5014
|
-
id:
|
|
5015
|
-
phase:
|
|
5016
|
-
content:
|
|
5017
|
-
|
|
5018
|
-
type:
|
|
5019
|
-
text:
|
|
5020
|
-
logprobs:
|
|
5021
|
-
|
|
5022
|
-
token:
|
|
5023
|
-
logprob:
|
|
5024
|
-
top_logprobs:
|
|
5025
|
-
|
|
5026
|
-
token:
|
|
5027
|
-
logprob:
|
|
5229
|
+
model: z20.string().optional(),
|
|
5230
|
+
output: z20.array(
|
|
5231
|
+
z20.discriminatedUnion("type", [
|
|
5232
|
+
z20.object({
|
|
5233
|
+
type: z20.literal("message"),
|
|
5234
|
+
role: z20.literal("assistant"),
|
|
5235
|
+
id: z20.string(),
|
|
5236
|
+
phase: z20.enum(["commentary", "final_answer"]).nullish(),
|
|
5237
|
+
content: z20.array(
|
|
5238
|
+
z20.object({
|
|
5239
|
+
type: z20.literal("output_text"),
|
|
5240
|
+
text: z20.string(),
|
|
5241
|
+
logprobs: z20.array(
|
|
5242
|
+
z20.object({
|
|
5243
|
+
token: z20.string(),
|
|
5244
|
+
logprob: z20.number(),
|
|
5245
|
+
top_logprobs: z20.array(
|
|
5246
|
+
z20.object({
|
|
5247
|
+
token: z20.string(),
|
|
5248
|
+
logprob: z20.number()
|
|
5028
5249
|
})
|
|
5029
5250
|
)
|
|
5030
5251
|
})
|
|
5031
5252
|
).nullish(),
|
|
5032
|
-
annotations:
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
type:
|
|
5036
|
-
start_index:
|
|
5037
|
-
end_index:
|
|
5038
|
-
url:
|
|
5039
|
-
title:
|
|
5253
|
+
annotations: z20.array(
|
|
5254
|
+
z20.discriminatedUnion("type", [
|
|
5255
|
+
z20.object({
|
|
5256
|
+
type: z20.literal("url_citation"),
|
|
5257
|
+
start_index: z20.number(),
|
|
5258
|
+
end_index: z20.number(),
|
|
5259
|
+
url: z20.string(),
|
|
5260
|
+
title: z20.string()
|
|
5040
5261
|
}),
|
|
5041
|
-
|
|
5042
|
-
type:
|
|
5043
|
-
file_id:
|
|
5044
|
-
filename:
|
|
5045
|
-
index:
|
|
5262
|
+
z20.object({
|
|
5263
|
+
type: z20.literal("file_citation"),
|
|
5264
|
+
file_id: z20.string(),
|
|
5265
|
+
filename: z20.string(),
|
|
5266
|
+
index: z20.number()
|
|
5046
5267
|
}),
|
|
5047
|
-
|
|
5048
|
-
type:
|
|
5049
|
-
container_id:
|
|
5050
|
-
file_id:
|
|
5051
|
-
filename:
|
|
5052
|
-
start_index:
|
|
5053
|
-
end_index:
|
|
5268
|
+
z20.object({
|
|
5269
|
+
type: z20.literal("container_file_citation"),
|
|
5270
|
+
container_id: z20.string(),
|
|
5271
|
+
file_id: z20.string(),
|
|
5272
|
+
filename: z20.string(),
|
|
5273
|
+
start_index: z20.number(),
|
|
5274
|
+
end_index: z20.number()
|
|
5054
5275
|
}),
|
|
5055
|
-
|
|
5056
|
-
type:
|
|
5057
|
-
file_id:
|
|
5058
|
-
index:
|
|
5276
|
+
z20.object({
|
|
5277
|
+
type: z20.literal("file_path"),
|
|
5278
|
+
file_id: z20.string(),
|
|
5279
|
+
index: z20.number()
|
|
5059
5280
|
})
|
|
5060
5281
|
])
|
|
5061
5282
|
)
|
|
5062
5283
|
})
|
|
5063
5284
|
)
|
|
5064
5285
|
}),
|
|
5065
|
-
|
|
5066
|
-
type:
|
|
5067
|
-
id:
|
|
5068
|
-
status:
|
|
5069
|
-
action:
|
|
5070
|
-
|
|
5071
|
-
type:
|
|
5072
|
-
query:
|
|
5073
|
-
queries:
|
|
5074
|
-
sources:
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
type:
|
|
5079
|
-
name:
|
|
5286
|
+
z20.object({
|
|
5287
|
+
type: z20.literal("web_search_call"),
|
|
5288
|
+
id: z20.string(),
|
|
5289
|
+
status: z20.string(),
|
|
5290
|
+
action: z20.discriminatedUnion("type", [
|
|
5291
|
+
z20.object({
|
|
5292
|
+
type: z20.literal("search"),
|
|
5293
|
+
query: z20.string().nullish(),
|
|
5294
|
+
queries: z20.array(z20.string()).nullish(),
|
|
5295
|
+
sources: z20.array(
|
|
5296
|
+
z20.discriminatedUnion("type", [
|
|
5297
|
+
z20.object({ type: z20.literal("url"), url: z20.string() }),
|
|
5298
|
+
z20.object({
|
|
5299
|
+
type: z20.literal("api"),
|
|
5300
|
+
name: z20.string()
|
|
5080
5301
|
})
|
|
5081
5302
|
])
|
|
5082
5303
|
).nullish()
|
|
5083
5304
|
}),
|
|
5084
|
-
|
|
5085
|
-
type:
|
|
5086
|
-
url:
|
|
5305
|
+
z20.object({
|
|
5306
|
+
type: z20.literal("open_page"),
|
|
5307
|
+
url: z20.string().nullish()
|
|
5087
5308
|
}),
|
|
5088
|
-
|
|
5089
|
-
type:
|
|
5090
|
-
url:
|
|
5091
|
-
pattern:
|
|
5309
|
+
z20.object({
|
|
5310
|
+
type: z20.literal("find_in_page"),
|
|
5311
|
+
url: z20.string().nullish(),
|
|
5312
|
+
pattern: z20.string().nullish()
|
|
5092
5313
|
})
|
|
5093
5314
|
]).nullish()
|
|
5094
5315
|
}),
|
|
5095
|
-
|
|
5096
|
-
type:
|
|
5097
|
-
id:
|
|
5098
|
-
queries:
|
|
5099
|
-
results:
|
|
5100
|
-
|
|
5101
|
-
attributes:
|
|
5102
|
-
|
|
5103
|
-
|
|
5316
|
+
z20.object({
|
|
5317
|
+
type: z20.literal("file_search_call"),
|
|
5318
|
+
id: z20.string(),
|
|
5319
|
+
queries: z20.array(z20.string()),
|
|
5320
|
+
results: z20.array(
|
|
5321
|
+
z20.object({
|
|
5322
|
+
attributes: z20.record(
|
|
5323
|
+
z20.string(),
|
|
5324
|
+
z20.union([z20.string(), z20.number(), z20.boolean()])
|
|
5104
5325
|
),
|
|
5105
|
-
file_id:
|
|
5106
|
-
filename:
|
|
5107
|
-
score:
|
|
5108
|
-
text:
|
|
5326
|
+
file_id: z20.string(),
|
|
5327
|
+
filename: z20.string(),
|
|
5328
|
+
score: z20.number(),
|
|
5329
|
+
text: z20.string()
|
|
5109
5330
|
})
|
|
5110
5331
|
).nullish()
|
|
5111
5332
|
}),
|
|
5112
|
-
|
|
5113
|
-
type:
|
|
5114
|
-
id:
|
|
5115
|
-
code:
|
|
5116
|
-
container_id:
|
|
5117
|
-
outputs:
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5333
|
+
z20.object({
|
|
5334
|
+
type: z20.literal("code_interpreter_call"),
|
|
5335
|
+
id: z20.string(),
|
|
5336
|
+
code: z20.string().nullable(),
|
|
5337
|
+
container_id: z20.string(),
|
|
5338
|
+
outputs: z20.array(
|
|
5339
|
+
z20.discriminatedUnion("type", [
|
|
5340
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
5341
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
5121
5342
|
])
|
|
5122
5343
|
).nullable()
|
|
5123
5344
|
}),
|
|
5124
|
-
|
|
5125
|
-
type:
|
|
5126
|
-
id:
|
|
5127
|
-
result:
|
|
5345
|
+
z20.object({
|
|
5346
|
+
type: z20.literal("image_generation_call"),
|
|
5347
|
+
id: z20.string(),
|
|
5348
|
+
result: z20.string()
|
|
5128
5349
|
}),
|
|
5129
5350
|
openaiResponsesLocalShellCallSchema,
|
|
5130
|
-
|
|
5131
|
-
type:
|
|
5132
|
-
call_id:
|
|
5133
|
-
name:
|
|
5134
|
-
arguments:
|
|
5135
|
-
id:
|
|
5136
|
-
async:
|
|
5137
|
-
namespace:
|
|
5351
|
+
z20.object({
|
|
5352
|
+
type: z20.literal("function_call"),
|
|
5353
|
+
call_id: z20.string(),
|
|
5354
|
+
name: z20.string(),
|
|
5355
|
+
arguments: z20.string(),
|
|
5356
|
+
id: z20.string(),
|
|
5357
|
+
async: z20.boolean().nullish(),
|
|
5358
|
+
namespace: z20.string().nullish()
|
|
5138
5359
|
}),
|
|
5139
|
-
|
|
5140
|
-
type:
|
|
5141
|
-
call_id:
|
|
5142
|
-
name:
|
|
5143
|
-
input:
|
|
5144
|
-
id:
|
|
5145
|
-
async:
|
|
5360
|
+
z20.object({
|
|
5361
|
+
type: z20.literal("custom_tool_call"),
|
|
5362
|
+
call_id: z20.string(),
|
|
5363
|
+
name: z20.string(),
|
|
5364
|
+
input: z20.string(),
|
|
5365
|
+
id: z20.string(),
|
|
5366
|
+
async: z20.boolean().nullish()
|
|
5146
5367
|
}),
|
|
5147
|
-
|
|
5148
|
-
type:
|
|
5149
|
-
id:
|
|
5150
|
-
status:
|
|
5368
|
+
z20.object({
|
|
5369
|
+
type: z20.literal("computer_call"),
|
|
5370
|
+
id: z20.string(),
|
|
5371
|
+
status: z20.string().optional()
|
|
5151
5372
|
}),
|
|
5152
|
-
|
|
5153
|
-
type:
|
|
5154
|
-
id:
|
|
5155
|
-
encrypted_content:
|
|
5156
|
-
summary:
|
|
5157
|
-
|
|
5158
|
-
type:
|
|
5159
|
-
text:
|
|
5373
|
+
z20.object({
|
|
5374
|
+
type: z20.literal("reasoning"),
|
|
5375
|
+
id: z20.string(),
|
|
5376
|
+
encrypted_content: z20.string().nullish(),
|
|
5377
|
+
summary: z20.array(
|
|
5378
|
+
z20.object({
|
|
5379
|
+
type: z20.literal("summary_text"),
|
|
5380
|
+
text: z20.string()
|
|
5160
5381
|
})
|
|
5161
5382
|
)
|
|
5162
5383
|
}),
|
|
5163
|
-
|
|
5164
|
-
type:
|
|
5165
|
-
id:
|
|
5166
|
-
status:
|
|
5167
|
-
arguments:
|
|
5168
|
-
name:
|
|
5169
|
-
server_label:
|
|
5170
|
-
output:
|
|
5171
|
-
error:
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
type:
|
|
5175
|
-
code:
|
|
5176
|
-
message:
|
|
5384
|
+
z20.object({
|
|
5385
|
+
type: z20.literal("mcp_call"),
|
|
5386
|
+
id: z20.string(),
|
|
5387
|
+
status: z20.string(),
|
|
5388
|
+
arguments: z20.string(),
|
|
5389
|
+
name: z20.string(),
|
|
5390
|
+
server_label: z20.string(),
|
|
5391
|
+
output: z20.string().nullish(),
|
|
5392
|
+
error: z20.union([
|
|
5393
|
+
z20.string(),
|
|
5394
|
+
z20.object({
|
|
5395
|
+
type: z20.string().optional(),
|
|
5396
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
5397
|
+
message: z20.string().optional()
|
|
5177
5398
|
}).loose()
|
|
5178
5399
|
]).nullish(),
|
|
5179
|
-
approval_request_id:
|
|
5400
|
+
approval_request_id: z20.string().nullish()
|
|
5180
5401
|
}),
|
|
5181
|
-
|
|
5182
|
-
type:
|
|
5183
|
-
id:
|
|
5184
|
-
server_label:
|
|
5185
|
-
tools:
|
|
5186
|
-
|
|
5187
|
-
name:
|
|
5188
|
-
description:
|
|
5189
|
-
input_schema:
|
|
5190
|
-
annotations:
|
|
5402
|
+
z20.object({
|
|
5403
|
+
type: z20.literal("mcp_list_tools"),
|
|
5404
|
+
id: z20.string(),
|
|
5405
|
+
server_label: z20.string(),
|
|
5406
|
+
tools: z20.array(
|
|
5407
|
+
z20.object({
|
|
5408
|
+
name: z20.string(),
|
|
5409
|
+
description: z20.string().optional(),
|
|
5410
|
+
input_schema: z20.any(),
|
|
5411
|
+
annotations: z20.record(z20.string(), z20.unknown()).optional()
|
|
5191
5412
|
})
|
|
5192
5413
|
),
|
|
5193
|
-
error:
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
type:
|
|
5197
|
-
code:
|
|
5198
|
-
message:
|
|
5414
|
+
error: z20.union([
|
|
5415
|
+
z20.string(),
|
|
5416
|
+
z20.object({
|
|
5417
|
+
type: z20.string().optional(),
|
|
5418
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
5419
|
+
message: z20.string().optional()
|
|
5199
5420
|
}).loose()
|
|
5200
5421
|
]).optional()
|
|
5201
5422
|
}),
|
|
5202
|
-
|
|
5203
|
-
type:
|
|
5204
|
-
id:
|
|
5205
|
-
server_label:
|
|
5206
|
-
name:
|
|
5207
|
-
arguments:
|
|
5208
|
-
approval_request_id:
|
|
5423
|
+
z20.object({
|
|
5424
|
+
type: z20.literal("mcp_approval_request"),
|
|
5425
|
+
id: z20.string(),
|
|
5426
|
+
server_label: z20.string(),
|
|
5427
|
+
name: z20.string(),
|
|
5428
|
+
arguments: z20.string(),
|
|
5429
|
+
approval_request_id: z20.string().optional()
|
|
5209
5430
|
}),
|
|
5210
|
-
|
|
5211
|
-
type:
|
|
5212
|
-
id:
|
|
5213
|
-
call_id:
|
|
5214
|
-
status:
|
|
5215
|
-
operation:
|
|
5216
|
-
|
|
5217
|
-
type:
|
|
5218
|
-
path:
|
|
5219
|
-
diff:
|
|
5431
|
+
z20.object({
|
|
5432
|
+
type: z20.literal("apply_patch_call"),
|
|
5433
|
+
id: z20.string(),
|
|
5434
|
+
call_id: z20.string(),
|
|
5435
|
+
status: z20.enum(["in_progress", "completed"]),
|
|
5436
|
+
operation: z20.discriminatedUnion("type", [
|
|
5437
|
+
z20.object({
|
|
5438
|
+
type: z20.literal("create_file"),
|
|
5439
|
+
path: z20.string(),
|
|
5440
|
+
diff: z20.string()
|
|
5220
5441
|
}),
|
|
5221
|
-
|
|
5222
|
-
type:
|
|
5223
|
-
path:
|
|
5442
|
+
z20.object({
|
|
5443
|
+
type: z20.literal("delete_file"),
|
|
5444
|
+
path: z20.string()
|
|
5224
5445
|
}),
|
|
5225
|
-
|
|
5226
|
-
type:
|
|
5227
|
-
path:
|
|
5228
|
-
diff:
|
|
5446
|
+
z20.object({
|
|
5447
|
+
type: z20.literal("update_file"),
|
|
5448
|
+
path: z20.string(),
|
|
5449
|
+
diff: z20.string()
|
|
5229
5450
|
})
|
|
5230
5451
|
])
|
|
5231
5452
|
}),
|
|
5232
|
-
|
|
5233
|
-
type:
|
|
5234
|
-
id:
|
|
5235
|
-
call_id:
|
|
5236
|
-
status:
|
|
5237
|
-
action:
|
|
5238
|
-
commands:
|
|
5453
|
+
z20.object({
|
|
5454
|
+
type: z20.literal("shell_call"),
|
|
5455
|
+
id: z20.string(),
|
|
5456
|
+
call_id: z20.string(),
|
|
5457
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5458
|
+
action: z20.object({
|
|
5459
|
+
commands: z20.array(z20.string())
|
|
5239
5460
|
})
|
|
5240
5461
|
}),
|
|
5241
|
-
|
|
5242
|
-
type:
|
|
5243
|
-
id:
|
|
5244
|
-
call_id:
|
|
5245
|
-
status:
|
|
5246
|
-
output:
|
|
5247
|
-
|
|
5248
|
-
stdout:
|
|
5249
|
-
stderr:
|
|
5250
|
-
outcome:
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
type:
|
|
5254
|
-
exit_code:
|
|
5462
|
+
z20.object({
|
|
5463
|
+
type: z20.literal("shell_call_output"),
|
|
5464
|
+
id: z20.string(),
|
|
5465
|
+
call_id: z20.string(),
|
|
5466
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5467
|
+
output: z20.array(
|
|
5468
|
+
z20.object({
|
|
5469
|
+
stdout: z20.string(),
|
|
5470
|
+
stderr: z20.string(),
|
|
5471
|
+
outcome: z20.discriminatedUnion("type", [
|
|
5472
|
+
z20.object({ type: z20.literal("timeout") }),
|
|
5473
|
+
z20.object({
|
|
5474
|
+
type: z20.literal("exit"),
|
|
5475
|
+
exit_code: z20.number()
|
|
5255
5476
|
})
|
|
5256
5477
|
])
|
|
5257
5478
|
})
|
|
5258
5479
|
)
|
|
5259
5480
|
}),
|
|
5260
|
-
|
|
5261
|
-
type:
|
|
5262
|
-
id:
|
|
5263
|
-
execution:
|
|
5264
|
-
call_id:
|
|
5265
|
-
status:
|
|
5266
|
-
arguments:
|
|
5481
|
+
z20.object({
|
|
5482
|
+
type: z20.literal("tool_search_call"),
|
|
5483
|
+
id: z20.string(),
|
|
5484
|
+
execution: z20.enum(["server", "client"]),
|
|
5485
|
+
call_id: z20.string().nullable(),
|
|
5486
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5487
|
+
arguments: z20.unknown()
|
|
5267
5488
|
}),
|
|
5268
|
-
|
|
5269
|
-
type:
|
|
5270
|
-
id:
|
|
5271
|
-
execution:
|
|
5272
|
-
call_id:
|
|
5273
|
-
status:
|
|
5274
|
-
tools:
|
|
5489
|
+
z20.object({
|
|
5490
|
+
type: z20.literal("tool_search_output"),
|
|
5491
|
+
id: z20.string(),
|
|
5492
|
+
execution: z20.enum(["server", "client"]),
|
|
5493
|
+
call_id: z20.string().nullable(),
|
|
5494
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5495
|
+
tools: z20.array(z20.record(z20.string(), jsonValueSchema.optional()))
|
|
5275
5496
|
})
|
|
5276
5497
|
])
|
|
5277
5498
|
).optional(),
|
|
5278
|
-
service_tier:
|
|
5279
|
-
reasoning:
|
|
5280
|
-
context:
|
|
5499
|
+
service_tier: z20.string().nullish(),
|
|
5500
|
+
reasoning: z20.object({
|
|
5501
|
+
context: z20.string().nullish()
|
|
5281
5502
|
}).nullish(),
|
|
5282
|
-
incomplete_details:
|
|
5503
|
+
incomplete_details: z20.object({ reason: z20.string() }).nullish(),
|
|
5283
5504
|
usage: openaiResponsesUsageSchema.nullish()
|
|
5284
5505
|
})
|
|
5285
5506
|
)
|
|
@@ -5293,44 +5514,44 @@ import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
|
|
|
5293
5514
|
|
|
5294
5515
|
// src/tool/code-interpreter.ts
|
|
5295
5516
|
import {
|
|
5296
|
-
createProviderToolFactoryWithOutputSchema as
|
|
5297
|
-
lazySchema as
|
|
5298
|
-
zodSchema as
|
|
5517
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
5518
|
+
lazySchema as lazySchema19,
|
|
5519
|
+
zodSchema as zodSchema19
|
|
5299
5520
|
} from "@ai-sdk/provider-utils";
|
|
5300
|
-
import { z as
|
|
5301
|
-
var codeInterpreterInputSchema =
|
|
5302
|
-
() =>
|
|
5303
|
-
|
|
5304
|
-
code:
|
|
5305
|
-
containerId:
|
|
5521
|
+
import { z as z21 } from "zod/v4";
|
|
5522
|
+
var codeInterpreterInputSchema = lazySchema19(
|
|
5523
|
+
() => zodSchema19(
|
|
5524
|
+
z21.object({
|
|
5525
|
+
code: z21.string().nullish(),
|
|
5526
|
+
containerId: z21.string()
|
|
5306
5527
|
})
|
|
5307
5528
|
)
|
|
5308
5529
|
);
|
|
5309
|
-
var codeInterpreterOutputSchema =
|
|
5310
|
-
() =>
|
|
5311
|
-
|
|
5312
|
-
outputs:
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5530
|
+
var codeInterpreterOutputSchema = lazySchema19(
|
|
5531
|
+
() => zodSchema19(
|
|
5532
|
+
z21.object({
|
|
5533
|
+
outputs: z21.array(
|
|
5534
|
+
z21.discriminatedUnion("type", [
|
|
5535
|
+
z21.object({ type: z21.literal("logs"), logs: z21.string() }),
|
|
5536
|
+
z21.object({ type: z21.literal("image"), url: z21.string() })
|
|
5316
5537
|
])
|
|
5317
5538
|
).nullish()
|
|
5318
5539
|
})
|
|
5319
5540
|
)
|
|
5320
5541
|
);
|
|
5321
|
-
var codeInterpreterArgsSchema =
|
|
5322
|
-
() =>
|
|
5323
|
-
|
|
5324
|
-
container:
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
fileIds:
|
|
5542
|
+
var codeInterpreterArgsSchema = lazySchema19(
|
|
5543
|
+
() => zodSchema19(
|
|
5544
|
+
z21.object({
|
|
5545
|
+
container: z21.union([
|
|
5546
|
+
z21.string(),
|
|
5547
|
+
z21.object({
|
|
5548
|
+
fileIds: z21.array(z21.string()).optional()
|
|
5328
5549
|
})
|
|
5329
5550
|
]).optional()
|
|
5330
5551
|
})
|
|
5331
5552
|
)
|
|
5332
5553
|
);
|
|
5333
|
-
var codeInterpreterToolFactory =
|
|
5554
|
+
var codeInterpreterToolFactory = createProviderToolFactoryWithOutputSchema6({
|
|
5334
5555
|
id: "openai.code_interpreter",
|
|
5335
5556
|
inputSchema: codeInterpreterInputSchema,
|
|
5336
5557
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -5341,88 +5562,88 @@ var codeInterpreter = (args = {}) => {
|
|
|
5341
5562
|
|
|
5342
5563
|
// src/tool/file-search.ts
|
|
5343
5564
|
import {
|
|
5344
|
-
createProviderToolFactoryWithOutputSchema as
|
|
5345
|
-
lazySchema as
|
|
5346
|
-
zodSchema as
|
|
5565
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
5566
|
+
lazySchema as lazySchema20,
|
|
5567
|
+
zodSchema as zodSchema20
|
|
5347
5568
|
} from "@ai-sdk/provider-utils";
|
|
5348
|
-
import { z as
|
|
5349
|
-
var comparisonFilterSchema =
|
|
5350
|
-
key:
|
|
5351
|
-
type:
|
|
5352
|
-
value:
|
|
5569
|
+
import { z as z22 } from "zod/v4";
|
|
5570
|
+
var comparisonFilterSchema = z22.object({
|
|
5571
|
+
key: z22.string(),
|
|
5572
|
+
type: z22.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
5573
|
+
value: z22.union([z22.string(), z22.number(), z22.boolean(), z22.array(z22.string())])
|
|
5353
5574
|
});
|
|
5354
|
-
var compoundFilterSchema =
|
|
5355
|
-
type:
|
|
5356
|
-
filters:
|
|
5357
|
-
|
|
5575
|
+
var compoundFilterSchema = z22.object({
|
|
5576
|
+
type: z22.enum(["and", "or"]),
|
|
5577
|
+
filters: z22.array(
|
|
5578
|
+
z22.union([comparisonFilterSchema, z22.lazy(() => compoundFilterSchema)])
|
|
5358
5579
|
)
|
|
5359
5580
|
});
|
|
5360
|
-
var fileSearchArgsSchema =
|
|
5361
|
-
() =>
|
|
5362
|
-
|
|
5363
|
-
vectorStoreIds:
|
|
5364
|
-
maxNumResults:
|
|
5365
|
-
ranking:
|
|
5366
|
-
ranker:
|
|
5367
|
-
scoreThreshold:
|
|
5581
|
+
var fileSearchArgsSchema = lazySchema20(
|
|
5582
|
+
() => zodSchema20(
|
|
5583
|
+
z22.object({
|
|
5584
|
+
vectorStoreIds: z22.array(z22.string()),
|
|
5585
|
+
maxNumResults: z22.number().optional(),
|
|
5586
|
+
ranking: z22.object({
|
|
5587
|
+
ranker: z22.string().optional(),
|
|
5588
|
+
scoreThreshold: z22.number().optional()
|
|
5368
5589
|
}).optional(),
|
|
5369
|
-
filters:
|
|
5590
|
+
filters: z22.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
5370
5591
|
})
|
|
5371
5592
|
)
|
|
5372
5593
|
);
|
|
5373
|
-
var fileSearchOutputSchema =
|
|
5374
|
-
() =>
|
|
5375
|
-
|
|
5376
|
-
queries:
|
|
5377
|
-
results:
|
|
5378
|
-
|
|
5379
|
-
attributes:
|
|
5380
|
-
fileId:
|
|
5381
|
-
filename:
|
|
5382
|
-
score:
|
|
5383
|
-
text:
|
|
5594
|
+
var fileSearchOutputSchema = lazySchema20(
|
|
5595
|
+
() => zodSchema20(
|
|
5596
|
+
z22.object({
|
|
5597
|
+
queries: z22.array(z22.string()),
|
|
5598
|
+
results: z22.array(
|
|
5599
|
+
z22.object({
|
|
5600
|
+
attributes: z22.record(z22.string(), z22.unknown()),
|
|
5601
|
+
fileId: z22.string(),
|
|
5602
|
+
filename: z22.string(),
|
|
5603
|
+
score: z22.number(),
|
|
5604
|
+
text: z22.string()
|
|
5384
5605
|
})
|
|
5385
5606
|
).nullable()
|
|
5386
5607
|
})
|
|
5387
5608
|
)
|
|
5388
5609
|
);
|
|
5389
|
-
var fileSearch =
|
|
5610
|
+
var fileSearch = createProviderToolFactoryWithOutputSchema7({
|
|
5390
5611
|
id: "openai.file_search",
|
|
5391
|
-
inputSchema:
|
|
5612
|
+
inputSchema: z22.object({}),
|
|
5392
5613
|
outputSchema: fileSearchOutputSchema
|
|
5393
5614
|
});
|
|
5394
5615
|
|
|
5395
5616
|
// src/tool/image-generation.ts
|
|
5396
5617
|
import {
|
|
5397
|
-
createProviderToolFactoryWithOutputSchema as
|
|
5398
|
-
lazySchema as
|
|
5399
|
-
zodSchema as
|
|
5618
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
5619
|
+
lazySchema as lazySchema21,
|
|
5620
|
+
zodSchema as zodSchema21
|
|
5400
5621
|
} from "@ai-sdk/provider-utils";
|
|
5401
|
-
import { z as
|
|
5402
|
-
var imageGenerationArgsSchema =
|
|
5403
|
-
() =>
|
|
5404
|
-
|
|
5405
|
-
background:
|
|
5406
|
-
inputFidelity:
|
|
5407
|
-
inputImageMask:
|
|
5408
|
-
fileId:
|
|
5409
|
-
imageUrl:
|
|
5622
|
+
import { z as z23 } from "zod/v4";
|
|
5623
|
+
var imageGenerationArgsSchema = lazySchema21(
|
|
5624
|
+
() => zodSchema21(
|
|
5625
|
+
z23.object({
|
|
5626
|
+
background: z23.enum(["auto", "opaque", "transparent"]).optional(),
|
|
5627
|
+
inputFidelity: z23.enum(["low", "high"]).optional(),
|
|
5628
|
+
inputImageMask: z23.object({
|
|
5629
|
+
fileId: z23.string().optional(),
|
|
5630
|
+
imageUrl: z23.string().optional()
|
|
5410
5631
|
}).optional(),
|
|
5411
|
-
model:
|
|
5412
|
-
moderation:
|
|
5413
|
-
outputCompression:
|
|
5414
|
-
outputFormat:
|
|
5415
|
-
partialImages:
|
|
5416
|
-
quality:
|
|
5417
|
-
size:
|
|
5632
|
+
model: z23.string().optional(),
|
|
5633
|
+
moderation: z23.enum(["auto"]).optional(),
|
|
5634
|
+
outputCompression: z23.number().int().min(0).max(100).optional(),
|
|
5635
|
+
outputFormat: z23.enum(["png", "jpeg", "webp"]).optional(),
|
|
5636
|
+
partialImages: z23.number().int().min(0).max(3).optional(),
|
|
5637
|
+
quality: z23.enum(["auto", "low", "medium", "high", "xhigh", "max"]).optional(),
|
|
5638
|
+
size: z23.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
5418
5639
|
}).strict()
|
|
5419
5640
|
)
|
|
5420
5641
|
);
|
|
5421
|
-
var imageGenerationInputSchema =
|
|
5422
|
-
var imageGenerationOutputSchema =
|
|
5423
|
-
() =>
|
|
5642
|
+
var imageGenerationInputSchema = lazySchema21(() => zodSchema21(z23.object({})));
|
|
5643
|
+
var imageGenerationOutputSchema = lazySchema21(
|
|
5644
|
+
() => zodSchema21(z23.object({ result: z23.string() }))
|
|
5424
5645
|
);
|
|
5425
|
-
var imageGenerationToolFactory =
|
|
5646
|
+
var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
5426
5647
|
id: "openai.image_generation",
|
|
5427
5648
|
inputSchema: imageGenerationInputSchema,
|
|
5428
5649
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -5434,30 +5655,30 @@ var imageGeneration = (args = {}) => {
|
|
|
5434
5655
|
// src/tool/custom.ts
|
|
5435
5656
|
import {
|
|
5436
5657
|
createProviderToolFactory,
|
|
5437
|
-
lazySchema as
|
|
5438
|
-
zodSchema as
|
|
5658
|
+
lazySchema as lazySchema22,
|
|
5659
|
+
zodSchema as zodSchema22
|
|
5439
5660
|
} from "@ai-sdk/provider-utils";
|
|
5440
|
-
import { z as
|
|
5441
|
-
var customArgsSchema =
|
|
5442
|
-
() =>
|
|
5443
|
-
|
|
5444
|
-
name:
|
|
5445
|
-
description:
|
|
5446
|
-
async:
|
|
5447
|
-
format:
|
|
5448
|
-
|
|
5449
|
-
type:
|
|
5450
|
-
syntax:
|
|
5451
|
-
definition:
|
|
5661
|
+
import { z as z24 } from "zod/v4";
|
|
5662
|
+
var customArgsSchema = lazySchema22(
|
|
5663
|
+
() => zodSchema22(
|
|
5664
|
+
z24.object({
|
|
5665
|
+
name: z24.string(),
|
|
5666
|
+
description: z24.string().optional(),
|
|
5667
|
+
async: z24.boolean().optional(),
|
|
5668
|
+
format: z24.union([
|
|
5669
|
+
z24.object({
|
|
5670
|
+
type: z24.literal("grammar"),
|
|
5671
|
+
syntax: z24.enum(["regex", "lark"]),
|
|
5672
|
+
definition: z24.string()
|
|
5452
5673
|
}),
|
|
5453
|
-
|
|
5454
|
-
type:
|
|
5674
|
+
z24.object({
|
|
5675
|
+
type: z24.literal("text")
|
|
5455
5676
|
})
|
|
5456
5677
|
]).optional()
|
|
5457
5678
|
})
|
|
5458
5679
|
)
|
|
5459
5680
|
);
|
|
5460
|
-
var customInputSchema =
|
|
5681
|
+
var customInputSchema = lazySchema22(() => zodSchema22(z24.string()));
|
|
5461
5682
|
var customToolFactory = createProviderToolFactory({
|
|
5462
5683
|
id: "openai.custom",
|
|
5463
5684
|
inputSchema: customInputSchema
|
|
@@ -5465,132 +5686,70 @@ var customToolFactory = createProviderToolFactory({
|
|
|
5465
5686
|
|
|
5466
5687
|
// src/tool/mcp.ts
|
|
5467
5688
|
import {
|
|
5468
|
-
createProviderToolFactoryWithOutputSchema as
|
|
5469
|
-
lazySchema as
|
|
5470
|
-
zodSchema as
|
|
5689
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
5690
|
+
lazySchema as lazySchema23,
|
|
5691
|
+
zodSchema as zodSchema23
|
|
5471
5692
|
} from "@ai-sdk/provider-utils";
|
|
5472
|
-
import { z as
|
|
5473
|
-
var jsonValueSchema2 =
|
|
5474
|
-
() =>
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5693
|
+
import { z as z25 } from "zod/v4";
|
|
5694
|
+
var jsonValueSchema2 = z25.lazy(
|
|
5695
|
+
() => z25.union([
|
|
5696
|
+
z25.string(),
|
|
5697
|
+
z25.number(),
|
|
5698
|
+
z25.boolean(),
|
|
5699
|
+
z25.null(),
|
|
5700
|
+
z25.array(jsonValueSchema2),
|
|
5701
|
+
z25.record(z25.string(), jsonValueSchema2)
|
|
5481
5702
|
])
|
|
5482
5703
|
);
|
|
5483
|
-
var mcpArgsSchema =
|
|
5484
|
-
() =>
|
|
5485
|
-
|
|
5486
|
-
serverLabel:
|
|
5487
|
-
allowedTools:
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
readOnly:
|
|
5491
|
-
toolNames:
|
|
5704
|
+
var mcpArgsSchema = lazySchema23(
|
|
5705
|
+
() => zodSchema23(
|
|
5706
|
+
z25.object({
|
|
5707
|
+
serverLabel: z25.string(),
|
|
5708
|
+
allowedTools: z25.union([
|
|
5709
|
+
z25.array(z25.string()),
|
|
5710
|
+
z25.object({
|
|
5711
|
+
readOnly: z25.boolean().optional(),
|
|
5712
|
+
toolNames: z25.array(z25.string()).optional()
|
|
5492
5713
|
})
|
|
5493
5714
|
]).optional(),
|
|
5494
|
-
authorization:
|
|
5495
|
-
connectorId:
|
|
5496
|
-
headers:
|
|
5497
|
-
requireApproval:
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
never:
|
|
5501
|
-
toolNames:
|
|
5715
|
+
authorization: z25.string().optional(),
|
|
5716
|
+
connectorId: z25.string().optional(),
|
|
5717
|
+
headers: z25.record(z25.string(), z25.string()).optional(),
|
|
5718
|
+
requireApproval: z25.union([
|
|
5719
|
+
z25.enum(["always", "never"]),
|
|
5720
|
+
z25.object({
|
|
5721
|
+
never: z25.object({
|
|
5722
|
+
toolNames: z25.array(z25.string()).optional()
|
|
5502
5723
|
}).optional()
|
|
5503
5724
|
})
|
|
5504
5725
|
]).optional(),
|
|
5505
|
-
serverDescription:
|
|
5506
|
-
serverUrl:
|
|
5726
|
+
serverDescription: z25.string().optional(),
|
|
5727
|
+
serverUrl: z25.string().optional()
|
|
5507
5728
|
}).refine(
|
|
5508
5729
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
5509
5730
|
"One of serverUrl or connectorId must be provided."
|
|
5510
5731
|
)
|
|
5511
5732
|
)
|
|
5512
5733
|
);
|
|
5513
|
-
var mcpInputSchema =
|
|
5514
|
-
var mcpOutputSchema =
|
|
5515
|
-
() =>
|
|
5516
|
-
|
|
5517
|
-
type:
|
|
5518
|
-
serverLabel:
|
|
5519
|
-
name:
|
|
5520
|
-
arguments:
|
|
5521
|
-
output:
|
|
5522
|
-
error:
|
|
5734
|
+
var mcpInputSchema = lazySchema23(() => zodSchema23(z25.object({})));
|
|
5735
|
+
var mcpOutputSchema = lazySchema23(
|
|
5736
|
+
() => zodSchema23(
|
|
5737
|
+
z25.object({
|
|
5738
|
+
type: z25.literal("call"),
|
|
5739
|
+
serverLabel: z25.string(),
|
|
5740
|
+
name: z25.string(),
|
|
5741
|
+
arguments: z25.string(),
|
|
5742
|
+
output: z25.string().nullish(),
|
|
5743
|
+
error: z25.union([z25.string(), jsonValueSchema2]).optional()
|
|
5523
5744
|
})
|
|
5524
5745
|
)
|
|
5525
5746
|
);
|
|
5526
|
-
var mcpToolFactory =
|
|
5747
|
+
var mcpToolFactory = createProviderToolFactoryWithOutputSchema9({
|
|
5527
5748
|
id: "openai.mcp",
|
|
5528
5749
|
inputSchema: mcpInputSchema,
|
|
5529
5750
|
outputSchema: mcpOutputSchema
|
|
5530
5751
|
});
|
|
5531
5752
|
|
|
5532
|
-
// src/tool/web-search.ts
|
|
5533
|
-
import {
|
|
5534
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
5535
|
-
lazySchema as lazySchema23,
|
|
5536
|
-
zodSchema as zodSchema23
|
|
5537
|
-
} from "@ai-sdk/provider-utils";
|
|
5538
|
-
import { z as z25 } from "zod/v4";
|
|
5539
|
-
var webSearchArgsSchema = lazySchema23(
|
|
5540
|
-
() => zodSchema23(
|
|
5541
|
-
z25.object({
|
|
5542
|
-
externalWebAccess: z25.boolean().optional(),
|
|
5543
|
-
filters: z25.object({
|
|
5544
|
-
allowedDomains: z25.array(z25.string()).optional(),
|
|
5545
|
-
blockedDomains: z25.array(z25.string()).optional()
|
|
5546
|
-
}).optional(),
|
|
5547
|
-
searchContextSize: z25.enum(["low", "medium", "high"]).optional(),
|
|
5548
|
-
userLocation: z25.object({
|
|
5549
|
-
type: z25.literal("approximate"),
|
|
5550
|
-
country: z25.string().optional(),
|
|
5551
|
-
city: z25.string().optional(),
|
|
5552
|
-
region: z25.string().optional(),
|
|
5553
|
-
timezone: z25.string().optional()
|
|
5554
|
-
}).optional()
|
|
5555
|
-
})
|
|
5556
|
-
)
|
|
5557
|
-
);
|
|
5558
|
-
var webSearchInputSchema = lazySchema23(() => zodSchema23(z25.object({})));
|
|
5559
|
-
var webSearchOutputSchema = lazySchema23(
|
|
5560
|
-
() => zodSchema23(
|
|
5561
|
-
z25.object({
|
|
5562
|
-
action: z25.discriminatedUnion("type", [
|
|
5563
|
-
z25.object({
|
|
5564
|
-
type: z25.literal("search"),
|
|
5565
|
-
query: z25.string().optional(),
|
|
5566
|
-
queries: z25.array(z25.string()).optional()
|
|
5567
|
-
}),
|
|
5568
|
-
z25.object({
|
|
5569
|
-
type: z25.literal("openPage"),
|
|
5570
|
-
url: z25.string().nullish()
|
|
5571
|
-
}),
|
|
5572
|
-
z25.object({
|
|
5573
|
-
type: z25.literal("findInPage"),
|
|
5574
|
-
url: z25.string().nullish(),
|
|
5575
|
-
pattern: z25.string().nullish()
|
|
5576
|
-
})
|
|
5577
|
-
]).optional(),
|
|
5578
|
-
sources: z25.array(
|
|
5579
|
-
z25.discriminatedUnion("type", [
|
|
5580
|
-
z25.object({ type: z25.literal("url"), url: z25.string() }),
|
|
5581
|
-
z25.object({ type: z25.literal("api"), name: z25.string() })
|
|
5582
|
-
])
|
|
5583
|
-
).optional()
|
|
5584
|
-
})
|
|
5585
|
-
)
|
|
5586
|
-
);
|
|
5587
|
-
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema9({
|
|
5588
|
-
id: "openai.web_search",
|
|
5589
|
-
inputSchema: webSearchInputSchema,
|
|
5590
|
-
outputSchema: webSearchOutputSchema
|
|
5591
|
-
});
|
|
5592
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
5593
|
-
|
|
5594
5753
|
// src/tool/web-search-preview.ts
|
|
5595
5754
|
import {
|
|
5596
5755
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
@@ -6350,7 +6509,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6350
6509
|
strict: strictJsonSchema,
|
|
6351
6510
|
name: (_h = responseFormat.name) != null ? _h : "response",
|
|
6352
6511
|
description: responseFormat.description,
|
|
6353
|
-
schema: responseFormat.schema
|
|
6512
|
+
schema: normalizeOpenAIJsonSchema(responseFormat.schema)
|
|
6354
6513
|
} : { type: "json_object" }
|
|
6355
6514
|
},
|
|
6356
6515
|
...(openaiOptions == null ? void 0 : openaiOptions.textVerbosity) && {
|