@ai-sdk/openai 4.0.18 → 4.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +60 -3
- package/dist/index.js +1111 -885
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +67 -2
- package/dist/internal/index.js +1247 -1022
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +62 -0
- package/package.json +1 -1
- package/src/image/openai-image-model-options.ts +8 -7
- package/src/image/openai-image-model.ts +2 -2
- package/src/index.ts +1 -0
- package/src/internal/index.ts +1 -0
- package/src/openai-language-model-capabilities.ts +47 -22
- package/src/openai-tools.ts +7 -0
- package/src/responses/convert-to-openai-responses-input.ts +86 -0
- package/src/responses/openai-responses-api.ts +63 -1
- package/src/responses/openai-responses-language-model.ts +103 -0
- package/src/responses/openai-responses-prepare-tools.ts +20 -2
- package/src/tool/programmatic-tool-calling.ts +57 -0
package/dist/internal/index.js
CHANGED
|
@@ -34,10 +34,15 @@ var openaiFailedResponseHandler = createJsonErrorResponseHandler({
|
|
|
34
34
|
|
|
35
35
|
// src/openai-language-model-capabilities.ts
|
|
36
36
|
function getOpenAILanguageModelCapabilities(modelId) {
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
37
|
+
var _a, _b, _c, _d, _e;
|
|
38
|
+
const oSeriesVersion = getOSeriesVersion(modelId);
|
|
39
|
+
const gptVersion = getGptVersion(modelId);
|
|
40
|
+
const isGptChatModel = (gptVersion == null ? void 0 : gptVersion.minor) == null && ((_b = (_a = gptVersion == null ? void 0 : gptVersion.variant) == null ? void 0 : _a.startsWith("chat")) != null ? _b : false);
|
|
41
|
+
const isGptNanoModel = (_d = (_c = gptVersion == null ? void 0 : gptVersion.variant) == null ? void 0 : _c.startsWith("nano")) != null ? _d : false;
|
|
42
|
+
const supportsFlexProcessing = oSeriesVersion != null && oSeriesVersion >= 3 || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;
|
|
43
|
+
const supportsPriorityProcessing = modelId.startsWith("gpt-4") || gptVersion != null && gptVersion.major >= 5 && !isGptNanoModel && !isGptChatModel || oSeriesVersion != null && oSeriesVersion >= 3;
|
|
44
|
+
const isReasoningModel = oSeriesVersion != null || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;
|
|
45
|
+
const supportsNonReasoningParameters = gptVersion != null && (gptVersion.major > 5 || gptVersion.major === 5 && ((_e = gptVersion.minor) != null ? _e : 0) >= 1);
|
|
41
46
|
const systemMessageMode = isReasoningModel ? "developer" : "system";
|
|
42
47
|
return {
|
|
43
48
|
supportsFlexProcessing,
|
|
@@ -47,6 +52,21 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
47
52
|
supportsNonReasoningParameters
|
|
48
53
|
};
|
|
49
54
|
}
|
|
55
|
+
function getOSeriesVersion(modelId) {
|
|
56
|
+
const match = /^o(\d+)(?:-|$)/.exec(modelId);
|
|
57
|
+
return match == null ? void 0 : Number(match[1]);
|
|
58
|
+
}
|
|
59
|
+
function getGptVersion(modelId) {
|
|
60
|
+
const match = /^gpt-(\d+)(?:\.(\d+))?(?:-(.+))?$/.exec(modelId);
|
|
61
|
+
if (match == null) {
|
|
62
|
+
return void 0;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
major: Number(match[1]),
|
|
66
|
+
minor: match[2] == null ? void 0 : Number(match[2]),
|
|
67
|
+
variant: match[3]
|
|
68
|
+
};
|
|
69
|
+
}
|
|
50
70
|
|
|
51
71
|
// src/openai-stream-error.ts
|
|
52
72
|
import { APICallError } from "@ai-sdk/provider";
|
|
@@ -2016,18 +2036,16 @@ var modelMaxImagesPerCall = {
|
|
|
2016
2036
|
"gpt-image-2": 10,
|
|
2017
2037
|
"chatgpt-image-latest": 10
|
|
2018
2038
|
};
|
|
2019
|
-
var defaultResponseFormatPrefixes = [
|
|
2020
|
-
"chatgpt-image-",
|
|
2021
|
-
"gpt-image-1-mini",
|
|
2022
|
-
"gpt-image-1.5",
|
|
2023
|
-
"gpt-image-1",
|
|
2024
|
-
"gpt-image-2"
|
|
2025
|
-
];
|
|
2039
|
+
var defaultResponseFormatPrefixes = ["chatgpt-image-", "gpt-image-"];
|
|
2026
2040
|
function hasDefaultResponseFormat(modelId) {
|
|
2027
2041
|
return defaultResponseFormatPrefixes.some(
|
|
2028
2042
|
(prefix) => modelId.startsWith(prefix)
|
|
2029
2043
|
);
|
|
2030
2044
|
}
|
|
2045
|
+
function getMaxImagesPerCall(modelId) {
|
|
2046
|
+
var _a;
|
|
2047
|
+
return (_a = modelMaxImagesPerCall[modelId]) != null ? _a : modelId.startsWith("gpt-image-") ? 10 : 1;
|
|
2048
|
+
}
|
|
2031
2049
|
var baseImageModelOptionsObject = z9.object({
|
|
2032
2050
|
/**
|
|
2033
2051
|
* Quality of the generated image(s).
|
|
@@ -2105,8 +2123,7 @@ var OpenAIImageModel = class _OpenAIImageModel {
|
|
|
2105
2123
|
return new _OpenAIImageModel(options.modelId, options.config);
|
|
2106
2124
|
}
|
|
2107
2125
|
get maxImagesPerCall() {
|
|
2108
|
-
|
|
2109
|
-
return (_a = modelMaxImagesPerCall[this.modelId]) != null ? _a : 1;
|
|
2126
|
+
return getMaxImagesPerCall(this.modelId);
|
|
2110
2127
|
}
|
|
2111
2128
|
get provider() {
|
|
2112
2129
|
return this.config.provider;
|
|
@@ -3052,7 +3069,7 @@ import {
|
|
|
3052
3069
|
resolveProviderReference as resolveProviderReference2,
|
|
3053
3070
|
validateTypes
|
|
3054
3071
|
} from "@ai-sdk/provider-utils";
|
|
3055
|
-
import { z as
|
|
3072
|
+
import { z as z19 } from "zod/v4";
|
|
3056
3073
|
|
|
3057
3074
|
// src/tool/apply-patch.ts
|
|
3058
3075
|
import {
|
|
@@ -3364,10 +3381,44 @@ var toolSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema5({
|
|
|
3364
3381
|
outputSchema: toolSearchOutputSchema
|
|
3365
3382
|
});
|
|
3366
3383
|
|
|
3384
|
+
// src/tool/programmatic-tool-calling.ts
|
|
3385
|
+
import {
|
|
3386
|
+
createProviderExecutedToolFactory,
|
|
3387
|
+
lazySchema as lazySchema17,
|
|
3388
|
+
zodSchema as zodSchema17
|
|
3389
|
+
} from "@ai-sdk/provider-utils";
|
|
3390
|
+
import { z as z18 } from "zod/v4";
|
|
3391
|
+
var programmaticToolCallingInputSchema = lazySchema17(
|
|
3392
|
+
() => zodSchema17(
|
|
3393
|
+
z18.object({
|
|
3394
|
+
code: z18.string(),
|
|
3395
|
+
fingerprint: z18.string()
|
|
3396
|
+
})
|
|
3397
|
+
)
|
|
3398
|
+
);
|
|
3399
|
+
var programmaticToolCallingOutputSchema = lazySchema17(
|
|
3400
|
+
() => zodSchema17(
|
|
3401
|
+
z18.object({
|
|
3402
|
+
result: z18.string(),
|
|
3403
|
+
status: z18.enum(["completed", "incomplete"])
|
|
3404
|
+
})
|
|
3405
|
+
)
|
|
3406
|
+
);
|
|
3407
|
+
var programmaticToolCallingFactory = createProviderExecutedToolFactory({
|
|
3408
|
+
id: "openai.programmatic_tool_calling",
|
|
3409
|
+
inputSchema: programmaticToolCallingInputSchema,
|
|
3410
|
+
outputSchema: programmaticToolCallingOutputSchema,
|
|
3411
|
+
supportsDeferredResults: true
|
|
3412
|
+
});
|
|
3413
|
+
var programmaticToolCalling = () => programmaticToolCallingFactory({});
|
|
3414
|
+
|
|
3367
3415
|
// src/responses/convert-to-openai-responses-input.ts
|
|
3368
3416
|
function serializeToolCallArguments2(input) {
|
|
3369
3417
|
return JSON.stringify(input === void 0 ? {} : input);
|
|
3370
3418
|
}
|
|
3419
|
+
function mapToolCaller(caller) {
|
|
3420
|
+
return caller == null ? void 0 : caller.type === "program" ? { type: "program", caller_id: caller.callerId } : caller;
|
|
3421
|
+
}
|
|
3371
3422
|
function getPromptCacheBreakpoint2(providerOptions, providerOptionsName) {
|
|
3372
3423
|
var _a;
|
|
3373
3424
|
return (_a = providerOptions == null ? void 0 : providerOptions[providerOptionsName]) == null ? void 0 : _a.promptCacheBreakpoint;
|
|
@@ -3392,7 +3443,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3392
3443
|
hasComputerTool = false,
|
|
3393
3444
|
customProviderToolNames
|
|
3394
3445
|
}) {
|
|
3395
|
-
var _a, _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;
|
|
3446
|
+
var _a, _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, _H, _I, _J, _K, _L;
|
|
3396
3447
|
let input = [];
|
|
3397
3448
|
const warnings = [];
|
|
3398
3449
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -3578,6 +3629,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3578
3629
|
case "tool-call": {
|
|
3579
3630
|
const id = (_f = (_c = (_b = part.providerOptions) == null ? void 0 : _b[providerOptionsName]) == null ? void 0 : _c.itemId) != null ? _f : (_e = (_d = part.providerMetadata) == null ? void 0 : _d[providerOptionsName]) == null ? void 0 : _e.itemId;
|
|
3580
3631
|
const namespace = (_k = (_h = (_g = part.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.namespace) != null ? _k : (_j = (_i = part.providerMetadata) == null ? void 0 : _i[providerOptionsName]) == null ? void 0 : _j.namespace;
|
|
3632
|
+
const caller = (_m = (_l = part.providerOptions) == null ? void 0 : _l[providerOptionsName]) == null ? void 0 : _m.caller;
|
|
3581
3633
|
if (hasConversation && id != null) {
|
|
3582
3634
|
break;
|
|
3583
3635
|
}
|
|
@@ -3601,12 +3653,30 @@ async function convertToOpenAIResponsesInput({
|
|
|
3601
3653
|
type: "tool_search_call",
|
|
3602
3654
|
id: id != null ? id : part.toolCallId,
|
|
3603
3655
|
execution,
|
|
3604
|
-
call_id: (
|
|
3656
|
+
call_id: (_n = parsedInput.call_id) != null ? _n : null,
|
|
3605
3657
|
status: "completed",
|
|
3606
3658
|
arguments: parsedInput.arguments
|
|
3607
3659
|
});
|
|
3608
3660
|
break;
|
|
3609
3661
|
}
|
|
3662
|
+
if (resolvedToolName === "programmatic_tool_calling") {
|
|
3663
|
+
if (store && id != null) {
|
|
3664
|
+
input.push({ type: "item_reference", id });
|
|
3665
|
+
break;
|
|
3666
|
+
}
|
|
3667
|
+
const parsedInput = await validateTypes({
|
|
3668
|
+
value: part.input,
|
|
3669
|
+
schema: programmaticToolCallingInputSchema
|
|
3670
|
+
});
|
|
3671
|
+
input.push({
|
|
3672
|
+
type: "program",
|
|
3673
|
+
id: id != null ? id : part.toolCallId,
|
|
3674
|
+
call_id: part.toolCallId,
|
|
3675
|
+
code: parsedInput.code,
|
|
3676
|
+
fingerprint: parsedInput.fingerprint
|
|
3677
|
+
});
|
|
3678
|
+
break;
|
|
3679
|
+
}
|
|
3610
3680
|
if (part.providerExecuted) {
|
|
3611
3681
|
if (store && id != null) {
|
|
3612
3682
|
input.push({ type: "item_reference", id });
|
|
@@ -3616,7 +3686,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3616
3686
|
if (hasPreviousResponseId && store && id != null) {
|
|
3617
3687
|
break;
|
|
3618
3688
|
}
|
|
3619
|
-
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || hasComputerTool && resolvedToolName === "computer" || ((
|
|
3689
|
+
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || hasComputerTool && resolvedToolName === "computer" || ((_o = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _o : false);
|
|
3620
3690
|
if (store && id != null && isProviderDefinedToolCall) {
|
|
3621
3691
|
input.push({ type: "item_reference", id });
|
|
3622
3692
|
break;
|
|
@@ -3735,7 +3805,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
3735
3805
|
call_id: part.toolCallId,
|
|
3736
3806
|
name: resolvedToolName,
|
|
3737
3807
|
arguments: serializeToolCallArguments2(part.input),
|
|
3738
|
-
...namespace != null && { namespace }
|
|
3808
|
+
...namespace != null && { namespace },
|
|
3809
|
+
...caller != null && {
|
|
3810
|
+
caller: mapToolCaller(caller)
|
|
3811
|
+
}
|
|
3739
3812
|
});
|
|
3740
3813
|
break;
|
|
3741
3814
|
}
|
|
@@ -3751,7 +3824,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3751
3824
|
part.toolName
|
|
3752
3825
|
);
|
|
3753
3826
|
if (resolvedResultToolName === "tool_search") {
|
|
3754
|
-
const itemId = (
|
|
3827
|
+
const itemId = (_u = (_t = (_q = (_p = part.providerOptions) == null ? void 0 : _p[providerOptionsName]) == null ? void 0 : _q.itemId) != null ? _t : (_s = (_r = part.providerMetadata) == null ? void 0 : _r[providerOptionsName]) == null ? void 0 : _s.itemId) != null ? _u : part.toolCallId;
|
|
3755
3828
|
if (store) {
|
|
3756
3829
|
input.push({ type: "item_reference", id: itemId });
|
|
3757
3830
|
} else if (part.output.type === "json") {
|
|
@@ -3770,6 +3843,25 @@ async function convertToOpenAIResponsesInput({
|
|
|
3770
3843
|
}
|
|
3771
3844
|
break;
|
|
3772
3845
|
}
|
|
3846
|
+
if (resolvedResultToolName === "programmatic_tool_calling") {
|
|
3847
|
+
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;
|
|
3848
|
+
if (store) {
|
|
3849
|
+
input.push({ type: "item_reference", id: itemId });
|
|
3850
|
+
} else if (part.output.type === "json") {
|
|
3851
|
+
const parsedOutput = await validateTypes({
|
|
3852
|
+
value: part.output.value,
|
|
3853
|
+
schema: programmaticToolCallingOutputSchema
|
|
3854
|
+
});
|
|
3855
|
+
input.push({
|
|
3856
|
+
type: "program_output",
|
|
3857
|
+
id: itemId,
|
|
3858
|
+
call_id: part.toolCallId,
|
|
3859
|
+
result: parsedOutput.result,
|
|
3860
|
+
status: parsedOutput.status
|
|
3861
|
+
});
|
|
3862
|
+
}
|
|
3863
|
+
break;
|
|
3864
|
+
}
|
|
3773
3865
|
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
3774
3866
|
if (part.output.type === "json") {
|
|
3775
3867
|
const parsedOutput = await validateTypes({
|
|
@@ -3792,7 +3884,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3792
3884
|
break;
|
|
3793
3885
|
}
|
|
3794
3886
|
if (store) {
|
|
3795
|
-
const itemId = (
|
|
3887
|
+
const itemId = (_D = (_C = (_B = part.providerOptions) == null ? void 0 : _B[providerOptionsName]) == null ? void 0 : _C.itemId) != null ? _D : part.toolCallId;
|
|
3796
3888
|
input.push({ type: "item_reference", id: itemId });
|
|
3797
3889
|
} else {
|
|
3798
3890
|
warnings.push({
|
|
@@ -3877,7 +3969,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3877
3969
|
}
|
|
3878
3970
|
case "custom": {
|
|
3879
3971
|
if (part.kind === "openai.compaction") {
|
|
3880
|
-
const providerOptions2 = (
|
|
3972
|
+
const providerOptions2 = (_E = part.providerOptions) == null ? void 0 : _E[providerOptionsName];
|
|
3881
3973
|
const id = providerOptions2 == null ? void 0 : providerOptions2.itemId;
|
|
3882
3974
|
if (hasConversation && id != null) {
|
|
3883
3975
|
break;
|
|
@@ -3924,7 +4016,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3924
4016
|
}
|
|
3925
4017
|
const output = part.output;
|
|
3926
4018
|
if (output.type === "execution-denied") {
|
|
3927
|
-
const approvalId = (
|
|
4019
|
+
const approvalId = (_G = (_F = output.providerOptions) == null ? void 0 : _F.openai) == null ? void 0 : _G.approvalId;
|
|
3928
4020
|
if (approvalId) {
|
|
3929
4021
|
continue;
|
|
3930
4022
|
}
|
|
@@ -4004,7 +4096,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4004
4096
|
file_id: parsedOutput.output.fileId,
|
|
4005
4097
|
detail: parsedOutput.output.detail
|
|
4006
4098
|
},
|
|
4007
|
-
acknowledged_safety_checks: (
|
|
4099
|
+
acknowledged_safety_checks: (_H = parsedOutput.acknowledgedSafetyChecks) == null ? void 0 : _H.map((safetyCheck) => ({
|
|
4008
4100
|
id: safetyCheck.id,
|
|
4009
4101
|
code: safetyCheck.code,
|
|
4010
4102
|
message: safetyCheck.message
|
|
@@ -4020,7 +4112,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4020
4112
|
outputValue = output.value;
|
|
4021
4113
|
break;
|
|
4022
4114
|
case "execution-denied":
|
|
4023
|
-
outputValue = (
|
|
4115
|
+
outputValue = (_I = output.reason) != null ? _I : "Tool call execution denied.";
|
|
4024
4116
|
break;
|
|
4025
4117
|
case "json":
|
|
4026
4118
|
case "error-json":
|
|
@@ -4119,7 +4211,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4119
4211
|
contentValue = output.value;
|
|
4120
4212
|
break;
|
|
4121
4213
|
case "execution-denied":
|
|
4122
|
-
contentValue = (
|
|
4214
|
+
contentValue = (_J = output.reason) != null ? _J : "Tool call execution denied.";
|
|
4123
4215
|
break;
|
|
4124
4216
|
case "json":
|
|
4125
4217
|
case "error-json":
|
|
@@ -4204,10 +4296,14 @@ async function convertToOpenAIResponsesInput({
|
|
|
4204
4296
|
}).filter(isNonNullable);
|
|
4205
4297
|
break;
|
|
4206
4298
|
}
|
|
4299
|
+
const caller = mapToolCaller(
|
|
4300
|
+
(_L = (_K = part.providerOptions) == null ? void 0 : _K[providerOptionsName]) == null ? void 0 : _L.caller
|
|
4301
|
+
);
|
|
4207
4302
|
input.push({
|
|
4208
4303
|
type: "function_call_output",
|
|
4209
4304
|
call_id: part.toolCallId,
|
|
4210
|
-
output: contentValue
|
|
4305
|
+
output: contentValue,
|
|
4306
|
+
...caller != null && { caller }
|
|
4211
4307
|
});
|
|
4212
4308
|
}
|
|
4213
4309
|
break;
|
|
@@ -4231,9 +4327,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
4231
4327
|
}
|
|
4232
4328
|
return { input, warnings };
|
|
4233
4329
|
}
|
|
4234
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4235
|
-
itemId:
|
|
4236
|
-
reasoningEncryptedContent:
|
|
4330
|
+
var openaiResponsesReasoningProviderOptionsSchema = z19.object({
|
|
4331
|
+
itemId: z19.string().nullish(),
|
|
4332
|
+
reasoningEncryptedContent: z19.string().nullish()
|
|
4237
4333
|
});
|
|
4238
4334
|
|
|
4239
4335
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -4256,643 +4352,670 @@ function mapOpenAIResponseFinishReason({
|
|
|
4256
4352
|
|
|
4257
4353
|
// src/responses/openai-responses-api.ts
|
|
4258
4354
|
import {
|
|
4259
|
-
lazySchema as
|
|
4260
|
-
zodSchema as
|
|
4355
|
+
lazySchema as lazySchema18,
|
|
4356
|
+
zodSchema as zodSchema18
|
|
4261
4357
|
} from "@ai-sdk/provider-utils";
|
|
4262
|
-
import { z as
|
|
4263
|
-
var jsonValueSchema =
|
|
4264
|
-
() =>
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4358
|
+
import { z as z20 } from "zod/v4";
|
|
4359
|
+
var jsonValueSchema = z20.lazy(
|
|
4360
|
+
() => z20.union([
|
|
4361
|
+
z20.string(),
|
|
4362
|
+
z20.number(),
|
|
4363
|
+
z20.boolean(),
|
|
4364
|
+
z20.null(),
|
|
4365
|
+
z20.array(jsonValueSchema),
|
|
4366
|
+
z20.record(z20.string(), jsonValueSchema.optional())
|
|
4271
4367
|
])
|
|
4272
4368
|
);
|
|
4273
|
-
var openaiResponsesComputerSafetyCheckSchema =
|
|
4274
|
-
id:
|
|
4275
|
-
code:
|
|
4276
|
-
message:
|
|
4369
|
+
var openaiResponsesComputerSafetyCheckSchema = z20.object({
|
|
4370
|
+
id: z20.string(),
|
|
4371
|
+
code: z20.string().nullish(),
|
|
4372
|
+
message: z20.string().nullish()
|
|
4277
4373
|
});
|
|
4278
|
-
var openaiResponsesComputerActionSchema =
|
|
4279
|
-
|
|
4280
|
-
type:
|
|
4281
|
-
button:
|
|
4282
|
-
x:
|
|
4283
|
-
y:
|
|
4284
|
-
keys:
|
|
4374
|
+
var openaiResponsesComputerActionSchema = z20.discriminatedUnion("type", [
|
|
4375
|
+
z20.object({
|
|
4376
|
+
type: z20.literal("click"),
|
|
4377
|
+
button: z20.enum(["left", "right", "wheel", "back", "forward"]),
|
|
4378
|
+
x: z20.number(),
|
|
4379
|
+
y: z20.number(),
|
|
4380
|
+
keys: z20.array(z20.string()).nullish()
|
|
4285
4381
|
}),
|
|
4286
|
-
|
|
4287
|
-
type:
|
|
4288
|
-
x:
|
|
4289
|
-
y:
|
|
4290
|
-
keys:
|
|
4382
|
+
z20.object({
|
|
4383
|
+
type: z20.literal("double_click"),
|
|
4384
|
+
x: z20.number(),
|
|
4385
|
+
y: z20.number(),
|
|
4386
|
+
keys: z20.array(z20.string()).nullish()
|
|
4291
4387
|
}),
|
|
4292
|
-
|
|
4293
|
-
type:
|
|
4294
|
-
path:
|
|
4295
|
-
keys:
|
|
4388
|
+
z20.object({
|
|
4389
|
+
type: z20.literal("drag"),
|
|
4390
|
+
path: z20.array(z20.object({ x: z20.number(), y: z20.number() })),
|
|
4391
|
+
keys: z20.array(z20.string()).nullish()
|
|
4296
4392
|
}),
|
|
4297
|
-
|
|
4298
|
-
type:
|
|
4299
|
-
keys:
|
|
4393
|
+
z20.object({
|
|
4394
|
+
type: z20.literal("keypress"),
|
|
4395
|
+
keys: z20.array(z20.string())
|
|
4300
4396
|
}),
|
|
4301
|
-
|
|
4302
|
-
type:
|
|
4303
|
-
x:
|
|
4304
|
-
y:
|
|
4305
|
-
keys:
|
|
4397
|
+
z20.object({
|
|
4398
|
+
type: z20.literal("move"),
|
|
4399
|
+
x: z20.number(),
|
|
4400
|
+
y: z20.number(),
|
|
4401
|
+
keys: z20.array(z20.string()).nullish()
|
|
4306
4402
|
}),
|
|
4307
|
-
|
|
4308
|
-
type:
|
|
4403
|
+
z20.object({
|
|
4404
|
+
type: z20.literal("screenshot")
|
|
4309
4405
|
}),
|
|
4310
|
-
|
|
4311
|
-
type:
|
|
4312
|
-
x:
|
|
4313
|
-
y:
|
|
4314
|
-
scroll_x:
|
|
4315
|
-
scroll_y:
|
|
4316
|
-
keys:
|
|
4406
|
+
z20.object({
|
|
4407
|
+
type: z20.literal("scroll"),
|
|
4408
|
+
x: z20.number(),
|
|
4409
|
+
y: z20.number(),
|
|
4410
|
+
scroll_x: z20.number(),
|
|
4411
|
+
scroll_y: z20.number(),
|
|
4412
|
+
keys: z20.array(z20.string()).nullish()
|
|
4317
4413
|
}),
|
|
4318
|
-
|
|
4319
|
-
type:
|
|
4320
|
-
text:
|
|
4414
|
+
z20.object({
|
|
4415
|
+
type: z20.literal("type"),
|
|
4416
|
+
text: z20.string()
|
|
4321
4417
|
}),
|
|
4322
|
-
|
|
4323
|
-
type:
|
|
4418
|
+
z20.object({
|
|
4419
|
+
type: z20.literal("wait")
|
|
4324
4420
|
})
|
|
4325
4421
|
]);
|
|
4326
|
-
var openaiResponsesComputerCallSchema =
|
|
4327
|
-
type:
|
|
4328
|
-
id:
|
|
4329
|
-
call_id:
|
|
4330
|
-
status:
|
|
4422
|
+
var openaiResponsesComputerCallSchema = z20.object({
|
|
4423
|
+
type: z20.literal("computer_call"),
|
|
4424
|
+
id: z20.string(),
|
|
4425
|
+
call_id: z20.string().nullish(),
|
|
4426
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4331
4427
|
action: openaiResponsesComputerActionSchema.nullish(),
|
|
4332
|
-
actions:
|
|
4333
|
-
pending_safety_checks:
|
|
4428
|
+
actions: z20.array(openaiResponsesComputerActionSchema).nullish(),
|
|
4429
|
+
pending_safety_checks: z20.array(openaiResponsesComputerSafetyCheckSchema).nullish()
|
|
4430
|
+
});
|
|
4431
|
+
var openaiResponsesToolCallerSchema = z20.discriminatedUnion("type", [
|
|
4432
|
+
z20.object({ type: z20.literal("direct") }),
|
|
4433
|
+
z20.object({
|
|
4434
|
+
type: z20.literal("program"),
|
|
4435
|
+
caller_id: z20.string()
|
|
4436
|
+
})
|
|
4437
|
+
]);
|
|
4438
|
+
var openaiResponsesProgramSchema = z20.object({
|
|
4439
|
+
type: z20.literal("program"),
|
|
4440
|
+
id: z20.string(),
|
|
4441
|
+
call_id: z20.string(),
|
|
4442
|
+
code: z20.string(),
|
|
4443
|
+
fingerprint: z20.string()
|
|
4444
|
+
});
|
|
4445
|
+
var openaiResponsesProgramOutputSchema = z20.object({
|
|
4446
|
+
type: z20.literal("program_output"),
|
|
4447
|
+
id: z20.string(),
|
|
4448
|
+
call_id: z20.string(),
|
|
4449
|
+
result: z20.string(),
|
|
4450
|
+
status: z20.enum(["completed", "incomplete"])
|
|
4334
4451
|
});
|
|
4335
|
-
var openaiResponsesNestedErrorChunkSchema =
|
|
4336
|
-
type:
|
|
4337
|
-
sequence_number:
|
|
4338
|
-
error:
|
|
4339
|
-
type:
|
|
4340
|
-
code:
|
|
4341
|
-
message:
|
|
4342
|
-
param:
|
|
4452
|
+
var openaiResponsesNestedErrorChunkSchema = z20.object({
|
|
4453
|
+
type: z20.literal("error"),
|
|
4454
|
+
sequence_number: z20.number(),
|
|
4455
|
+
error: z20.object({
|
|
4456
|
+
type: z20.string(),
|
|
4457
|
+
code: z20.string(),
|
|
4458
|
+
message: z20.string(),
|
|
4459
|
+
param: z20.string().nullish()
|
|
4343
4460
|
})
|
|
4344
4461
|
});
|
|
4345
|
-
var openaiResponsesErrorChunkSchema =
|
|
4346
|
-
type:
|
|
4347
|
-
sequence_number:
|
|
4348
|
-
code:
|
|
4349
|
-
message:
|
|
4350
|
-
param:
|
|
4462
|
+
var openaiResponsesErrorChunkSchema = z20.object({
|
|
4463
|
+
type: z20.literal("error"),
|
|
4464
|
+
sequence_number: z20.number(),
|
|
4465
|
+
code: z20.string().nullish(),
|
|
4466
|
+
message: z20.string(),
|
|
4467
|
+
param: z20.string().nullish()
|
|
4351
4468
|
});
|
|
4352
|
-
var openaiResponsesChunkSchema =
|
|
4353
|
-
() =>
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
type:
|
|
4357
|
-
item_id:
|
|
4358
|
-
delta:
|
|
4359
|
-
logprobs:
|
|
4360
|
-
|
|
4361
|
-
token:
|
|
4362
|
-
logprob:
|
|
4363
|
-
top_logprobs:
|
|
4364
|
-
|
|
4365
|
-
token:
|
|
4366
|
-
logprob:
|
|
4469
|
+
var openaiResponsesChunkSchema = lazySchema18(
|
|
4470
|
+
() => zodSchema18(
|
|
4471
|
+
z20.union([
|
|
4472
|
+
z20.object({
|
|
4473
|
+
type: z20.literal("response.output_text.delta"),
|
|
4474
|
+
item_id: z20.string(),
|
|
4475
|
+
delta: z20.string(),
|
|
4476
|
+
logprobs: z20.array(
|
|
4477
|
+
z20.object({
|
|
4478
|
+
token: z20.string(),
|
|
4479
|
+
logprob: z20.number(),
|
|
4480
|
+
top_logprobs: z20.array(
|
|
4481
|
+
z20.object({
|
|
4482
|
+
token: z20.string(),
|
|
4483
|
+
logprob: z20.number()
|
|
4367
4484
|
})
|
|
4368
4485
|
)
|
|
4369
4486
|
})
|
|
4370
4487
|
).nullish()
|
|
4371
4488
|
}),
|
|
4372
|
-
|
|
4373
|
-
type:
|
|
4374
|
-
response:
|
|
4375
|
-
incomplete_details:
|
|
4376
|
-
usage:
|
|
4377
|
-
input_tokens:
|
|
4378
|
-
input_tokens_details:
|
|
4379
|
-
cached_tokens:
|
|
4380
|
-
cache_write_tokens:
|
|
4381
|
-
orchestration_input_tokens:
|
|
4382
|
-
orchestration_input_cached_tokens:
|
|
4489
|
+
z20.object({
|
|
4490
|
+
type: z20.enum(["response.completed", "response.incomplete"]),
|
|
4491
|
+
response: z20.object({
|
|
4492
|
+
incomplete_details: z20.object({ reason: z20.string() }).nullish(),
|
|
4493
|
+
usage: z20.object({
|
|
4494
|
+
input_tokens: z20.number(),
|
|
4495
|
+
input_tokens_details: z20.object({
|
|
4496
|
+
cached_tokens: z20.number().nullish(),
|
|
4497
|
+
cache_write_tokens: z20.number().nullish(),
|
|
4498
|
+
orchestration_input_tokens: z20.number().nullish(),
|
|
4499
|
+
orchestration_input_cached_tokens: z20.number().nullish()
|
|
4383
4500
|
}).nullish(),
|
|
4384
|
-
output_tokens:
|
|
4385
|
-
output_tokens_details:
|
|
4386
|
-
reasoning_tokens:
|
|
4387
|
-
orchestration_output_tokens:
|
|
4501
|
+
output_tokens: z20.number(),
|
|
4502
|
+
output_tokens_details: z20.object({
|
|
4503
|
+
reasoning_tokens: z20.number().nullish(),
|
|
4504
|
+
orchestration_output_tokens: z20.number().nullish()
|
|
4388
4505
|
}).nullish()
|
|
4389
4506
|
}),
|
|
4390
|
-
reasoning:
|
|
4391
|
-
context:
|
|
4507
|
+
reasoning: z20.object({
|
|
4508
|
+
context: z20.string().nullish()
|
|
4392
4509
|
}).nullish(),
|
|
4393
|
-
service_tier:
|
|
4510
|
+
service_tier: z20.string().nullish()
|
|
4394
4511
|
})
|
|
4395
4512
|
}),
|
|
4396
|
-
|
|
4397
|
-
type:
|
|
4398
|
-
sequence_number:
|
|
4399
|
-
response:
|
|
4400
|
-
error:
|
|
4401
|
-
code:
|
|
4402
|
-
message:
|
|
4513
|
+
z20.object({
|
|
4514
|
+
type: z20.literal("response.failed"),
|
|
4515
|
+
sequence_number: z20.number(),
|
|
4516
|
+
response: z20.object({
|
|
4517
|
+
error: z20.object({
|
|
4518
|
+
code: z20.string().nullish(),
|
|
4519
|
+
message: z20.string()
|
|
4403
4520
|
}).nullish(),
|
|
4404
|
-
incomplete_details:
|
|
4405
|
-
usage:
|
|
4406
|
-
input_tokens:
|
|
4407
|
-
input_tokens_details:
|
|
4408
|
-
cached_tokens:
|
|
4409
|
-
cache_write_tokens:
|
|
4410
|
-
orchestration_input_tokens:
|
|
4411
|
-
orchestration_input_cached_tokens:
|
|
4521
|
+
incomplete_details: z20.object({ reason: z20.string() }).nullish(),
|
|
4522
|
+
usage: z20.object({
|
|
4523
|
+
input_tokens: z20.number(),
|
|
4524
|
+
input_tokens_details: z20.object({
|
|
4525
|
+
cached_tokens: z20.number().nullish(),
|
|
4526
|
+
cache_write_tokens: z20.number().nullish(),
|
|
4527
|
+
orchestration_input_tokens: z20.number().nullish(),
|
|
4528
|
+
orchestration_input_cached_tokens: z20.number().nullish()
|
|
4412
4529
|
}).nullish(),
|
|
4413
|
-
output_tokens:
|
|
4414
|
-
output_tokens_details:
|
|
4415
|
-
reasoning_tokens:
|
|
4416
|
-
orchestration_output_tokens:
|
|
4530
|
+
output_tokens: z20.number(),
|
|
4531
|
+
output_tokens_details: z20.object({
|
|
4532
|
+
reasoning_tokens: z20.number().nullish(),
|
|
4533
|
+
orchestration_output_tokens: z20.number().nullish()
|
|
4417
4534
|
}).nullish()
|
|
4418
4535
|
}).nullish(),
|
|
4419
|
-
reasoning:
|
|
4420
|
-
context:
|
|
4536
|
+
reasoning: z20.object({
|
|
4537
|
+
context: z20.string().nullish()
|
|
4421
4538
|
}).nullish(),
|
|
4422
|
-
service_tier:
|
|
4539
|
+
service_tier: z20.string().nullish()
|
|
4423
4540
|
})
|
|
4424
4541
|
}),
|
|
4425
|
-
|
|
4426
|
-
type:
|
|
4427
|
-
response:
|
|
4428
|
-
id:
|
|
4429
|
-
created_at:
|
|
4430
|
-
model:
|
|
4431
|
-
service_tier:
|
|
4542
|
+
z20.object({
|
|
4543
|
+
type: z20.literal("response.created"),
|
|
4544
|
+
response: z20.object({
|
|
4545
|
+
id: z20.string(),
|
|
4546
|
+
created_at: z20.number(),
|
|
4547
|
+
model: z20.string(),
|
|
4548
|
+
service_tier: z20.string().nullish()
|
|
4432
4549
|
})
|
|
4433
4550
|
}),
|
|
4434
|
-
|
|
4435
|
-
type:
|
|
4436
|
-
output_index:
|
|
4437
|
-
item:
|
|
4438
|
-
|
|
4439
|
-
type:
|
|
4440
|
-
id:
|
|
4441
|
-
phase:
|
|
4551
|
+
z20.object({
|
|
4552
|
+
type: z20.literal("response.output_item.added"),
|
|
4553
|
+
output_index: z20.number(),
|
|
4554
|
+
item: z20.discriminatedUnion("type", [
|
|
4555
|
+
z20.object({
|
|
4556
|
+
type: z20.literal("message"),
|
|
4557
|
+
id: z20.string(),
|
|
4558
|
+
phase: z20.enum(["commentary", "final_answer"]).nullish()
|
|
4442
4559
|
}),
|
|
4443
|
-
|
|
4444
|
-
type:
|
|
4445
|
-
id:
|
|
4446
|
-
encrypted_content:
|
|
4560
|
+
z20.object({
|
|
4561
|
+
type: z20.literal("reasoning"),
|
|
4562
|
+
id: z20.string(),
|
|
4563
|
+
encrypted_content: z20.string().nullish()
|
|
4447
4564
|
}),
|
|
4448
|
-
|
|
4449
|
-
type:
|
|
4450
|
-
id:
|
|
4451
|
-
call_id:
|
|
4452
|
-
name:
|
|
4453
|
-
arguments:
|
|
4454
|
-
namespace:
|
|
4565
|
+
z20.object({
|
|
4566
|
+
type: z20.literal("function_call"),
|
|
4567
|
+
id: z20.string(),
|
|
4568
|
+
call_id: z20.string(),
|
|
4569
|
+
name: z20.string(),
|
|
4570
|
+
arguments: z20.string(),
|
|
4571
|
+
namespace: z20.string().nullish(),
|
|
4572
|
+
caller: openaiResponsesToolCallerSchema.nullish()
|
|
4455
4573
|
}),
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4574
|
+
openaiResponsesProgramSchema,
|
|
4575
|
+
openaiResponsesProgramOutputSchema,
|
|
4576
|
+
z20.object({
|
|
4577
|
+
type: z20.literal("web_search_call"),
|
|
4578
|
+
id: z20.string(),
|
|
4579
|
+
status: z20.string()
|
|
4460
4580
|
}),
|
|
4461
4581
|
openaiResponsesComputerCallSchema,
|
|
4462
|
-
|
|
4463
|
-
type:
|
|
4464
|
-
id:
|
|
4582
|
+
z20.object({
|
|
4583
|
+
type: z20.literal("file_search_call"),
|
|
4584
|
+
id: z20.string()
|
|
4465
4585
|
}),
|
|
4466
|
-
|
|
4467
|
-
type:
|
|
4468
|
-
id:
|
|
4586
|
+
z20.object({
|
|
4587
|
+
type: z20.literal("image_generation_call"),
|
|
4588
|
+
id: z20.string()
|
|
4469
4589
|
}),
|
|
4470
|
-
|
|
4471
|
-
type:
|
|
4472
|
-
id:
|
|
4473
|
-
container_id:
|
|
4474
|
-
code:
|
|
4475
|
-
outputs:
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4590
|
+
z20.object({
|
|
4591
|
+
type: z20.literal("code_interpreter_call"),
|
|
4592
|
+
id: z20.string(),
|
|
4593
|
+
container_id: z20.string(),
|
|
4594
|
+
code: z20.string().nullable(),
|
|
4595
|
+
outputs: z20.array(
|
|
4596
|
+
z20.discriminatedUnion("type", [
|
|
4597
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
4598
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
4479
4599
|
])
|
|
4480
4600
|
).nullable(),
|
|
4481
|
-
status:
|
|
4601
|
+
status: z20.string()
|
|
4482
4602
|
}),
|
|
4483
|
-
|
|
4484
|
-
type:
|
|
4485
|
-
id:
|
|
4486
|
-
status:
|
|
4487
|
-
approval_request_id:
|
|
4603
|
+
z20.object({
|
|
4604
|
+
type: z20.literal("mcp_call"),
|
|
4605
|
+
id: z20.string(),
|
|
4606
|
+
status: z20.string(),
|
|
4607
|
+
approval_request_id: z20.string().nullish()
|
|
4488
4608
|
}),
|
|
4489
|
-
|
|
4490
|
-
type:
|
|
4491
|
-
id:
|
|
4609
|
+
z20.object({
|
|
4610
|
+
type: z20.literal("mcp_list_tools"),
|
|
4611
|
+
id: z20.string()
|
|
4492
4612
|
}),
|
|
4493
|
-
|
|
4494
|
-
type:
|
|
4495
|
-
id:
|
|
4613
|
+
z20.object({
|
|
4614
|
+
type: z20.literal("mcp_approval_request"),
|
|
4615
|
+
id: z20.string()
|
|
4496
4616
|
}),
|
|
4497
|
-
|
|
4498
|
-
type:
|
|
4499
|
-
id:
|
|
4500
|
-
call_id:
|
|
4501
|
-
status:
|
|
4502
|
-
operation:
|
|
4503
|
-
|
|
4504
|
-
type:
|
|
4505
|
-
path:
|
|
4506
|
-
diff:
|
|
4617
|
+
z20.object({
|
|
4618
|
+
type: z20.literal("apply_patch_call"),
|
|
4619
|
+
id: z20.string(),
|
|
4620
|
+
call_id: z20.string(),
|
|
4621
|
+
status: z20.enum(["in_progress", "completed"]),
|
|
4622
|
+
operation: z20.discriminatedUnion("type", [
|
|
4623
|
+
z20.object({
|
|
4624
|
+
type: z20.literal("create_file"),
|
|
4625
|
+
path: z20.string(),
|
|
4626
|
+
diff: z20.string()
|
|
4507
4627
|
}),
|
|
4508
|
-
|
|
4509
|
-
type:
|
|
4510
|
-
path:
|
|
4628
|
+
z20.object({
|
|
4629
|
+
type: z20.literal("delete_file"),
|
|
4630
|
+
path: z20.string()
|
|
4511
4631
|
}),
|
|
4512
|
-
|
|
4513
|
-
type:
|
|
4514
|
-
path:
|
|
4515
|
-
diff:
|
|
4632
|
+
z20.object({
|
|
4633
|
+
type: z20.literal("update_file"),
|
|
4634
|
+
path: z20.string(),
|
|
4635
|
+
diff: z20.string()
|
|
4516
4636
|
})
|
|
4517
4637
|
])
|
|
4518
4638
|
}),
|
|
4519
|
-
|
|
4520
|
-
type:
|
|
4521
|
-
id:
|
|
4522
|
-
call_id:
|
|
4523
|
-
name:
|
|
4524
|
-
input:
|
|
4639
|
+
z20.object({
|
|
4640
|
+
type: z20.literal("custom_tool_call"),
|
|
4641
|
+
id: z20.string(),
|
|
4642
|
+
call_id: z20.string(),
|
|
4643
|
+
name: z20.string(),
|
|
4644
|
+
input: z20.string()
|
|
4525
4645
|
}),
|
|
4526
|
-
|
|
4527
|
-
type:
|
|
4528
|
-
id:
|
|
4529
|
-
call_id:
|
|
4530
|
-
status:
|
|
4531
|
-
action:
|
|
4532
|
-
commands:
|
|
4646
|
+
z20.object({
|
|
4647
|
+
type: z20.literal("shell_call"),
|
|
4648
|
+
id: z20.string(),
|
|
4649
|
+
call_id: z20.string(),
|
|
4650
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4651
|
+
action: z20.object({
|
|
4652
|
+
commands: z20.array(z20.string())
|
|
4533
4653
|
})
|
|
4534
4654
|
}),
|
|
4535
|
-
|
|
4536
|
-
type:
|
|
4537
|
-
id:
|
|
4538
|
-
encrypted_content:
|
|
4655
|
+
z20.object({
|
|
4656
|
+
type: z20.literal("compaction"),
|
|
4657
|
+
id: z20.string(),
|
|
4658
|
+
encrypted_content: z20.string().nullish()
|
|
4539
4659
|
}),
|
|
4540
|
-
|
|
4541
|
-
type:
|
|
4542
|
-
id:
|
|
4543
|
-
call_id:
|
|
4544
|
-
status:
|
|
4545
|
-
output:
|
|
4546
|
-
|
|
4547
|
-
stdout:
|
|
4548
|
-
stderr:
|
|
4549
|
-
outcome:
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
type:
|
|
4553
|
-
exit_code:
|
|
4660
|
+
z20.object({
|
|
4661
|
+
type: z20.literal("shell_call_output"),
|
|
4662
|
+
id: z20.string(),
|
|
4663
|
+
call_id: z20.string(),
|
|
4664
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4665
|
+
output: z20.array(
|
|
4666
|
+
z20.object({
|
|
4667
|
+
stdout: z20.string(),
|
|
4668
|
+
stderr: z20.string(),
|
|
4669
|
+
outcome: z20.discriminatedUnion("type", [
|
|
4670
|
+
z20.object({ type: z20.literal("timeout") }),
|
|
4671
|
+
z20.object({
|
|
4672
|
+
type: z20.literal("exit"),
|
|
4673
|
+
exit_code: z20.number()
|
|
4554
4674
|
})
|
|
4555
4675
|
])
|
|
4556
4676
|
})
|
|
4557
4677
|
)
|
|
4558
4678
|
}),
|
|
4559
|
-
|
|
4560
|
-
type:
|
|
4561
|
-
id:
|
|
4562
|
-
execution:
|
|
4563
|
-
call_id:
|
|
4564
|
-
status:
|
|
4565
|
-
arguments:
|
|
4679
|
+
z20.object({
|
|
4680
|
+
type: z20.literal("tool_search_call"),
|
|
4681
|
+
id: z20.string(),
|
|
4682
|
+
execution: z20.enum(["server", "client"]),
|
|
4683
|
+
call_id: z20.string().nullable(),
|
|
4684
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4685
|
+
arguments: z20.unknown()
|
|
4566
4686
|
}),
|
|
4567
|
-
|
|
4568
|
-
type:
|
|
4569
|
-
id:
|
|
4570
|
-
execution:
|
|
4571
|
-
call_id:
|
|
4572
|
-
status:
|
|
4573
|
-
tools:
|
|
4687
|
+
z20.object({
|
|
4688
|
+
type: z20.literal("tool_search_output"),
|
|
4689
|
+
id: z20.string(),
|
|
4690
|
+
execution: z20.enum(["server", "client"]),
|
|
4691
|
+
call_id: z20.string().nullable(),
|
|
4692
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4693
|
+
tools: z20.array(z20.record(z20.string(), jsonValueSchema.optional()))
|
|
4574
4694
|
})
|
|
4575
4695
|
])
|
|
4576
4696
|
}),
|
|
4577
|
-
|
|
4578
|
-
type:
|
|
4579
|
-
output_index:
|
|
4580
|
-
item:
|
|
4581
|
-
|
|
4582
|
-
type:
|
|
4583
|
-
id:
|
|
4584
|
-
phase:
|
|
4697
|
+
z20.object({
|
|
4698
|
+
type: z20.literal("response.output_item.done"),
|
|
4699
|
+
output_index: z20.number(),
|
|
4700
|
+
item: z20.discriminatedUnion("type", [
|
|
4701
|
+
z20.object({
|
|
4702
|
+
type: z20.literal("message"),
|
|
4703
|
+
id: z20.string(),
|
|
4704
|
+
phase: z20.enum(["commentary", "final_answer"]).nullish()
|
|
4585
4705
|
}),
|
|
4586
|
-
|
|
4587
|
-
type:
|
|
4588
|
-
id:
|
|
4589
|
-
encrypted_content:
|
|
4706
|
+
z20.object({
|
|
4707
|
+
type: z20.literal("reasoning"),
|
|
4708
|
+
id: z20.string(),
|
|
4709
|
+
encrypted_content: z20.string().nullish()
|
|
4590
4710
|
}),
|
|
4591
|
-
|
|
4592
|
-
type:
|
|
4593
|
-
id:
|
|
4594
|
-
call_id:
|
|
4595
|
-
name:
|
|
4596
|
-
arguments:
|
|
4597
|
-
status:
|
|
4598
|
-
namespace:
|
|
4711
|
+
z20.object({
|
|
4712
|
+
type: z20.literal("function_call"),
|
|
4713
|
+
id: z20.string(),
|
|
4714
|
+
call_id: z20.string(),
|
|
4715
|
+
name: z20.string(),
|
|
4716
|
+
arguments: z20.string(),
|
|
4717
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4718
|
+
namespace: z20.string().nullish(),
|
|
4719
|
+
caller: openaiResponsesToolCallerSchema.nullish()
|
|
4599
4720
|
}),
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4721
|
+
openaiResponsesProgramSchema,
|
|
4722
|
+
openaiResponsesProgramOutputSchema,
|
|
4723
|
+
z20.object({
|
|
4724
|
+
type: z20.literal("custom_tool_call"),
|
|
4725
|
+
id: z20.string(),
|
|
4726
|
+
call_id: z20.string(),
|
|
4727
|
+
name: z20.string(),
|
|
4728
|
+
input: z20.string(),
|
|
4729
|
+
status: z20.literal("completed")
|
|
4607
4730
|
}),
|
|
4608
|
-
|
|
4609
|
-
type:
|
|
4610
|
-
id:
|
|
4611
|
-
code:
|
|
4612
|
-
container_id:
|
|
4613
|
-
outputs:
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4731
|
+
z20.object({
|
|
4732
|
+
type: z20.literal("code_interpreter_call"),
|
|
4733
|
+
id: z20.string(),
|
|
4734
|
+
code: z20.string().nullable(),
|
|
4735
|
+
container_id: z20.string(),
|
|
4736
|
+
outputs: z20.array(
|
|
4737
|
+
z20.discriminatedUnion("type", [
|
|
4738
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
4739
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
4617
4740
|
])
|
|
4618
4741
|
).nullable()
|
|
4619
4742
|
}),
|
|
4620
|
-
|
|
4621
|
-
type:
|
|
4622
|
-
id:
|
|
4623
|
-
result:
|
|
4743
|
+
z20.object({
|
|
4744
|
+
type: z20.literal("image_generation_call"),
|
|
4745
|
+
id: z20.string(),
|
|
4746
|
+
result: z20.string()
|
|
4624
4747
|
}),
|
|
4625
|
-
|
|
4626
|
-
type:
|
|
4627
|
-
id:
|
|
4628
|
-
status:
|
|
4629
|
-
action:
|
|
4630
|
-
|
|
4631
|
-
type:
|
|
4632
|
-
query:
|
|
4633
|
-
queries:
|
|
4634
|
-
sources:
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4748
|
+
z20.object({
|
|
4749
|
+
type: z20.literal("web_search_call"),
|
|
4750
|
+
id: z20.string(),
|
|
4751
|
+
status: z20.string(),
|
|
4752
|
+
action: z20.discriminatedUnion("type", [
|
|
4753
|
+
z20.object({
|
|
4754
|
+
type: z20.literal("search"),
|
|
4755
|
+
query: z20.string().nullish(),
|
|
4756
|
+
queries: z20.array(z20.string()).nullish(),
|
|
4757
|
+
sources: z20.array(
|
|
4758
|
+
z20.discriminatedUnion("type", [
|
|
4759
|
+
z20.object({ type: z20.literal("url"), url: z20.string() }),
|
|
4760
|
+
z20.object({ type: z20.literal("api"), name: z20.string() })
|
|
4638
4761
|
])
|
|
4639
4762
|
).nullish()
|
|
4640
4763
|
}),
|
|
4641
|
-
|
|
4642
|
-
type:
|
|
4643
|
-
url:
|
|
4764
|
+
z20.object({
|
|
4765
|
+
type: z20.literal("open_page"),
|
|
4766
|
+
url: z20.string().nullish()
|
|
4644
4767
|
}),
|
|
4645
|
-
|
|
4646
|
-
type:
|
|
4647
|
-
url:
|
|
4648
|
-
pattern:
|
|
4768
|
+
z20.object({
|
|
4769
|
+
type: z20.literal("find_in_page"),
|
|
4770
|
+
url: z20.string().nullish(),
|
|
4771
|
+
pattern: z20.string().nullish()
|
|
4649
4772
|
})
|
|
4650
4773
|
]).nullish()
|
|
4651
4774
|
}),
|
|
4652
|
-
|
|
4653
|
-
type:
|
|
4654
|
-
id:
|
|
4655
|
-
queries:
|
|
4656
|
-
results:
|
|
4657
|
-
|
|
4658
|
-
attributes:
|
|
4659
|
-
|
|
4660
|
-
|
|
4775
|
+
z20.object({
|
|
4776
|
+
type: z20.literal("file_search_call"),
|
|
4777
|
+
id: z20.string(),
|
|
4778
|
+
queries: z20.array(z20.string()),
|
|
4779
|
+
results: z20.array(
|
|
4780
|
+
z20.object({
|
|
4781
|
+
attributes: z20.record(
|
|
4782
|
+
z20.string(),
|
|
4783
|
+
z20.union([z20.string(), z20.number(), z20.boolean()])
|
|
4661
4784
|
),
|
|
4662
|
-
file_id:
|
|
4663
|
-
filename:
|
|
4664
|
-
score:
|
|
4665
|
-
text:
|
|
4785
|
+
file_id: z20.string(),
|
|
4786
|
+
filename: z20.string(),
|
|
4787
|
+
score: z20.number(),
|
|
4788
|
+
text: z20.string()
|
|
4666
4789
|
})
|
|
4667
4790
|
).nullish()
|
|
4668
4791
|
}),
|
|
4669
|
-
|
|
4670
|
-
type:
|
|
4671
|
-
id:
|
|
4672
|
-
call_id:
|
|
4673
|
-
action:
|
|
4674
|
-
type:
|
|
4675
|
-
command:
|
|
4676
|
-
timeout_ms:
|
|
4677
|
-
user:
|
|
4678
|
-
working_directory:
|
|
4679
|
-
env:
|
|
4792
|
+
z20.object({
|
|
4793
|
+
type: z20.literal("local_shell_call"),
|
|
4794
|
+
id: z20.string(),
|
|
4795
|
+
call_id: z20.string(),
|
|
4796
|
+
action: z20.object({
|
|
4797
|
+
type: z20.literal("exec"),
|
|
4798
|
+
command: z20.array(z20.string()),
|
|
4799
|
+
timeout_ms: z20.number().optional(),
|
|
4800
|
+
user: z20.string().optional(),
|
|
4801
|
+
working_directory: z20.string().optional(),
|
|
4802
|
+
env: z20.record(z20.string(), z20.string()).optional()
|
|
4680
4803
|
})
|
|
4681
4804
|
}),
|
|
4682
4805
|
openaiResponsesComputerCallSchema,
|
|
4683
|
-
|
|
4684
|
-
type:
|
|
4685
|
-
id:
|
|
4686
|
-
status:
|
|
4687
|
-
arguments:
|
|
4688
|
-
name:
|
|
4689
|
-
server_label:
|
|
4690
|
-
output:
|
|
4691
|
-
error:
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
type:
|
|
4695
|
-
code:
|
|
4696
|
-
message:
|
|
4806
|
+
z20.object({
|
|
4807
|
+
type: z20.literal("mcp_call"),
|
|
4808
|
+
id: z20.string(),
|
|
4809
|
+
status: z20.string(),
|
|
4810
|
+
arguments: z20.string(),
|
|
4811
|
+
name: z20.string(),
|
|
4812
|
+
server_label: z20.string(),
|
|
4813
|
+
output: z20.string().nullish(),
|
|
4814
|
+
error: z20.union([
|
|
4815
|
+
z20.string(),
|
|
4816
|
+
z20.object({
|
|
4817
|
+
type: z20.string().optional(),
|
|
4818
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
4819
|
+
message: z20.string().optional()
|
|
4697
4820
|
}).loose()
|
|
4698
4821
|
]).nullish(),
|
|
4699
|
-
approval_request_id:
|
|
4822
|
+
approval_request_id: z20.string().nullish()
|
|
4700
4823
|
}),
|
|
4701
|
-
|
|
4702
|
-
type:
|
|
4703
|
-
id:
|
|
4704
|
-
server_label:
|
|
4705
|
-
tools:
|
|
4706
|
-
|
|
4707
|
-
name:
|
|
4708
|
-
description:
|
|
4709
|
-
input_schema:
|
|
4710
|
-
annotations:
|
|
4824
|
+
z20.object({
|
|
4825
|
+
type: z20.literal("mcp_list_tools"),
|
|
4826
|
+
id: z20.string(),
|
|
4827
|
+
server_label: z20.string(),
|
|
4828
|
+
tools: z20.array(
|
|
4829
|
+
z20.object({
|
|
4830
|
+
name: z20.string(),
|
|
4831
|
+
description: z20.string().optional(),
|
|
4832
|
+
input_schema: z20.any(),
|
|
4833
|
+
annotations: z20.record(z20.string(), z20.unknown()).optional()
|
|
4711
4834
|
})
|
|
4712
4835
|
),
|
|
4713
|
-
error:
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
type:
|
|
4717
|
-
code:
|
|
4718
|
-
message:
|
|
4836
|
+
error: z20.union([
|
|
4837
|
+
z20.string(),
|
|
4838
|
+
z20.object({
|
|
4839
|
+
type: z20.string().optional(),
|
|
4840
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
4841
|
+
message: z20.string().optional()
|
|
4719
4842
|
}).loose()
|
|
4720
4843
|
]).optional()
|
|
4721
4844
|
}),
|
|
4722
|
-
|
|
4723
|
-
type:
|
|
4724
|
-
id:
|
|
4725
|
-
server_label:
|
|
4726
|
-
name:
|
|
4727
|
-
arguments:
|
|
4728
|
-
approval_request_id:
|
|
4845
|
+
z20.object({
|
|
4846
|
+
type: z20.literal("mcp_approval_request"),
|
|
4847
|
+
id: z20.string(),
|
|
4848
|
+
server_label: z20.string(),
|
|
4849
|
+
name: z20.string(),
|
|
4850
|
+
arguments: z20.string(),
|
|
4851
|
+
approval_request_id: z20.string().optional()
|
|
4729
4852
|
}),
|
|
4730
|
-
|
|
4731
|
-
type:
|
|
4732
|
-
id:
|
|
4733
|
-
call_id:
|
|
4734
|
-
status:
|
|
4735
|
-
operation:
|
|
4736
|
-
|
|
4737
|
-
type:
|
|
4738
|
-
path:
|
|
4739
|
-
diff:
|
|
4853
|
+
z20.object({
|
|
4854
|
+
type: z20.literal("apply_patch_call"),
|
|
4855
|
+
id: z20.string(),
|
|
4856
|
+
call_id: z20.string(),
|
|
4857
|
+
status: z20.enum(["in_progress", "completed"]),
|
|
4858
|
+
operation: z20.discriminatedUnion("type", [
|
|
4859
|
+
z20.object({
|
|
4860
|
+
type: z20.literal("create_file"),
|
|
4861
|
+
path: z20.string(),
|
|
4862
|
+
diff: z20.string()
|
|
4740
4863
|
}),
|
|
4741
|
-
|
|
4742
|
-
type:
|
|
4743
|
-
path:
|
|
4864
|
+
z20.object({
|
|
4865
|
+
type: z20.literal("delete_file"),
|
|
4866
|
+
path: z20.string()
|
|
4744
4867
|
}),
|
|
4745
|
-
|
|
4746
|
-
type:
|
|
4747
|
-
path:
|
|
4748
|
-
diff:
|
|
4868
|
+
z20.object({
|
|
4869
|
+
type: z20.literal("update_file"),
|
|
4870
|
+
path: z20.string(),
|
|
4871
|
+
diff: z20.string()
|
|
4749
4872
|
})
|
|
4750
4873
|
])
|
|
4751
4874
|
}),
|
|
4752
|
-
|
|
4753
|
-
type:
|
|
4754
|
-
id:
|
|
4755
|
-
call_id:
|
|
4756
|
-
status:
|
|
4757
|
-
action:
|
|
4758
|
-
commands:
|
|
4875
|
+
z20.object({
|
|
4876
|
+
type: z20.literal("shell_call"),
|
|
4877
|
+
id: z20.string(),
|
|
4878
|
+
call_id: z20.string(),
|
|
4879
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4880
|
+
action: z20.object({
|
|
4881
|
+
commands: z20.array(z20.string())
|
|
4759
4882
|
})
|
|
4760
4883
|
}),
|
|
4761
|
-
|
|
4762
|
-
type:
|
|
4763
|
-
id:
|
|
4764
|
-
encrypted_content:
|
|
4884
|
+
z20.object({
|
|
4885
|
+
type: z20.literal("compaction"),
|
|
4886
|
+
id: z20.string(),
|
|
4887
|
+
encrypted_content: z20.string()
|
|
4765
4888
|
}),
|
|
4766
|
-
|
|
4767
|
-
type:
|
|
4768
|
-
id:
|
|
4769
|
-
call_id:
|
|
4770
|
-
status:
|
|
4771
|
-
output:
|
|
4772
|
-
|
|
4773
|
-
stdout:
|
|
4774
|
-
stderr:
|
|
4775
|
-
outcome:
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
type:
|
|
4779
|
-
exit_code:
|
|
4889
|
+
z20.object({
|
|
4890
|
+
type: z20.literal("shell_call_output"),
|
|
4891
|
+
id: z20.string(),
|
|
4892
|
+
call_id: z20.string(),
|
|
4893
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4894
|
+
output: z20.array(
|
|
4895
|
+
z20.object({
|
|
4896
|
+
stdout: z20.string(),
|
|
4897
|
+
stderr: z20.string(),
|
|
4898
|
+
outcome: z20.discriminatedUnion("type", [
|
|
4899
|
+
z20.object({ type: z20.literal("timeout") }),
|
|
4900
|
+
z20.object({
|
|
4901
|
+
type: z20.literal("exit"),
|
|
4902
|
+
exit_code: z20.number()
|
|
4780
4903
|
})
|
|
4781
4904
|
])
|
|
4782
4905
|
})
|
|
4783
4906
|
)
|
|
4784
4907
|
}),
|
|
4785
|
-
|
|
4786
|
-
type:
|
|
4787
|
-
id:
|
|
4788
|
-
execution:
|
|
4789
|
-
call_id:
|
|
4790
|
-
status:
|
|
4791
|
-
arguments:
|
|
4908
|
+
z20.object({
|
|
4909
|
+
type: z20.literal("tool_search_call"),
|
|
4910
|
+
id: z20.string(),
|
|
4911
|
+
execution: z20.enum(["server", "client"]),
|
|
4912
|
+
call_id: z20.string().nullable(),
|
|
4913
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4914
|
+
arguments: z20.unknown()
|
|
4792
4915
|
}),
|
|
4793
|
-
|
|
4794
|
-
type:
|
|
4795
|
-
id:
|
|
4796
|
-
execution:
|
|
4797
|
-
call_id:
|
|
4798
|
-
status:
|
|
4799
|
-
tools:
|
|
4916
|
+
z20.object({
|
|
4917
|
+
type: z20.literal("tool_search_output"),
|
|
4918
|
+
id: z20.string(),
|
|
4919
|
+
execution: z20.enum(["server", "client"]),
|
|
4920
|
+
call_id: z20.string().nullable(),
|
|
4921
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
4922
|
+
tools: z20.array(z20.record(z20.string(), jsonValueSchema.optional()))
|
|
4800
4923
|
})
|
|
4801
4924
|
])
|
|
4802
4925
|
}),
|
|
4803
|
-
|
|
4804
|
-
type:
|
|
4805
|
-
item_id:
|
|
4806
|
-
output_index:
|
|
4807
|
-
delta:
|
|
4926
|
+
z20.object({
|
|
4927
|
+
type: z20.literal("response.function_call_arguments.delta"),
|
|
4928
|
+
item_id: z20.string(),
|
|
4929
|
+
output_index: z20.number(),
|
|
4930
|
+
delta: z20.string()
|
|
4808
4931
|
}),
|
|
4809
|
-
|
|
4810
|
-
type:
|
|
4811
|
-
item_id:
|
|
4812
|
-
output_index:
|
|
4813
|
-
delta:
|
|
4932
|
+
z20.object({
|
|
4933
|
+
type: z20.literal("response.custom_tool_call_input.delta"),
|
|
4934
|
+
item_id: z20.string(),
|
|
4935
|
+
output_index: z20.number(),
|
|
4936
|
+
delta: z20.string()
|
|
4814
4937
|
}),
|
|
4815
|
-
|
|
4816
|
-
type:
|
|
4817
|
-
item_id:
|
|
4818
|
-
output_index:
|
|
4819
|
-
partial_image_b64:
|
|
4938
|
+
z20.object({
|
|
4939
|
+
type: z20.literal("response.image_generation_call.partial_image"),
|
|
4940
|
+
item_id: z20.string(),
|
|
4941
|
+
output_index: z20.number(),
|
|
4942
|
+
partial_image_b64: z20.string()
|
|
4820
4943
|
}),
|
|
4821
|
-
|
|
4822
|
-
type:
|
|
4823
|
-
item_id:
|
|
4824
|
-
output_index:
|
|
4825
|
-
delta:
|
|
4944
|
+
z20.object({
|
|
4945
|
+
type: z20.literal("response.code_interpreter_call_code.delta"),
|
|
4946
|
+
item_id: z20.string(),
|
|
4947
|
+
output_index: z20.number(),
|
|
4948
|
+
delta: z20.string()
|
|
4826
4949
|
}),
|
|
4827
|
-
|
|
4828
|
-
type:
|
|
4829
|
-
item_id:
|
|
4830
|
-
output_index:
|
|
4831
|
-
code:
|
|
4950
|
+
z20.object({
|
|
4951
|
+
type: z20.literal("response.code_interpreter_call_code.done"),
|
|
4952
|
+
item_id: z20.string(),
|
|
4953
|
+
output_index: z20.number(),
|
|
4954
|
+
code: z20.string()
|
|
4832
4955
|
}),
|
|
4833
|
-
|
|
4834
|
-
type:
|
|
4835
|
-
annotation:
|
|
4836
|
-
|
|
4837
|
-
type:
|
|
4838
|
-
start_index:
|
|
4839
|
-
end_index:
|
|
4840
|
-
url:
|
|
4841
|
-
title:
|
|
4956
|
+
z20.object({
|
|
4957
|
+
type: z20.literal("response.output_text.annotation.added"),
|
|
4958
|
+
annotation: z20.discriminatedUnion("type", [
|
|
4959
|
+
z20.object({
|
|
4960
|
+
type: z20.literal("url_citation"),
|
|
4961
|
+
start_index: z20.number(),
|
|
4962
|
+
end_index: z20.number(),
|
|
4963
|
+
url: z20.string(),
|
|
4964
|
+
title: z20.string()
|
|
4842
4965
|
}),
|
|
4843
|
-
|
|
4844
|
-
type:
|
|
4845
|
-
file_id:
|
|
4846
|
-
filename:
|
|
4847
|
-
index:
|
|
4966
|
+
z20.object({
|
|
4967
|
+
type: z20.literal("file_citation"),
|
|
4968
|
+
file_id: z20.string(),
|
|
4969
|
+
filename: z20.string(),
|
|
4970
|
+
index: z20.number()
|
|
4848
4971
|
}),
|
|
4849
|
-
|
|
4850
|
-
type:
|
|
4851
|
-
container_id:
|
|
4852
|
-
file_id:
|
|
4853
|
-
filename:
|
|
4854
|
-
start_index:
|
|
4855
|
-
end_index:
|
|
4972
|
+
z20.object({
|
|
4973
|
+
type: z20.literal("container_file_citation"),
|
|
4974
|
+
container_id: z20.string(),
|
|
4975
|
+
file_id: z20.string(),
|
|
4976
|
+
filename: z20.string(),
|
|
4977
|
+
start_index: z20.number(),
|
|
4978
|
+
end_index: z20.number()
|
|
4856
4979
|
}),
|
|
4857
|
-
|
|
4858
|
-
type:
|
|
4859
|
-
file_id:
|
|
4860
|
-
index:
|
|
4980
|
+
z20.object({
|
|
4981
|
+
type: z20.literal("file_path"),
|
|
4982
|
+
file_id: z20.string(),
|
|
4983
|
+
index: z20.number()
|
|
4861
4984
|
})
|
|
4862
4985
|
])
|
|
4863
4986
|
}),
|
|
4864
|
-
|
|
4865
|
-
type:
|
|
4866
|
-
item_id:
|
|
4867
|
-
summary_index:
|
|
4987
|
+
z20.object({
|
|
4988
|
+
type: z20.literal("response.reasoning_summary_part.added"),
|
|
4989
|
+
item_id: z20.string(),
|
|
4990
|
+
summary_index: z20.number()
|
|
4868
4991
|
}),
|
|
4869
|
-
|
|
4870
|
-
type:
|
|
4871
|
-
item_id:
|
|
4872
|
-
summary_index:
|
|
4873
|
-
delta:
|
|
4992
|
+
z20.object({
|
|
4993
|
+
type: z20.literal("response.reasoning_summary_text.delta"),
|
|
4994
|
+
item_id: z20.string(),
|
|
4995
|
+
summary_index: z20.number(),
|
|
4996
|
+
delta: z20.string()
|
|
4874
4997
|
}),
|
|
4875
|
-
|
|
4876
|
-
type:
|
|
4877
|
-
item_id:
|
|
4878
|
-
summary_index:
|
|
4998
|
+
z20.object({
|
|
4999
|
+
type: z20.literal("response.reasoning_summary_part.done"),
|
|
5000
|
+
item_id: z20.string(),
|
|
5001
|
+
summary_index: z20.number()
|
|
4879
5002
|
}),
|
|
4880
|
-
|
|
4881
|
-
type:
|
|
4882
|
-
item_id:
|
|
4883
|
-
output_index:
|
|
4884
|
-
delta:
|
|
4885
|
-
obfuscation:
|
|
5003
|
+
z20.object({
|
|
5004
|
+
type: z20.literal("response.apply_patch_call_operation_diff.delta"),
|
|
5005
|
+
item_id: z20.string(),
|
|
5006
|
+
output_index: z20.number(),
|
|
5007
|
+
delta: z20.string(),
|
|
5008
|
+
obfuscation: z20.string().nullish()
|
|
4886
5009
|
}),
|
|
4887
|
-
|
|
4888
|
-
type:
|
|
4889
|
-
item_id:
|
|
4890
|
-
output_index:
|
|
4891
|
-
diff:
|
|
5010
|
+
z20.object({
|
|
5011
|
+
type: z20.literal("response.apply_patch_call_operation_diff.done"),
|
|
5012
|
+
item_id: z20.string(),
|
|
5013
|
+
output_index: z20.number(),
|
|
5014
|
+
diff: z20.string()
|
|
4892
5015
|
}),
|
|
4893
5016
|
openaiResponsesNestedErrorChunkSchema,
|
|
4894
5017
|
openaiResponsesErrorChunkSchema,
|
|
4895
|
-
|
|
5018
|
+
z20.object({ type: z20.string() }).loose().transform((value) => ({
|
|
4896
5019
|
type: "unknown_chunk",
|
|
4897
5020
|
message: value.type
|
|
4898
5021
|
}))
|
|
@@ -4900,315 +5023,318 @@ var openaiResponsesChunkSchema = lazySchema17(
|
|
|
4900
5023
|
])
|
|
4901
5024
|
)
|
|
4902
5025
|
);
|
|
4903
|
-
var openaiResponsesResponseSchema =
|
|
4904
|
-
() =>
|
|
4905
|
-
|
|
4906
|
-
id:
|
|
4907
|
-
created_at:
|
|
4908
|
-
error:
|
|
4909
|
-
message:
|
|
4910
|
-
type:
|
|
4911
|
-
param:
|
|
4912
|
-
code:
|
|
5026
|
+
var openaiResponsesResponseSchema = lazySchema18(
|
|
5027
|
+
() => zodSchema18(
|
|
5028
|
+
z20.object({
|
|
5029
|
+
id: z20.string().optional(),
|
|
5030
|
+
created_at: z20.number().optional(),
|
|
5031
|
+
error: z20.object({
|
|
5032
|
+
message: z20.string(),
|
|
5033
|
+
type: z20.string(),
|
|
5034
|
+
param: z20.string().nullish(),
|
|
5035
|
+
code: z20.string()
|
|
4913
5036
|
}).nullish(),
|
|
4914
|
-
model:
|
|
4915
|
-
output:
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
type:
|
|
4919
|
-
role:
|
|
4920
|
-
id:
|
|
4921
|
-
phase:
|
|
4922
|
-
content:
|
|
4923
|
-
|
|
4924
|
-
type:
|
|
4925
|
-
text:
|
|
4926
|
-
logprobs:
|
|
4927
|
-
|
|
4928
|
-
token:
|
|
4929
|
-
logprob:
|
|
4930
|
-
top_logprobs:
|
|
4931
|
-
|
|
4932
|
-
token:
|
|
4933
|
-
logprob:
|
|
5037
|
+
model: z20.string().optional(),
|
|
5038
|
+
output: z20.array(
|
|
5039
|
+
z20.discriminatedUnion("type", [
|
|
5040
|
+
z20.object({
|
|
5041
|
+
type: z20.literal("message"),
|
|
5042
|
+
role: z20.literal("assistant"),
|
|
5043
|
+
id: z20.string(),
|
|
5044
|
+
phase: z20.enum(["commentary", "final_answer"]).nullish(),
|
|
5045
|
+
content: z20.array(
|
|
5046
|
+
z20.object({
|
|
5047
|
+
type: z20.literal("output_text"),
|
|
5048
|
+
text: z20.string(),
|
|
5049
|
+
logprobs: z20.array(
|
|
5050
|
+
z20.object({
|
|
5051
|
+
token: z20.string(),
|
|
5052
|
+
logprob: z20.number(),
|
|
5053
|
+
top_logprobs: z20.array(
|
|
5054
|
+
z20.object({
|
|
5055
|
+
token: z20.string(),
|
|
5056
|
+
logprob: z20.number()
|
|
4934
5057
|
})
|
|
4935
5058
|
)
|
|
4936
5059
|
})
|
|
4937
5060
|
).nullish(),
|
|
4938
|
-
annotations:
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
type:
|
|
4942
|
-
start_index:
|
|
4943
|
-
end_index:
|
|
4944
|
-
url:
|
|
4945
|
-
title:
|
|
5061
|
+
annotations: z20.array(
|
|
5062
|
+
z20.discriminatedUnion("type", [
|
|
5063
|
+
z20.object({
|
|
5064
|
+
type: z20.literal("url_citation"),
|
|
5065
|
+
start_index: z20.number(),
|
|
5066
|
+
end_index: z20.number(),
|
|
5067
|
+
url: z20.string(),
|
|
5068
|
+
title: z20.string()
|
|
4946
5069
|
}),
|
|
4947
|
-
|
|
4948
|
-
type:
|
|
4949
|
-
file_id:
|
|
4950
|
-
filename:
|
|
4951
|
-
index:
|
|
5070
|
+
z20.object({
|
|
5071
|
+
type: z20.literal("file_citation"),
|
|
5072
|
+
file_id: z20.string(),
|
|
5073
|
+
filename: z20.string(),
|
|
5074
|
+
index: z20.number()
|
|
4952
5075
|
}),
|
|
4953
|
-
|
|
4954
|
-
type:
|
|
4955
|
-
container_id:
|
|
4956
|
-
file_id:
|
|
4957
|
-
filename:
|
|
4958
|
-
start_index:
|
|
4959
|
-
end_index:
|
|
5076
|
+
z20.object({
|
|
5077
|
+
type: z20.literal("container_file_citation"),
|
|
5078
|
+
container_id: z20.string(),
|
|
5079
|
+
file_id: z20.string(),
|
|
5080
|
+
filename: z20.string(),
|
|
5081
|
+
start_index: z20.number(),
|
|
5082
|
+
end_index: z20.number()
|
|
4960
5083
|
}),
|
|
4961
|
-
|
|
4962
|
-
type:
|
|
4963
|
-
file_id:
|
|
4964
|
-
index:
|
|
5084
|
+
z20.object({
|
|
5085
|
+
type: z20.literal("file_path"),
|
|
5086
|
+
file_id: z20.string(),
|
|
5087
|
+
index: z20.number()
|
|
4965
5088
|
})
|
|
4966
5089
|
])
|
|
4967
5090
|
)
|
|
4968
5091
|
})
|
|
4969
5092
|
)
|
|
4970
5093
|
}),
|
|
4971
|
-
|
|
4972
|
-
type:
|
|
4973
|
-
id:
|
|
4974
|
-
status:
|
|
4975
|
-
action:
|
|
4976
|
-
|
|
4977
|
-
type:
|
|
4978
|
-
query:
|
|
4979
|
-
queries:
|
|
4980
|
-
sources:
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
type:
|
|
4985
|
-
name:
|
|
5094
|
+
z20.object({
|
|
5095
|
+
type: z20.literal("web_search_call"),
|
|
5096
|
+
id: z20.string(),
|
|
5097
|
+
status: z20.string(),
|
|
5098
|
+
action: z20.discriminatedUnion("type", [
|
|
5099
|
+
z20.object({
|
|
5100
|
+
type: z20.literal("search"),
|
|
5101
|
+
query: z20.string().nullish(),
|
|
5102
|
+
queries: z20.array(z20.string()).nullish(),
|
|
5103
|
+
sources: z20.array(
|
|
5104
|
+
z20.discriminatedUnion("type", [
|
|
5105
|
+
z20.object({ type: z20.literal("url"), url: z20.string() }),
|
|
5106
|
+
z20.object({
|
|
5107
|
+
type: z20.literal("api"),
|
|
5108
|
+
name: z20.string()
|
|
4986
5109
|
})
|
|
4987
5110
|
])
|
|
4988
5111
|
).nullish()
|
|
4989
5112
|
}),
|
|
4990
|
-
|
|
4991
|
-
type:
|
|
4992
|
-
url:
|
|
5113
|
+
z20.object({
|
|
5114
|
+
type: z20.literal("open_page"),
|
|
5115
|
+
url: z20.string().nullish()
|
|
4993
5116
|
}),
|
|
4994
|
-
|
|
4995
|
-
type:
|
|
4996
|
-
url:
|
|
4997
|
-
pattern:
|
|
5117
|
+
z20.object({
|
|
5118
|
+
type: z20.literal("find_in_page"),
|
|
5119
|
+
url: z20.string().nullish(),
|
|
5120
|
+
pattern: z20.string().nullish()
|
|
4998
5121
|
})
|
|
4999
5122
|
]).nullish()
|
|
5000
5123
|
}),
|
|
5001
|
-
|
|
5002
|
-
type:
|
|
5003
|
-
id:
|
|
5004
|
-
queries:
|
|
5005
|
-
results:
|
|
5006
|
-
|
|
5007
|
-
attributes:
|
|
5008
|
-
|
|
5009
|
-
|
|
5124
|
+
z20.object({
|
|
5125
|
+
type: z20.literal("file_search_call"),
|
|
5126
|
+
id: z20.string(),
|
|
5127
|
+
queries: z20.array(z20.string()),
|
|
5128
|
+
results: z20.array(
|
|
5129
|
+
z20.object({
|
|
5130
|
+
attributes: z20.record(
|
|
5131
|
+
z20.string(),
|
|
5132
|
+
z20.union([z20.string(), z20.number(), z20.boolean()])
|
|
5010
5133
|
),
|
|
5011
|
-
file_id:
|
|
5012
|
-
filename:
|
|
5013
|
-
score:
|
|
5014
|
-
text:
|
|
5134
|
+
file_id: z20.string(),
|
|
5135
|
+
filename: z20.string(),
|
|
5136
|
+
score: z20.number(),
|
|
5137
|
+
text: z20.string()
|
|
5015
5138
|
})
|
|
5016
5139
|
).nullish()
|
|
5017
5140
|
}),
|
|
5018
|
-
|
|
5019
|
-
type:
|
|
5020
|
-
id:
|
|
5021
|
-
code:
|
|
5022
|
-
container_id:
|
|
5023
|
-
outputs:
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5141
|
+
z20.object({
|
|
5142
|
+
type: z20.literal("code_interpreter_call"),
|
|
5143
|
+
id: z20.string(),
|
|
5144
|
+
code: z20.string().nullable(),
|
|
5145
|
+
container_id: z20.string(),
|
|
5146
|
+
outputs: z20.array(
|
|
5147
|
+
z20.discriminatedUnion("type", [
|
|
5148
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
5149
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
5027
5150
|
])
|
|
5028
5151
|
).nullable()
|
|
5029
5152
|
}),
|
|
5030
|
-
|
|
5031
|
-
type:
|
|
5032
|
-
id:
|
|
5033
|
-
result:
|
|
5153
|
+
z20.object({
|
|
5154
|
+
type: z20.literal("image_generation_call"),
|
|
5155
|
+
id: z20.string(),
|
|
5156
|
+
result: z20.string()
|
|
5034
5157
|
}),
|
|
5035
|
-
|
|
5036
|
-
type:
|
|
5037
|
-
id:
|
|
5038
|
-
call_id:
|
|
5039
|
-
action:
|
|
5040
|
-
type:
|
|
5041
|
-
command:
|
|
5042
|
-
timeout_ms:
|
|
5043
|
-
user:
|
|
5044
|
-
working_directory:
|
|
5045
|
-
env:
|
|
5158
|
+
z20.object({
|
|
5159
|
+
type: z20.literal("local_shell_call"),
|
|
5160
|
+
id: z20.string(),
|
|
5161
|
+
call_id: z20.string(),
|
|
5162
|
+
action: z20.object({
|
|
5163
|
+
type: z20.literal("exec"),
|
|
5164
|
+
command: z20.array(z20.string()),
|
|
5165
|
+
timeout_ms: z20.number().optional(),
|
|
5166
|
+
user: z20.string().optional(),
|
|
5167
|
+
working_directory: z20.string().optional(),
|
|
5168
|
+
env: z20.record(z20.string(), z20.string()).optional()
|
|
5046
5169
|
})
|
|
5047
5170
|
}),
|
|
5048
|
-
|
|
5049
|
-
type:
|
|
5050
|
-
call_id:
|
|
5051
|
-
name:
|
|
5052
|
-
arguments:
|
|
5053
|
-
id:
|
|
5054
|
-
namespace:
|
|
5171
|
+
z20.object({
|
|
5172
|
+
type: z20.literal("function_call"),
|
|
5173
|
+
call_id: z20.string(),
|
|
5174
|
+
name: z20.string(),
|
|
5175
|
+
arguments: z20.string(),
|
|
5176
|
+
id: z20.string(),
|
|
5177
|
+
namespace: z20.string().nullish(),
|
|
5178
|
+
caller: openaiResponsesToolCallerSchema.nullish()
|
|
5055
5179
|
}),
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5180
|
+
openaiResponsesProgramSchema,
|
|
5181
|
+
openaiResponsesProgramOutputSchema,
|
|
5182
|
+
z20.object({
|
|
5183
|
+
type: z20.literal("custom_tool_call"),
|
|
5184
|
+
call_id: z20.string(),
|
|
5185
|
+
name: z20.string(),
|
|
5186
|
+
input: z20.string(),
|
|
5187
|
+
id: z20.string()
|
|
5062
5188
|
}),
|
|
5063
5189
|
openaiResponsesComputerCallSchema,
|
|
5064
|
-
|
|
5065
|
-
type:
|
|
5066
|
-
id:
|
|
5067
|
-
encrypted_content:
|
|
5068
|
-
summary:
|
|
5069
|
-
|
|
5070
|
-
type:
|
|
5071
|
-
text:
|
|
5190
|
+
z20.object({
|
|
5191
|
+
type: z20.literal("reasoning"),
|
|
5192
|
+
id: z20.string(),
|
|
5193
|
+
encrypted_content: z20.string().nullish(),
|
|
5194
|
+
summary: z20.array(
|
|
5195
|
+
z20.object({
|
|
5196
|
+
type: z20.literal("summary_text"),
|
|
5197
|
+
text: z20.string()
|
|
5072
5198
|
})
|
|
5073
5199
|
)
|
|
5074
5200
|
}),
|
|
5075
|
-
|
|
5076
|
-
type:
|
|
5077
|
-
id:
|
|
5078
|
-
status:
|
|
5079
|
-
arguments:
|
|
5080
|
-
name:
|
|
5081
|
-
server_label:
|
|
5082
|
-
output:
|
|
5083
|
-
error:
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
type:
|
|
5087
|
-
code:
|
|
5088
|
-
message:
|
|
5201
|
+
z20.object({
|
|
5202
|
+
type: z20.literal("mcp_call"),
|
|
5203
|
+
id: z20.string(),
|
|
5204
|
+
status: z20.string(),
|
|
5205
|
+
arguments: z20.string(),
|
|
5206
|
+
name: z20.string(),
|
|
5207
|
+
server_label: z20.string(),
|
|
5208
|
+
output: z20.string().nullish(),
|
|
5209
|
+
error: z20.union([
|
|
5210
|
+
z20.string(),
|
|
5211
|
+
z20.object({
|
|
5212
|
+
type: z20.string().optional(),
|
|
5213
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
5214
|
+
message: z20.string().optional()
|
|
5089
5215
|
}).loose()
|
|
5090
5216
|
]).nullish(),
|
|
5091
|
-
approval_request_id:
|
|
5217
|
+
approval_request_id: z20.string().nullish()
|
|
5092
5218
|
}),
|
|
5093
|
-
|
|
5094
|
-
type:
|
|
5095
|
-
id:
|
|
5096
|
-
server_label:
|
|
5097
|
-
tools:
|
|
5098
|
-
|
|
5099
|
-
name:
|
|
5100
|
-
description:
|
|
5101
|
-
input_schema:
|
|
5102
|
-
annotations:
|
|
5219
|
+
z20.object({
|
|
5220
|
+
type: z20.literal("mcp_list_tools"),
|
|
5221
|
+
id: z20.string(),
|
|
5222
|
+
server_label: z20.string(),
|
|
5223
|
+
tools: z20.array(
|
|
5224
|
+
z20.object({
|
|
5225
|
+
name: z20.string(),
|
|
5226
|
+
description: z20.string().optional(),
|
|
5227
|
+
input_schema: z20.any(),
|
|
5228
|
+
annotations: z20.record(z20.string(), z20.unknown()).optional()
|
|
5103
5229
|
})
|
|
5104
5230
|
),
|
|
5105
|
-
error:
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
type:
|
|
5109
|
-
code:
|
|
5110
|
-
message:
|
|
5231
|
+
error: z20.union([
|
|
5232
|
+
z20.string(),
|
|
5233
|
+
z20.object({
|
|
5234
|
+
type: z20.string().optional(),
|
|
5235
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
5236
|
+
message: z20.string().optional()
|
|
5111
5237
|
}).loose()
|
|
5112
5238
|
]).optional()
|
|
5113
5239
|
}),
|
|
5114
|
-
|
|
5115
|
-
type:
|
|
5116
|
-
id:
|
|
5117
|
-
server_label:
|
|
5118
|
-
name:
|
|
5119
|
-
arguments:
|
|
5120
|
-
approval_request_id:
|
|
5240
|
+
z20.object({
|
|
5241
|
+
type: z20.literal("mcp_approval_request"),
|
|
5242
|
+
id: z20.string(),
|
|
5243
|
+
server_label: z20.string(),
|
|
5244
|
+
name: z20.string(),
|
|
5245
|
+
arguments: z20.string(),
|
|
5246
|
+
approval_request_id: z20.string().optional()
|
|
5121
5247
|
}),
|
|
5122
|
-
|
|
5123
|
-
type:
|
|
5124
|
-
id:
|
|
5125
|
-
call_id:
|
|
5126
|
-
status:
|
|
5127
|
-
operation:
|
|
5128
|
-
|
|
5129
|
-
type:
|
|
5130
|
-
path:
|
|
5131
|
-
diff:
|
|
5248
|
+
z20.object({
|
|
5249
|
+
type: z20.literal("apply_patch_call"),
|
|
5250
|
+
id: z20.string(),
|
|
5251
|
+
call_id: z20.string(),
|
|
5252
|
+
status: z20.enum(["in_progress", "completed"]),
|
|
5253
|
+
operation: z20.discriminatedUnion("type", [
|
|
5254
|
+
z20.object({
|
|
5255
|
+
type: z20.literal("create_file"),
|
|
5256
|
+
path: z20.string(),
|
|
5257
|
+
diff: z20.string()
|
|
5132
5258
|
}),
|
|
5133
|
-
|
|
5134
|
-
type:
|
|
5135
|
-
path:
|
|
5259
|
+
z20.object({
|
|
5260
|
+
type: z20.literal("delete_file"),
|
|
5261
|
+
path: z20.string()
|
|
5136
5262
|
}),
|
|
5137
|
-
|
|
5138
|
-
type:
|
|
5139
|
-
path:
|
|
5140
|
-
diff:
|
|
5263
|
+
z20.object({
|
|
5264
|
+
type: z20.literal("update_file"),
|
|
5265
|
+
path: z20.string(),
|
|
5266
|
+
diff: z20.string()
|
|
5141
5267
|
})
|
|
5142
5268
|
])
|
|
5143
5269
|
}),
|
|
5144
|
-
|
|
5145
|
-
type:
|
|
5146
|
-
id:
|
|
5147
|
-
call_id:
|
|
5148
|
-
status:
|
|
5149
|
-
action:
|
|
5150
|
-
commands:
|
|
5270
|
+
z20.object({
|
|
5271
|
+
type: z20.literal("shell_call"),
|
|
5272
|
+
id: z20.string(),
|
|
5273
|
+
call_id: z20.string(),
|
|
5274
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5275
|
+
action: z20.object({
|
|
5276
|
+
commands: z20.array(z20.string())
|
|
5151
5277
|
})
|
|
5152
5278
|
}),
|
|
5153
|
-
|
|
5154
|
-
type:
|
|
5155
|
-
id:
|
|
5156
|
-
encrypted_content:
|
|
5279
|
+
z20.object({
|
|
5280
|
+
type: z20.literal("compaction"),
|
|
5281
|
+
id: z20.string(),
|
|
5282
|
+
encrypted_content: z20.string()
|
|
5157
5283
|
}),
|
|
5158
|
-
|
|
5159
|
-
type:
|
|
5160
|
-
id:
|
|
5161
|
-
call_id:
|
|
5162
|
-
status:
|
|
5163
|
-
output:
|
|
5164
|
-
|
|
5165
|
-
stdout:
|
|
5166
|
-
stderr:
|
|
5167
|
-
outcome:
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
type:
|
|
5171
|
-
exit_code:
|
|
5284
|
+
z20.object({
|
|
5285
|
+
type: z20.literal("shell_call_output"),
|
|
5286
|
+
id: z20.string(),
|
|
5287
|
+
call_id: z20.string(),
|
|
5288
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5289
|
+
output: z20.array(
|
|
5290
|
+
z20.object({
|
|
5291
|
+
stdout: z20.string(),
|
|
5292
|
+
stderr: z20.string(),
|
|
5293
|
+
outcome: z20.discriminatedUnion("type", [
|
|
5294
|
+
z20.object({ type: z20.literal("timeout") }),
|
|
5295
|
+
z20.object({
|
|
5296
|
+
type: z20.literal("exit"),
|
|
5297
|
+
exit_code: z20.number()
|
|
5172
5298
|
})
|
|
5173
5299
|
])
|
|
5174
5300
|
})
|
|
5175
5301
|
)
|
|
5176
5302
|
}),
|
|
5177
|
-
|
|
5178
|
-
type:
|
|
5179
|
-
id:
|
|
5180
|
-
execution:
|
|
5181
|
-
call_id:
|
|
5182
|
-
status:
|
|
5183
|
-
arguments:
|
|
5303
|
+
z20.object({
|
|
5304
|
+
type: z20.literal("tool_search_call"),
|
|
5305
|
+
id: z20.string(),
|
|
5306
|
+
execution: z20.enum(["server", "client"]),
|
|
5307
|
+
call_id: z20.string().nullable(),
|
|
5308
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5309
|
+
arguments: z20.unknown()
|
|
5184
5310
|
}),
|
|
5185
|
-
|
|
5186
|
-
type:
|
|
5187
|
-
id:
|
|
5188
|
-
execution:
|
|
5189
|
-
call_id:
|
|
5190
|
-
status:
|
|
5191
|
-
tools:
|
|
5311
|
+
z20.object({
|
|
5312
|
+
type: z20.literal("tool_search_output"),
|
|
5313
|
+
id: z20.string(),
|
|
5314
|
+
execution: z20.enum(["server", "client"]),
|
|
5315
|
+
call_id: z20.string().nullable(),
|
|
5316
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
5317
|
+
tools: z20.array(z20.record(z20.string(), jsonValueSchema.optional()))
|
|
5192
5318
|
})
|
|
5193
5319
|
])
|
|
5194
5320
|
).optional(),
|
|
5195
|
-
service_tier:
|
|
5196
|
-
reasoning:
|
|
5197
|
-
context:
|
|
5321
|
+
service_tier: z20.string().nullish(),
|
|
5322
|
+
reasoning: z20.object({
|
|
5323
|
+
context: z20.string().nullish()
|
|
5198
5324
|
}).nullish(),
|
|
5199
|
-
incomplete_details:
|
|
5200
|
-
usage:
|
|
5201
|
-
input_tokens:
|
|
5202
|
-
input_tokens_details:
|
|
5203
|
-
cached_tokens:
|
|
5204
|
-
cache_write_tokens:
|
|
5205
|
-
orchestration_input_tokens:
|
|
5206
|
-
orchestration_input_cached_tokens:
|
|
5325
|
+
incomplete_details: z20.object({ reason: z20.string() }).nullish(),
|
|
5326
|
+
usage: z20.object({
|
|
5327
|
+
input_tokens: z20.number(),
|
|
5328
|
+
input_tokens_details: z20.object({
|
|
5329
|
+
cached_tokens: z20.number().nullish(),
|
|
5330
|
+
cache_write_tokens: z20.number().nullish(),
|
|
5331
|
+
orchestration_input_tokens: z20.number().nullish(),
|
|
5332
|
+
orchestration_input_cached_tokens: z20.number().nullish()
|
|
5207
5333
|
}).nullish(),
|
|
5208
|
-
output_tokens:
|
|
5209
|
-
output_tokens_details:
|
|
5210
|
-
reasoning_tokens:
|
|
5211
|
-
orchestration_output_tokens:
|
|
5334
|
+
output_tokens: z20.number(),
|
|
5335
|
+
output_tokens_details: z20.object({
|
|
5336
|
+
reasoning_tokens: z20.number().nullish(),
|
|
5337
|
+
orchestration_output_tokens: z20.number().nullish()
|
|
5212
5338
|
}).nullish()
|
|
5213
5339
|
}).optional()
|
|
5214
5340
|
})
|
|
@@ -5217,10 +5343,10 @@ var openaiResponsesResponseSchema = lazySchema17(
|
|
|
5217
5343
|
|
|
5218
5344
|
// src/responses/openai-responses-language-model-options.ts
|
|
5219
5345
|
import {
|
|
5220
|
-
lazySchema as
|
|
5221
|
-
zodSchema as
|
|
5346
|
+
lazySchema as lazySchema19,
|
|
5347
|
+
zodSchema as zodSchema19
|
|
5222
5348
|
} from "@ai-sdk/provider-utils";
|
|
5223
|
-
import { z as
|
|
5349
|
+
import { z as z21 } from "zod/v4";
|
|
5224
5350
|
var TOP_LOGPROBS_MAX = 20;
|
|
5225
5351
|
var openaiResponsesReasoningModelIds = [
|
|
5226
5352
|
"o1",
|
|
@@ -5291,9 +5417,9 @@ var openaiResponsesModelIds = [
|
|
|
5291
5417
|
"gpt-5-chat-latest",
|
|
5292
5418
|
...openaiResponsesReasoningModelIds
|
|
5293
5419
|
];
|
|
5294
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
5295
|
-
() =>
|
|
5296
|
-
|
|
5420
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema19(
|
|
5421
|
+
() => zodSchema19(
|
|
5422
|
+
z21.object({
|
|
5297
5423
|
/**
|
|
5298
5424
|
* The ID of the OpenAI Conversation to continue.
|
|
5299
5425
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -5301,13 +5427,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
5301
5427
|
* Defaults to `undefined`.
|
|
5302
5428
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
5303
5429
|
*/
|
|
5304
|
-
conversation:
|
|
5430
|
+
conversation: z21.string().nullish(),
|
|
5305
5431
|
/**
|
|
5306
5432
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
5307
5433
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
|
|
5308
5434
|
*/
|
|
5309
|
-
include:
|
|
5310
|
-
|
|
5435
|
+
include: z21.array(
|
|
5436
|
+
z21.enum([
|
|
5311
5437
|
"reasoning.encrypted_content",
|
|
5312
5438
|
// handled internally by default, only needed for unknown reasoning models
|
|
5313
5439
|
"file_search_call.results",
|
|
@@ -5320,7 +5446,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
5320
5446
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
5321
5447
|
* Defaults to `undefined`.
|
|
5322
5448
|
*/
|
|
5323
|
-
instructions:
|
|
5449
|
+
instructions: z21.string().nullish(),
|
|
5324
5450
|
/**
|
|
5325
5451
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
5326
5452
|
* the response size and can slow down response times. However, it can
|
|
@@ -5335,38 +5461,38 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
5335
5461
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
5336
5462
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
5337
5463
|
*/
|
|
5338
|
-
logprobs:
|
|
5464
|
+
logprobs: z21.union([z21.boolean(), z21.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
5339
5465
|
/**
|
|
5340
5466
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
5341
5467
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
5342
5468
|
* Any further attempts to call a tool by the model will be ignored.
|
|
5343
5469
|
*/
|
|
5344
|
-
maxToolCalls:
|
|
5470
|
+
maxToolCalls: z21.number().nullish(),
|
|
5345
5471
|
/**
|
|
5346
5472
|
* Additional metadata to store with the generation.
|
|
5347
5473
|
*/
|
|
5348
|
-
metadata:
|
|
5474
|
+
metadata: z21.any().nullish(),
|
|
5349
5475
|
/**
|
|
5350
5476
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
5351
5477
|
*/
|
|
5352
|
-
parallelToolCalls:
|
|
5478
|
+
parallelToolCalls: z21.boolean().nullish(),
|
|
5353
5479
|
/**
|
|
5354
5480
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
5355
5481
|
* Defaults to `undefined`.
|
|
5356
5482
|
*/
|
|
5357
|
-
previousResponseId:
|
|
5483
|
+
previousResponseId: z21.string().nullish(),
|
|
5358
5484
|
/**
|
|
5359
5485
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
5360
5486
|
*/
|
|
5361
|
-
promptCacheKey:
|
|
5487
|
+
promptCacheKey: z21.string().nullish(),
|
|
5362
5488
|
/**
|
|
5363
5489
|
* Prompt cache behavior for GPT-5.6 and later models.
|
|
5364
5490
|
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
5365
5491
|
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
5366
5492
|
*/
|
|
5367
|
-
promptCacheOptions:
|
|
5368
|
-
mode:
|
|
5369
|
-
ttl:
|
|
5493
|
+
promptCacheOptions: z21.object({
|
|
5494
|
+
mode: z21.enum(["implicit", "explicit"]).optional(),
|
|
5495
|
+
ttl: z21.literal("30m").optional()
|
|
5370
5496
|
}).optional(),
|
|
5371
5497
|
/**
|
|
5372
5498
|
* The retention policy for the prompt cache.
|
|
@@ -5378,35 +5504,35 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
5378
5504
|
*
|
|
5379
5505
|
* @default 'in_memory'
|
|
5380
5506
|
*/
|
|
5381
|
-
promptCacheRetention:
|
|
5507
|
+
promptCacheRetention: z21.enum(["in_memory", "24h"]).nullish(),
|
|
5382
5508
|
/**
|
|
5383
5509
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
5384
5510
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
5385
5511
|
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
5386
5512
|
* Supported values vary by model.
|
|
5387
5513
|
*/
|
|
5388
|
-
reasoningEffort:
|
|
5514
|
+
reasoningEffort: z21.string().nullish(),
|
|
5389
5515
|
/**
|
|
5390
5516
|
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
5391
5517
|
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
5392
5518
|
*/
|
|
5393
|
-
reasoningMode:
|
|
5519
|
+
reasoningMode: z21.enum(["standard", "pro"]).optional(),
|
|
5394
5520
|
/**
|
|
5395
5521
|
* Controls which available reasoning items GPT-5.6 can use.
|
|
5396
5522
|
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
5397
5523
|
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
5398
5524
|
*/
|
|
5399
|
-
reasoningContext:
|
|
5525
|
+
reasoningContext: z21.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
5400
5526
|
/**
|
|
5401
5527
|
* Controls reasoning summary output from the model.
|
|
5402
5528
|
* Set to "auto" to automatically receive the richest level available,
|
|
5403
5529
|
* or "detailed" for comprehensive summaries.
|
|
5404
5530
|
*/
|
|
5405
|
-
reasoningSummary:
|
|
5531
|
+
reasoningSummary: z21.string().nullish(),
|
|
5406
5532
|
/**
|
|
5407
5533
|
* The identifier for safety monitoring and tracking.
|
|
5408
5534
|
*/
|
|
5409
|
-
safetyIdentifier:
|
|
5535
|
+
safetyIdentifier: z21.string().nullish(),
|
|
5410
5536
|
/**
|
|
5411
5537
|
* Service tier for the request.
|
|
5412
5538
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -5414,11 +5540,11 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
5414
5540
|
*
|
|
5415
5541
|
* Defaults to 'auto'.
|
|
5416
5542
|
*/
|
|
5417
|
-
serviceTier:
|
|
5543
|
+
serviceTier: z21.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
5418
5544
|
/**
|
|
5419
5545
|
* Whether to store the generation. Defaults to `true`.
|
|
5420
5546
|
*/
|
|
5421
|
-
store:
|
|
5547
|
+
store: z21.boolean().nullish(),
|
|
5422
5548
|
/**
|
|
5423
5549
|
* Whether to pass through non-image file types as generic input files.
|
|
5424
5550
|
*
|
|
@@ -5426,30 +5552,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
5426
5552
|
* Enable this when the target OpenAI Responses model supports additional
|
|
5427
5553
|
* file media types, such as text/csv.
|
|
5428
5554
|
*/
|
|
5429
|
-
passThroughUnsupportedFiles:
|
|
5555
|
+
passThroughUnsupportedFiles: z21.boolean().optional(),
|
|
5430
5556
|
/**
|
|
5431
5557
|
* Whether to use strict JSON schema validation.
|
|
5432
5558
|
* Defaults to `true`.
|
|
5433
5559
|
*/
|
|
5434
|
-
strictJsonSchema:
|
|
5560
|
+
strictJsonSchema: z21.boolean().nullish(),
|
|
5435
5561
|
/**
|
|
5436
5562
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
5437
5563
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
5438
5564
|
* Valid values: 'low', 'medium', 'high'.
|
|
5439
5565
|
*/
|
|
5440
|
-
textVerbosity:
|
|
5566
|
+
textVerbosity: z21.enum(["low", "medium", "high"]).nullish(),
|
|
5441
5567
|
/**
|
|
5442
5568
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
5443
5569
|
* 'disabled' turns truncation off.
|
|
5444
5570
|
*/
|
|
5445
|
-
truncation:
|
|
5571
|
+
truncation: z21.enum(["auto", "disabled"]).nullish(),
|
|
5446
5572
|
/**
|
|
5447
5573
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
5448
5574
|
* monitor and detect abuse.
|
|
5449
5575
|
* Defaults to `undefined`.
|
|
5450
5576
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
5451
5577
|
*/
|
|
5452
|
-
user:
|
|
5578
|
+
user: z21.string().nullish(),
|
|
5453
5579
|
/**
|
|
5454
5580
|
* Override the system message mode for this model.
|
|
5455
5581
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -5458,7 +5584,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
5458
5584
|
*
|
|
5459
5585
|
* If not specified, the mode is automatically determined based on the model.
|
|
5460
5586
|
*/
|
|
5461
|
-
systemMessageMode:
|
|
5587
|
+
systemMessageMode: z21.enum(["system", "developer", "remove"]).optional(),
|
|
5462
5588
|
/**
|
|
5463
5589
|
* Force treating this model as a reasoning model.
|
|
5464
5590
|
*
|
|
@@ -5468,14 +5594,14 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
5468
5594
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
5469
5595
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
5470
5596
|
*/
|
|
5471
|
-
forceReasoning:
|
|
5597
|
+
forceReasoning: z21.boolean().optional(),
|
|
5472
5598
|
/**
|
|
5473
5599
|
* Enable server-side context management (compaction).
|
|
5474
5600
|
*/
|
|
5475
|
-
contextManagement:
|
|
5476
|
-
|
|
5477
|
-
type:
|
|
5478
|
-
compactThreshold:
|
|
5601
|
+
contextManagement: z21.array(
|
|
5602
|
+
z21.object({
|
|
5603
|
+
type: z21.literal("compaction"),
|
|
5604
|
+
compactThreshold: z21.number()
|
|
5479
5605
|
})
|
|
5480
5606
|
).nullish(),
|
|
5481
5607
|
/**
|
|
@@ -5488,9 +5614,9 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
5488
5614
|
*
|
|
5489
5615
|
* @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
|
|
5490
5616
|
*/
|
|
5491
|
-
allowedTools:
|
|
5492
|
-
toolNames:
|
|
5493
|
-
mode:
|
|
5617
|
+
allowedTools: z21.object({
|
|
5618
|
+
toolNames: z21.array(z21.string()).min(1),
|
|
5619
|
+
mode: z21.enum(["auto", "required"]).optional()
|
|
5494
5620
|
}).optional()
|
|
5495
5621
|
})
|
|
5496
5622
|
)
|
|
@@ -5507,44 +5633,44 @@ import {
|
|
|
5507
5633
|
|
|
5508
5634
|
// src/tool/code-interpreter.ts
|
|
5509
5635
|
import {
|
|
5510
|
-
createProviderExecutedToolFactory,
|
|
5511
|
-
lazySchema as
|
|
5512
|
-
zodSchema as
|
|
5636
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
|
|
5637
|
+
lazySchema as lazySchema20,
|
|
5638
|
+
zodSchema as zodSchema20
|
|
5513
5639
|
} from "@ai-sdk/provider-utils";
|
|
5514
|
-
import { z as
|
|
5515
|
-
var codeInterpreterInputSchema =
|
|
5516
|
-
() =>
|
|
5517
|
-
|
|
5518
|
-
code:
|
|
5519
|
-
containerId:
|
|
5640
|
+
import { z as z22 } from "zod/v4";
|
|
5641
|
+
var codeInterpreterInputSchema = lazySchema20(
|
|
5642
|
+
() => zodSchema20(
|
|
5643
|
+
z22.object({
|
|
5644
|
+
code: z22.string().nullish(),
|
|
5645
|
+
containerId: z22.string()
|
|
5520
5646
|
})
|
|
5521
5647
|
)
|
|
5522
5648
|
);
|
|
5523
|
-
var codeInterpreterOutputSchema =
|
|
5524
|
-
() =>
|
|
5525
|
-
|
|
5526
|
-
outputs:
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5649
|
+
var codeInterpreterOutputSchema = lazySchema20(
|
|
5650
|
+
() => zodSchema20(
|
|
5651
|
+
z22.object({
|
|
5652
|
+
outputs: z22.array(
|
|
5653
|
+
z22.discriminatedUnion("type", [
|
|
5654
|
+
z22.object({ type: z22.literal("logs"), logs: z22.string() }),
|
|
5655
|
+
z22.object({ type: z22.literal("image"), url: z22.string() })
|
|
5530
5656
|
])
|
|
5531
5657
|
).nullish()
|
|
5532
5658
|
})
|
|
5533
5659
|
)
|
|
5534
5660
|
);
|
|
5535
|
-
var codeInterpreterArgsSchema =
|
|
5536
|
-
() =>
|
|
5537
|
-
|
|
5538
|
-
container:
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
fileIds:
|
|
5661
|
+
var codeInterpreterArgsSchema = lazySchema20(
|
|
5662
|
+
() => zodSchema20(
|
|
5663
|
+
z22.object({
|
|
5664
|
+
container: z22.union([
|
|
5665
|
+
z22.string(),
|
|
5666
|
+
z22.object({
|
|
5667
|
+
fileIds: z22.array(z22.string()).optional()
|
|
5542
5668
|
})
|
|
5543
5669
|
]).optional()
|
|
5544
5670
|
})
|
|
5545
5671
|
)
|
|
5546
5672
|
);
|
|
5547
|
-
var codeInterpreterToolFactory =
|
|
5673
|
+
var codeInterpreterToolFactory = createProviderExecutedToolFactory2({
|
|
5548
5674
|
id: "openai.code_interpreter",
|
|
5549
5675
|
inputSchema: codeInterpreterInputSchema,
|
|
5550
5676
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -5555,88 +5681,88 @@ var codeInterpreter = (args = {}) => {
|
|
|
5555
5681
|
|
|
5556
5682
|
// src/tool/file-search.ts
|
|
5557
5683
|
import {
|
|
5558
|
-
createProviderExecutedToolFactory as
|
|
5559
|
-
lazySchema as
|
|
5560
|
-
zodSchema as
|
|
5684
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
|
|
5685
|
+
lazySchema as lazySchema21,
|
|
5686
|
+
zodSchema as zodSchema21
|
|
5561
5687
|
} from "@ai-sdk/provider-utils";
|
|
5562
|
-
import { z as
|
|
5563
|
-
var comparisonFilterSchema =
|
|
5564
|
-
key:
|
|
5565
|
-
type:
|
|
5566
|
-
value:
|
|
5688
|
+
import { z as z23 } from "zod/v4";
|
|
5689
|
+
var comparisonFilterSchema = z23.object({
|
|
5690
|
+
key: z23.string(),
|
|
5691
|
+
type: z23.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
5692
|
+
value: z23.union([z23.string(), z23.number(), z23.boolean(), z23.array(z23.string())])
|
|
5567
5693
|
});
|
|
5568
|
-
var compoundFilterSchema =
|
|
5569
|
-
type:
|
|
5570
|
-
filters:
|
|
5571
|
-
|
|
5694
|
+
var compoundFilterSchema = z23.object({
|
|
5695
|
+
type: z23.enum(["and", "or"]),
|
|
5696
|
+
filters: z23.array(
|
|
5697
|
+
z23.union([comparisonFilterSchema, z23.lazy(() => compoundFilterSchema)])
|
|
5572
5698
|
)
|
|
5573
5699
|
});
|
|
5574
|
-
var fileSearchArgsSchema =
|
|
5575
|
-
() =>
|
|
5576
|
-
|
|
5577
|
-
vectorStoreIds:
|
|
5578
|
-
maxNumResults:
|
|
5579
|
-
ranking:
|
|
5580
|
-
ranker:
|
|
5581
|
-
scoreThreshold:
|
|
5700
|
+
var fileSearchArgsSchema = lazySchema21(
|
|
5701
|
+
() => zodSchema21(
|
|
5702
|
+
z23.object({
|
|
5703
|
+
vectorStoreIds: z23.array(z23.string()),
|
|
5704
|
+
maxNumResults: z23.number().optional(),
|
|
5705
|
+
ranking: z23.object({
|
|
5706
|
+
ranker: z23.string().optional(),
|
|
5707
|
+
scoreThreshold: z23.number().optional()
|
|
5582
5708
|
}).optional(),
|
|
5583
|
-
filters:
|
|
5709
|
+
filters: z23.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
5584
5710
|
})
|
|
5585
5711
|
)
|
|
5586
5712
|
);
|
|
5587
|
-
var fileSearchOutputSchema =
|
|
5588
|
-
() =>
|
|
5589
|
-
|
|
5590
|
-
queries:
|
|
5591
|
-
results:
|
|
5592
|
-
|
|
5593
|
-
attributes:
|
|
5594
|
-
fileId:
|
|
5595
|
-
filename:
|
|
5596
|
-
score:
|
|
5597
|
-
text:
|
|
5713
|
+
var fileSearchOutputSchema = lazySchema21(
|
|
5714
|
+
() => zodSchema21(
|
|
5715
|
+
z23.object({
|
|
5716
|
+
queries: z23.array(z23.string()),
|
|
5717
|
+
results: z23.array(
|
|
5718
|
+
z23.object({
|
|
5719
|
+
attributes: z23.record(z23.string(), z23.unknown()),
|
|
5720
|
+
fileId: z23.string(),
|
|
5721
|
+
filename: z23.string(),
|
|
5722
|
+
score: z23.number(),
|
|
5723
|
+
text: z23.string()
|
|
5598
5724
|
})
|
|
5599
5725
|
).nullable()
|
|
5600
5726
|
})
|
|
5601
5727
|
)
|
|
5602
5728
|
);
|
|
5603
|
-
var fileSearch =
|
|
5729
|
+
var fileSearch = createProviderExecutedToolFactory3({
|
|
5604
5730
|
id: "openai.file_search",
|
|
5605
|
-
inputSchema:
|
|
5731
|
+
inputSchema: z23.object({}),
|
|
5606
5732
|
outputSchema: fileSearchOutputSchema
|
|
5607
5733
|
});
|
|
5608
5734
|
|
|
5609
5735
|
// src/tool/image-generation.ts
|
|
5610
5736
|
import {
|
|
5611
|
-
createProviderExecutedToolFactory as
|
|
5612
|
-
lazySchema as
|
|
5613
|
-
zodSchema as
|
|
5737
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
|
|
5738
|
+
lazySchema as lazySchema22,
|
|
5739
|
+
zodSchema as zodSchema22
|
|
5614
5740
|
} from "@ai-sdk/provider-utils";
|
|
5615
|
-
import { z as
|
|
5616
|
-
var imageGenerationArgsSchema =
|
|
5617
|
-
() =>
|
|
5618
|
-
|
|
5619
|
-
background:
|
|
5620
|
-
inputFidelity:
|
|
5621
|
-
inputImageMask:
|
|
5622
|
-
fileId:
|
|
5623
|
-
imageUrl:
|
|
5741
|
+
import { z as z24 } from "zod/v4";
|
|
5742
|
+
var imageGenerationArgsSchema = lazySchema22(
|
|
5743
|
+
() => zodSchema22(
|
|
5744
|
+
z24.object({
|
|
5745
|
+
background: z24.enum(["auto", "opaque", "transparent"]).optional(),
|
|
5746
|
+
inputFidelity: z24.enum(["low", "high"]).optional(),
|
|
5747
|
+
inputImageMask: z24.object({
|
|
5748
|
+
fileId: z24.string().optional(),
|
|
5749
|
+
imageUrl: z24.string().optional()
|
|
5624
5750
|
}).optional(),
|
|
5625
|
-
model:
|
|
5626
|
-
moderation:
|
|
5627
|
-
outputCompression:
|
|
5628
|
-
outputFormat:
|
|
5629
|
-
partialImages:
|
|
5630
|
-
quality:
|
|
5631
|
-
size:
|
|
5751
|
+
model: z24.string().optional(),
|
|
5752
|
+
moderation: z24.enum(["auto"]).optional(),
|
|
5753
|
+
outputCompression: z24.number().int().min(0).max(100).optional(),
|
|
5754
|
+
outputFormat: z24.enum(["png", "jpeg", "webp"]).optional(),
|
|
5755
|
+
partialImages: z24.number().int().min(0).max(3).optional(),
|
|
5756
|
+
quality: z24.enum(["auto", "low", "medium", "high"]).optional(),
|
|
5757
|
+
size: z24.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
5632
5758
|
}).strict()
|
|
5633
5759
|
)
|
|
5634
5760
|
);
|
|
5635
|
-
var imageGenerationInputSchema =
|
|
5636
|
-
var imageGenerationOutputSchema =
|
|
5637
|
-
() =>
|
|
5761
|
+
var imageGenerationInputSchema = lazySchema22(() => zodSchema22(z24.object({})));
|
|
5762
|
+
var imageGenerationOutputSchema = lazySchema22(
|
|
5763
|
+
() => zodSchema22(z24.object({ result: z24.string() }))
|
|
5638
5764
|
);
|
|
5639
|
-
var imageGenerationToolFactory =
|
|
5765
|
+
var imageGenerationToolFactory = createProviderExecutedToolFactory4({
|
|
5640
5766
|
id: "openai.image_generation",
|
|
5641
5767
|
inputSchema: imageGenerationInputSchema,
|
|
5642
5768
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -5648,28 +5774,28 @@ var imageGeneration = (args = {}) => {
|
|
|
5648
5774
|
// src/tool/custom.ts
|
|
5649
5775
|
import {
|
|
5650
5776
|
createProviderDefinedToolFactory,
|
|
5651
|
-
lazySchema as
|
|
5652
|
-
zodSchema as
|
|
5777
|
+
lazySchema as lazySchema23,
|
|
5778
|
+
zodSchema as zodSchema23
|
|
5653
5779
|
} from "@ai-sdk/provider-utils";
|
|
5654
|
-
import { z as
|
|
5655
|
-
var customArgsSchema =
|
|
5656
|
-
() =>
|
|
5657
|
-
|
|
5658
|
-
description:
|
|
5659
|
-
format:
|
|
5660
|
-
|
|
5661
|
-
type:
|
|
5662
|
-
syntax:
|
|
5663
|
-
definition:
|
|
5780
|
+
import { z as z25 } from "zod/v4";
|
|
5781
|
+
var customArgsSchema = lazySchema23(
|
|
5782
|
+
() => zodSchema23(
|
|
5783
|
+
z25.object({
|
|
5784
|
+
description: z25.string().optional(),
|
|
5785
|
+
format: z25.union([
|
|
5786
|
+
z25.object({
|
|
5787
|
+
type: z25.literal("grammar"),
|
|
5788
|
+
syntax: z25.enum(["regex", "lark"]),
|
|
5789
|
+
definition: z25.string()
|
|
5664
5790
|
}),
|
|
5665
|
-
|
|
5666
|
-
type:
|
|
5791
|
+
z25.object({
|
|
5792
|
+
type: z25.literal("text")
|
|
5667
5793
|
})
|
|
5668
5794
|
]).optional()
|
|
5669
5795
|
})
|
|
5670
5796
|
)
|
|
5671
5797
|
);
|
|
5672
|
-
var customInputSchema =
|
|
5798
|
+
var customInputSchema = lazySchema23(() => zodSchema23(z25.string()));
|
|
5673
5799
|
var customToolFactory = createProviderDefinedToolFactory({
|
|
5674
5800
|
id: "openai.custom",
|
|
5675
5801
|
inputSchema: customInputSchema
|
|
@@ -5677,139 +5803,82 @@ var customToolFactory = createProviderDefinedToolFactory({
|
|
|
5677
5803
|
|
|
5678
5804
|
// src/tool/mcp.ts
|
|
5679
5805
|
import {
|
|
5680
|
-
createProviderExecutedToolFactory as
|
|
5681
|
-
lazySchema as
|
|
5682
|
-
zodSchema as
|
|
5806
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
|
|
5807
|
+
lazySchema as lazySchema24,
|
|
5808
|
+
zodSchema as zodSchema24
|
|
5683
5809
|
} from "@ai-sdk/provider-utils";
|
|
5684
|
-
import { z as
|
|
5685
|
-
var jsonValueSchema2 =
|
|
5686
|
-
() =>
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5810
|
+
import { z as z26 } from "zod/v4";
|
|
5811
|
+
var jsonValueSchema2 = z26.lazy(
|
|
5812
|
+
() => z26.union([
|
|
5813
|
+
z26.string(),
|
|
5814
|
+
z26.number(),
|
|
5815
|
+
z26.boolean(),
|
|
5816
|
+
z26.null(),
|
|
5817
|
+
z26.array(jsonValueSchema2),
|
|
5818
|
+
z26.record(z26.string(), jsonValueSchema2)
|
|
5693
5819
|
])
|
|
5694
5820
|
);
|
|
5695
|
-
var mcpArgsSchema =
|
|
5696
|
-
() =>
|
|
5697
|
-
|
|
5698
|
-
serverLabel:
|
|
5699
|
-
allowedTools:
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
readOnly:
|
|
5703
|
-
toolNames:
|
|
5821
|
+
var mcpArgsSchema = lazySchema24(
|
|
5822
|
+
() => zodSchema24(
|
|
5823
|
+
z26.object({
|
|
5824
|
+
serverLabel: z26.string(),
|
|
5825
|
+
allowedTools: z26.union([
|
|
5826
|
+
z26.array(z26.string()),
|
|
5827
|
+
z26.object({
|
|
5828
|
+
readOnly: z26.boolean().optional(),
|
|
5829
|
+
toolNames: z26.array(z26.string()).optional()
|
|
5704
5830
|
})
|
|
5705
5831
|
]).optional(),
|
|
5706
|
-
authorization:
|
|
5707
|
-
connectorId:
|
|
5708
|
-
headers:
|
|
5709
|
-
requireApproval:
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
never:
|
|
5713
|
-
toolNames:
|
|
5832
|
+
authorization: z26.string().optional(),
|
|
5833
|
+
connectorId: z26.string().optional(),
|
|
5834
|
+
headers: z26.record(z26.string(), z26.string()).optional(),
|
|
5835
|
+
requireApproval: z26.union([
|
|
5836
|
+
z26.enum(["always", "never"]),
|
|
5837
|
+
z26.object({
|
|
5838
|
+
never: z26.object({
|
|
5839
|
+
toolNames: z26.array(z26.string()).optional()
|
|
5714
5840
|
}).optional()
|
|
5715
5841
|
})
|
|
5716
5842
|
]).optional(),
|
|
5717
|
-
serverDescription:
|
|
5718
|
-
serverUrl:
|
|
5843
|
+
serverDescription: z26.string().optional(),
|
|
5844
|
+
serverUrl: z26.string().optional()
|
|
5719
5845
|
}).refine(
|
|
5720
5846
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
5721
5847
|
"One of serverUrl or connectorId must be provided."
|
|
5722
5848
|
)
|
|
5723
5849
|
)
|
|
5724
5850
|
);
|
|
5725
|
-
var mcpInputSchema =
|
|
5726
|
-
var mcpOutputSchema =
|
|
5727
|
-
() =>
|
|
5728
|
-
|
|
5729
|
-
type:
|
|
5730
|
-
serverLabel:
|
|
5731
|
-
name:
|
|
5732
|
-
arguments:
|
|
5733
|
-
output:
|
|
5734
|
-
error:
|
|
5851
|
+
var mcpInputSchema = lazySchema24(() => zodSchema24(z26.object({})));
|
|
5852
|
+
var mcpOutputSchema = lazySchema24(
|
|
5853
|
+
() => zodSchema24(
|
|
5854
|
+
z26.object({
|
|
5855
|
+
type: z26.literal("call"),
|
|
5856
|
+
serverLabel: z26.string(),
|
|
5857
|
+
name: z26.string(),
|
|
5858
|
+
arguments: z26.string(),
|
|
5859
|
+
output: z26.string().nullish(),
|
|
5860
|
+
error: z26.union([z26.string(), jsonValueSchema2]).optional()
|
|
5735
5861
|
})
|
|
5736
5862
|
)
|
|
5737
5863
|
);
|
|
5738
|
-
var mcpToolFactory =
|
|
5864
|
+
var mcpToolFactory = createProviderExecutedToolFactory5({
|
|
5739
5865
|
id: "openai.mcp",
|
|
5740
5866
|
inputSchema: mcpInputSchema,
|
|
5741
5867
|
outputSchema: mcpOutputSchema
|
|
5742
5868
|
});
|
|
5743
5869
|
|
|
5744
5870
|
// src/tool/web-search.ts
|
|
5745
|
-
import {
|
|
5746
|
-
createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
|
|
5747
|
-
lazySchema as lazySchema24,
|
|
5748
|
-
zodSchema as zodSchema24
|
|
5749
|
-
} from "@ai-sdk/provider-utils";
|
|
5750
|
-
import { z as z26 } from "zod/v4";
|
|
5751
|
-
var webSearchArgsSchema = lazySchema24(
|
|
5752
|
-
() => zodSchema24(
|
|
5753
|
-
z26.object({
|
|
5754
|
-
externalWebAccess: z26.boolean().optional(),
|
|
5755
|
-
filters: z26.object({ allowedDomains: z26.array(z26.string()).optional() }).optional(),
|
|
5756
|
-
searchContextSize: z26.enum(["low", "medium", "high"]).optional(),
|
|
5757
|
-
userLocation: z26.object({
|
|
5758
|
-
type: z26.literal("approximate"),
|
|
5759
|
-
country: z26.string().optional(),
|
|
5760
|
-
city: z26.string().optional(),
|
|
5761
|
-
region: z26.string().optional(),
|
|
5762
|
-
timezone: z26.string().optional()
|
|
5763
|
-
}).optional()
|
|
5764
|
-
})
|
|
5765
|
-
)
|
|
5766
|
-
);
|
|
5767
|
-
var webSearchInputSchema = lazySchema24(() => zodSchema24(z26.object({})));
|
|
5768
|
-
var webSearchOutputSchema = lazySchema24(
|
|
5769
|
-
() => zodSchema24(
|
|
5770
|
-
z26.object({
|
|
5771
|
-
action: z26.discriminatedUnion("type", [
|
|
5772
|
-
z26.object({
|
|
5773
|
-
type: z26.literal("search"),
|
|
5774
|
-
query: z26.string().optional(),
|
|
5775
|
-
queries: z26.array(z26.string()).optional()
|
|
5776
|
-
}),
|
|
5777
|
-
z26.object({
|
|
5778
|
-
type: z26.literal("openPage"),
|
|
5779
|
-
url: z26.string().nullish()
|
|
5780
|
-
}),
|
|
5781
|
-
z26.object({
|
|
5782
|
-
type: z26.literal("findInPage"),
|
|
5783
|
-
url: z26.string().nullish(),
|
|
5784
|
-
pattern: z26.string().nullish()
|
|
5785
|
-
})
|
|
5786
|
-
]).optional(),
|
|
5787
|
-
sources: z26.array(
|
|
5788
|
-
z26.discriminatedUnion("type", [
|
|
5789
|
-
z26.object({ type: z26.literal("url"), url: z26.string() }),
|
|
5790
|
-
z26.object({ type: z26.literal("api"), name: z26.string() })
|
|
5791
|
-
])
|
|
5792
|
-
).optional()
|
|
5793
|
-
})
|
|
5794
|
-
)
|
|
5795
|
-
);
|
|
5796
|
-
var webSearchToolFactory = createProviderExecutedToolFactory5({
|
|
5797
|
-
id: "openai.web_search",
|
|
5798
|
-
inputSchema: webSearchInputSchema,
|
|
5799
|
-
outputSchema: webSearchOutputSchema
|
|
5800
|
-
});
|
|
5801
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
5802
|
-
|
|
5803
|
-
// src/tool/web-search-preview.ts
|
|
5804
5871
|
import {
|
|
5805
5872
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
|
|
5806
5873
|
lazySchema as lazySchema25,
|
|
5807
5874
|
zodSchema as zodSchema25
|
|
5808
5875
|
} from "@ai-sdk/provider-utils";
|
|
5809
5876
|
import { z as z27 } from "zod/v4";
|
|
5810
|
-
var
|
|
5877
|
+
var webSearchArgsSchema = lazySchema25(
|
|
5811
5878
|
() => zodSchema25(
|
|
5812
5879
|
z27.object({
|
|
5880
|
+
externalWebAccess: z27.boolean().optional(),
|
|
5881
|
+
filters: z27.object({ allowedDomains: z27.array(z27.string()).optional() }).optional(),
|
|
5813
5882
|
searchContextSize: z27.enum(["low", "medium", "high"]).optional(),
|
|
5814
5883
|
userLocation: z27.object({
|
|
5815
5884
|
type: z27.literal("approximate"),
|
|
@@ -5821,16 +5890,15 @@ var webSearchPreviewArgsSchema = lazySchema25(
|
|
|
5821
5890
|
})
|
|
5822
5891
|
)
|
|
5823
5892
|
);
|
|
5824
|
-
var
|
|
5825
|
-
|
|
5826
|
-
);
|
|
5827
|
-
var webSearchPreviewOutputSchema = lazySchema25(
|
|
5893
|
+
var webSearchInputSchema = lazySchema25(() => zodSchema25(z27.object({})));
|
|
5894
|
+
var webSearchOutputSchema = lazySchema25(
|
|
5828
5895
|
() => zodSchema25(
|
|
5829
5896
|
z27.object({
|
|
5830
5897
|
action: z27.discriminatedUnion("type", [
|
|
5831
5898
|
z27.object({
|
|
5832
5899
|
type: z27.literal("search"),
|
|
5833
|
-
query: z27.string().optional()
|
|
5900
|
+
query: z27.string().optional(),
|
|
5901
|
+
queries: z27.array(z27.string()).optional()
|
|
5834
5902
|
}),
|
|
5835
5903
|
z27.object({
|
|
5836
5904
|
type: z27.literal("openPage"),
|
|
@@ -5841,11 +5909,69 @@ var webSearchPreviewOutputSchema = lazySchema25(
|
|
|
5841
5909
|
url: z27.string().nullish(),
|
|
5842
5910
|
pattern: z27.string().nullish()
|
|
5843
5911
|
})
|
|
5912
|
+
]).optional(),
|
|
5913
|
+
sources: z27.array(
|
|
5914
|
+
z27.discriminatedUnion("type", [
|
|
5915
|
+
z27.object({ type: z27.literal("url"), url: z27.string() }),
|
|
5916
|
+
z27.object({ type: z27.literal("api"), name: z27.string() })
|
|
5917
|
+
])
|
|
5918
|
+
).optional()
|
|
5919
|
+
})
|
|
5920
|
+
)
|
|
5921
|
+
);
|
|
5922
|
+
var webSearchToolFactory = createProviderExecutedToolFactory6({
|
|
5923
|
+
id: "openai.web_search",
|
|
5924
|
+
inputSchema: webSearchInputSchema,
|
|
5925
|
+
outputSchema: webSearchOutputSchema
|
|
5926
|
+
});
|
|
5927
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
5928
|
+
|
|
5929
|
+
// src/tool/web-search-preview.ts
|
|
5930
|
+
import {
|
|
5931
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory7,
|
|
5932
|
+
lazySchema as lazySchema26,
|
|
5933
|
+
zodSchema as zodSchema26
|
|
5934
|
+
} from "@ai-sdk/provider-utils";
|
|
5935
|
+
import { z as z28 } from "zod/v4";
|
|
5936
|
+
var webSearchPreviewArgsSchema = lazySchema26(
|
|
5937
|
+
() => zodSchema26(
|
|
5938
|
+
z28.object({
|
|
5939
|
+
searchContextSize: z28.enum(["low", "medium", "high"]).optional(),
|
|
5940
|
+
userLocation: z28.object({
|
|
5941
|
+
type: z28.literal("approximate"),
|
|
5942
|
+
country: z28.string().optional(),
|
|
5943
|
+
city: z28.string().optional(),
|
|
5944
|
+
region: z28.string().optional(),
|
|
5945
|
+
timezone: z28.string().optional()
|
|
5946
|
+
}).optional()
|
|
5947
|
+
})
|
|
5948
|
+
)
|
|
5949
|
+
);
|
|
5950
|
+
var webSearchPreviewInputSchema = lazySchema26(
|
|
5951
|
+
() => zodSchema26(z28.object({}))
|
|
5952
|
+
);
|
|
5953
|
+
var webSearchPreviewOutputSchema = lazySchema26(
|
|
5954
|
+
() => zodSchema26(
|
|
5955
|
+
z28.object({
|
|
5956
|
+
action: z28.discriminatedUnion("type", [
|
|
5957
|
+
z28.object({
|
|
5958
|
+
type: z28.literal("search"),
|
|
5959
|
+
query: z28.string().optional()
|
|
5960
|
+
}),
|
|
5961
|
+
z28.object({
|
|
5962
|
+
type: z28.literal("openPage"),
|
|
5963
|
+
url: z28.string().nullish()
|
|
5964
|
+
}),
|
|
5965
|
+
z28.object({
|
|
5966
|
+
type: z28.literal("findInPage"),
|
|
5967
|
+
url: z28.string().nullish(),
|
|
5968
|
+
pattern: z28.string().nullish()
|
|
5969
|
+
})
|
|
5844
5970
|
]).optional()
|
|
5845
5971
|
})
|
|
5846
5972
|
)
|
|
5847
5973
|
);
|
|
5848
|
-
var webSearchPreview =
|
|
5974
|
+
var webSearchPreview = createProviderExecutedToolFactory7({
|
|
5849
5975
|
id: "openai.web_search_preview",
|
|
5850
5976
|
inputSchema: webSearchPreviewInputSchema,
|
|
5851
5977
|
outputSchema: webSearchPreviewOutputSchema
|
|
@@ -6049,6 +6175,12 @@ async function prepareResponsesTools({
|
|
|
6049
6175
|
resolvedCustomProviderToolNames.add(tool.name);
|
|
6050
6176
|
break;
|
|
6051
6177
|
}
|
|
6178
|
+
case "openai.programmatic_tool_calling": {
|
|
6179
|
+
openaiTools.push({
|
|
6180
|
+
type: "programmatic_tool_calling"
|
|
6181
|
+
});
|
|
6182
|
+
break;
|
|
6183
|
+
}
|
|
6052
6184
|
case "openai.tool_search": {
|
|
6053
6185
|
const args = await validateTypes2({
|
|
6054
6186
|
value: tool.args,
|
|
@@ -6103,7 +6235,7 @@ async function prepareResponsesTools({
|
|
|
6103
6235
|
const resolvedToolName = (_c = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _c : toolChoice.toolName;
|
|
6104
6236
|
return {
|
|
6105
6237
|
tools: openaiTools,
|
|
6106
|
-
toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" || resolvedToolName === "computer" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
|
|
6238
|
+
toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" || resolvedToolName === "computer" || resolvedToolName === "programmatic_tool_calling" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
|
|
6107
6239
|
toolWarnings
|
|
6108
6240
|
};
|
|
6109
6241
|
}
|
|
@@ -6126,7 +6258,9 @@ function prepareFunctionTool({
|
|
|
6126
6258
|
description: tool.description,
|
|
6127
6259
|
parameters: tool.inputSchema,
|
|
6128
6260
|
...tool.strict != null ? { strict: tool.strict } : {},
|
|
6129
|
-
...deferLoading != null ? { defer_loading: deferLoading } : {}
|
|
6261
|
+
...deferLoading != null ? { defer_loading: deferLoading } : {},
|
|
6262
|
+
...(options == null ? void 0 : options.allowedCallers) != null ? { allowed_callers: options.allowedCallers } : {},
|
|
6263
|
+
...(options == null ? void 0 : options.outputSchema) != null ? { output_schema: options.outputSchema } : {}
|
|
6130
6264
|
};
|
|
6131
6265
|
}
|
|
6132
6266
|
function mapShellEnvironment(environment) {
|
|
@@ -6358,7 +6492,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6358
6492
|
"openai.web_search_preview": "web_search_preview",
|
|
6359
6493
|
"openai.mcp": "mcp",
|
|
6360
6494
|
"openai.apply_patch": "apply_patch",
|
|
6361
|
-
"openai.tool_search": "tool_search"
|
|
6495
|
+
"openai.tool_search": "tool_search",
|
|
6496
|
+
"openai.programmatic_tool_calling": "programmatic_tool_calling"
|
|
6362
6497
|
}
|
|
6363
6498
|
});
|
|
6364
6499
|
const customProviderToolNames = /* @__PURE__ */ new Set();
|
|
@@ -6845,7 +6980,52 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6845
6980
|
providerMetadata: {
|
|
6846
6981
|
[providerOptionsName]: {
|
|
6847
6982
|
itemId: part.id,
|
|
6848
|
-
...part.namespace != null && { namespace: part.namespace }
|
|
6983
|
+
...part.namespace != null && { namespace: part.namespace },
|
|
6984
|
+
...part.caller != null && {
|
|
6985
|
+
caller: part.caller.type === "program" ? {
|
|
6986
|
+
type: "program",
|
|
6987
|
+
callerId: part.caller.caller_id
|
|
6988
|
+
} : part.caller
|
|
6989
|
+
}
|
|
6990
|
+
}
|
|
6991
|
+
}
|
|
6992
|
+
});
|
|
6993
|
+
break;
|
|
6994
|
+
}
|
|
6995
|
+
case "program": {
|
|
6996
|
+
content.push({
|
|
6997
|
+
type: "tool-call",
|
|
6998
|
+
toolCallId: part.call_id,
|
|
6999
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
7000
|
+
"programmatic_tool_calling"
|
|
7001
|
+
),
|
|
7002
|
+
input: JSON.stringify({
|
|
7003
|
+
code: part.code,
|
|
7004
|
+
fingerprint: part.fingerprint
|
|
7005
|
+
}),
|
|
7006
|
+
providerExecuted: true,
|
|
7007
|
+
providerMetadata: {
|
|
7008
|
+
[providerOptionsName]: {
|
|
7009
|
+
itemId: part.id
|
|
7010
|
+
}
|
|
7011
|
+
}
|
|
7012
|
+
});
|
|
7013
|
+
break;
|
|
7014
|
+
}
|
|
7015
|
+
case "program_output": {
|
|
7016
|
+
content.push({
|
|
7017
|
+
type: "tool-result",
|
|
7018
|
+
toolCallId: part.call_id,
|
|
7019
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
7020
|
+
"programmatic_tool_calling"
|
|
7021
|
+
),
|
|
7022
|
+
result: {
|
|
7023
|
+
result: part.result,
|
|
7024
|
+
status: part.status
|
|
7025
|
+
},
|
|
7026
|
+
providerMetadata: {
|
|
7027
|
+
[providerOptionsName]: {
|
|
7028
|
+
itemId: part.id
|
|
6849
7029
|
}
|
|
6850
7030
|
}
|
|
6851
7031
|
});
|
|
@@ -7397,10 +7577,51 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7397
7577
|
itemId: value.item.id,
|
|
7398
7578
|
...value.item.namespace != null && {
|
|
7399
7579
|
namespace: value.item.namespace
|
|
7580
|
+
},
|
|
7581
|
+
...value.item.caller != null && {
|
|
7582
|
+
caller: value.item.caller.type === "program" ? {
|
|
7583
|
+
type: "program",
|
|
7584
|
+
callerId: value.item.caller.caller_id
|
|
7585
|
+
} : value.item.caller
|
|
7400
7586
|
}
|
|
7401
7587
|
}
|
|
7402
7588
|
}
|
|
7403
7589
|
});
|
|
7590
|
+
} else if (value.item.type === "program") {
|
|
7591
|
+
controller.enqueue({
|
|
7592
|
+
type: "tool-call",
|
|
7593
|
+
toolCallId: value.item.call_id,
|
|
7594
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
7595
|
+
"programmatic_tool_calling"
|
|
7596
|
+
),
|
|
7597
|
+
input: JSON.stringify({
|
|
7598
|
+
code: value.item.code,
|
|
7599
|
+
fingerprint: value.item.fingerprint
|
|
7600
|
+
}),
|
|
7601
|
+
providerExecuted: true,
|
|
7602
|
+
providerMetadata: {
|
|
7603
|
+
[providerOptionsName]: {
|
|
7604
|
+
itemId: value.item.id
|
|
7605
|
+
}
|
|
7606
|
+
}
|
|
7607
|
+
});
|
|
7608
|
+
} else if (value.item.type === "program_output") {
|
|
7609
|
+
controller.enqueue({
|
|
7610
|
+
type: "tool-result",
|
|
7611
|
+
toolCallId: value.item.call_id,
|
|
7612
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
7613
|
+
"programmatic_tool_calling"
|
|
7614
|
+
),
|
|
7615
|
+
result: {
|
|
7616
|
+
result: value.item.result,
|
|
7617
|
+
status: value.item.status
|
|
7618
|
+
},
|
|
7619
|
+
providerMetadata: {
|
|
7620
|
+
[providerOptionsName]: {
|
|
7621
|
+
itemId: value.item.id
|
|
7622
|
+
}
|
|
7623
|
+
}
|
|
7624
|
+
});
|
|
7404
7625
|
} else if (value.item.type === "custom_tool_call") {
|
|
7405
7626
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7406
7627
|
hasFunctionCall = true;
|
|
@@ -8173,6 +8394,7 @@ export {
|
|
|
8173
8394
|
fileSearch,
|
|
8174
8395
|
fileSearchArgsSchema,
|
|
8175
8396
|
fileSearchOutputSchema,
|
|
8397
|
+
getMaxImagesPerCall,
|
|
8176
8398
|
hasDefaultResponseFormat,
|
|
8177
8399
|
imageGeneration,
|
|
8178
8400
|
imageGenerationArgsSchema,
|
|
@@ -8186,6 +8408,9 @@ export {
|
|
|
8186
8408
|
openaiLanguageModelChatOptions,
|
|
8187
8409
|
openaiLanguageModelCompletionOptions,
|
|
8188
8410
|
openaiSpeechModelOptionsSchema,
|
|
8411
|
+
programmaticToolCalling,
|
|
8412
|
+
programmaticToolCallingInputSchema,
|
|
8413
|
+
programmaticToolCallingOutputSchema,
|
|
8189
8414
|
webSearch,
|
|
8190
8415
|
webSearchArgsSchema,
|
|
8191
8416
|
webSearchOutputSchema,
|