@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/index.js
CHANGED
|
@@ -43,10 +43,15 @@ var openaiFailedResponseHandler = createJsonErrorResponseHandler({
|
|
|
43
43
|
|
|
44
44
|
// src/openai-language-model-capabilities.ts
|
|
45
45
|
function getOpenAILanguageModelCapabilities(modelId) {
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
46
|
+
var _a, _b, _c, _d, _e;
|
|
47
|
+
const oSeriesVersion = getOSeriesVersion(modelId);
|
|
48
|
+
const gptVersion = getGptVersion(modelId);
|
|
49
|
+
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);
|
|
50
|
+
const isGptNanoModel = (_d = (_c = gptVersion == null ? void 0 : gptVersion.variant) == null ? void 0 : _c.startsWith("nano")) != null ? _d : false;
|
|
51
|
+
const supportsFlexProcessing = oSeriesVersion != null && oSeriesVersion >= 3 || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;
|
|
52
|
+
const supportsPriorityProcessing = modelId.startsWith("gpt-4") || gptVersion != null && gptVersion.major >= 5 && !isGptNanoModel && !isGptChatModel || oSeriesVersion != null && oSeriesVersion >= 3;
|
|
53
|
+
const isReasoningModel = oSeriesVersion != null || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;
|
|
54
|
+
const supportsNonReasoningParameters = gptVersion != null && (gptVersion.major > 5 || gptVersion.major === 5 && ((_e = gptVersion.minor) != null ? _e : 0) >= 1);
|
|
50
55
|
const systemMessageMode = isReasoningModel ? "developer" : "system";
|
|
51
56
|
return {
|
|
52
57
|
supportsFlexProcessing,
|
|
@@ -56,6 +61,21 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
56
61
|
supportsNonReasoningParameters
|
|
57
62
|
};
|
|
58
63
|
}
|
|
64
|
+
function getOSeriesVersion(modelId) {
|
|
65
|
+
const match = /^o(\d+)(?:-|$)/.exec(modelId);
|
|
66
|
+
return match == null ? void 0 : Number(match[1]);
|
|
67
|
+
}
|
|
68
|
+
function getGptVersion(modelId) {
|
|
69
|
+
const match = /^gpt-(\d+)(?:\.(\d+))?(?:-(.+))?$/.exec(modelId);
|
|
70
|
+
if (match == null) {
|
|
71
|
+
return void 0;
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
major: Number(match[1]),
|
|
75
|
+
minor: match[2] == null ? void 0 : Number(match[2]),
|
|
76
|
+
variant: match[3]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
59
79
|
|
|
60
80
|
// src/openai-stream-error.ts
|
|
61
81
|
import { APICallError } from "@ai-sdk/provider";
|
|
@@ -2136,18 +2156,16 @@ var modelMaxImagesPerCall = {
|
|
|
2136
2156
|
"gpt-image-2": 10,
|
|
2137
2157
|
"chatgpt-image-latest": 10
|
|
2138
2158
|
};
|
|
2139
|
-
var defaultResponseFormatPrefixes = [
|
|
2140
|
-
"chatgpt-image-",
|
|
2141
|
-
"gpt-image-1-mini",
|
|
2142
|
-
"gpt-image-1.5",
|
|
2143
|
-
"gpt-image-1",
|
|
2144
|
-
"gpt-image-2"
|
|
2145
|
-
];
|
|
2159
|
+
var defaultResponseFormatPrefixes = ["chatgpt-image-", "gpt-image-"];
|
|
2146
2160
|
function hasDefaultResponseFormat(modelId) {
|
|
2147
2161
|
return defaultResponseFormatPrefixes.some(
|
|
2148
2162
|
(prefix) => modelId.startsWith(prefix)
|
|
2149
2163
|
);
|
|
2150
2164
|
}
|
|
2165
|
+
function getMaxImagesPerCall(modelId) {
|
|
2166
|
+
var _a;
|
|
2167
|
+
return (_a = modelMaxImagesPerCall[modelId]) != null ? _a : modelId.startsWith("gpt-image-") ? 10 : 1;
|
|
2168
|
+
}
|
|
2151
2169
|
var baseImageModelOptionsObject = z11.object({
|
|
2152
2170
|
/**
|
|
2153
2171
|
* Quality of the generated image(s).
|
|
@@ -2225,8 +2243,7 @@ var OpenAIImageModel = class _OpenAIImageModel {
|
|
|
2225
2243
|
return new _OpenAIImageModel(options.modelId, options.config);
|
|
2226
2244
|
}
|
|
2227
2245
|
get maxImagesPerCall() {
|
|
2228
|
-
|
|
2229
|
-
return (_a = modelMaxImagesPerCall[this.modelId]) != null ? _a : 1;
|
|
2246
|
+
return getMaxImagesPerCall(this.modelId);
|
|
2230
2247
|
}
|
|
2231
2248
|
get provider() {
|
|
2232
2249
|
return this.config.provider;
|
|
@@ -3091,6 +3108,37 @@ var mcpToolFactory = createProviderExecutedToolFactory6({
|
|
|
3091
3108
|
});
|
|
3092
3109
|
var mcp = (args) => mcpToolFactory(args);
|
|
3093
3110
|
|
|
3111
|
+
// src/tool/programmatic-tool-calling.ts
|
|
3112
|
+
import {
|
|
3113
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory7,
|
|
3114
|
+
lazySchema as lazySchema23,
|
|
3115
|
+
zodSchema as zodSchema23
|
|
3116
|
+
} from "@ai-sdk/provider-utils";
|
|
3117
|
+
import { z as z24 } from "zod/v4";
|
|
3118
|
+
var programmaticToolCallingInputSchema = lazySchema23(
|
|
3119
|
+
() => zodSchema23(
|
|
3120
|
+
z24.object({
|
|
3121
|
+
code: z24.string(),
|
|
3122
|
+
fingerprint: z24.string()
|
|
3123
|
+
})
|
|
3124
|
+
)
|
|
3125
|
+
);
|
|
3126
|
+
var programmaticToolCallingOutputSchema = lazySchema23(
|
|
3127
|
+
() => zodSchema23(
|
|
3128
|
+
z24.object({
|
|
3129
|
+
result: z24.string(),
|
|
3130
|
+
status: z24.enum(["completed", "incomplete"])
|
|
3131
|
+
})
|
|
3132
|
+
)
|
|
3133
|
+
);
|
|
3134
|
+
var programmaticToolCallingFactory = createProviderExecutedToolFactory7({
|
|
3135
|
+
id: "openai.programmatic_tool_calling",
|
|
3136
|
+
inputSchema: programmaticToolCallingInputSchema,
|
|
3137
|
+
outputSchema: programmaticToolCallingOutputSchema,
|
|
3138
|
+
supportsDeferredResults: true
|
|
3139
|
+
});
|
|
3140
|
+
var programmaticToolCalling = () => programmaticToolCallingFactory({});
|
|
3141
|
+
|
|
3094
3142
|
// src/openai-tools.ts
|
|
3095
3143
|
var openaiTools = {
|
|
3096
3144
|
/**
|
|
@@ -3205,6 +3253,11 @@ var openaiTools = {
|
|
|
3205
3253
|
* @param serverUrl - URL for the MCP server.
|
|
3206
3254
|
*/
|
|
3207
3255
|
mcp,
|
|
3256
|
+
/**
|
|
3257
|
+
* Programmatic Tool Calling lets OpenAI Responses models write and execute
|
|
3258
|
+
* JavaScript that orchestrates eligible tools.
|
|
3259
|
+
*/
|
|
3260
|
+
programmaticToolCalling,
|
|
3208
3261
|
/**
|
|
3209
3262
|
* Tool search allows the model to dynamically search for and load deferred
|
|
3210
3263
|
* tools into the model's context as needed. This helps reduce overall token
|
|
@@ -3678,10 +3731,13 @@ import {
|
|
|
3678
3731
|
resolveProviderReference as resolveProviderReference2,
|
|
3679
3732
|
validateTypes
|
|
3680
3733
|
} from "@ai-sdk/provider-utils";
|
|
3681
|
-
import { z as
|
|
3734
|
+
import { z as z25 } from "zod/v4";
|
|
3682
3735
|
function serializeToolCallArguments2(input) {
|
|
3683
3736
|
return JSON.stringify(input === void 0 ? {} : input);
|
|
3684
3737
|
}
|
|
3738
|
+
function mapToolCaller(caller) {
|
|
3739
|
+
return caller == null ? void 0 : caller.type === "program" ? { type: "program", caller_id: caller.callerId } : caller;
|
|
3740
|
+
}
|
|
3685
3741
|
function getPromptCacheBreakpoint2(providerOptions, providerOptionsName) {
|
|
3686
3742
|
var _a;
|
|
3687
3743
|
return (_a = providerOptions == null ? void 0 : providerOptions[providerOptionsName]) == null ? void 0 : _a.promptCacheBreakpoint;
|
|
@@ -3706,7 +3762,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3706
3762
|
hasComputerTool = false,
|
|
3707
3763
|
customProviderToolNames
|
|
3708
3764
|
}) {
|
|
3709
|
-
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;
|
|
3765
|
+
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;
|
|
3710
3766
|
let input = [];
|
|
3711
3767
|
const warnings = [];
|
|
3712
3768
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -3892,6 +3948,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3892
3948
|
case "tool-call": {
|
|
3893
3949
|
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;
|
|
3894
3950
|
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;
|
|
3951
|
+
const caller = (_m = (_l = part.providerOptions) == null ? void 0 : _l[providerOptionsName]) == null ? void 0 : _m.caller;
|
|
3895
3952
|
if (hasConversation && id != null) {
|
|
3896
3953
|
break;
|
|
3897
3954
|
}
|
|
@@ -3915,12 +3972,30 @@ async function convertToOpenAIResponsesInput({
|
|
|
3915
3972
|
type: "tool_search_call",
|
|
3916
3973
|
id: id != null ? id : part.toolCallId,
|
|
3917
3974
|
execution,
|
|
3918
|
-
call_id: (
|
|
3975
|
+
call_id: (_n = parsedInput.call_id) != null ? _n : null,
|
|
3919
3976
|
status: "completed",
|
|
3920
3977
|
arguments: parsedInput.arguments
|
|
3921
3978
|
});
|
|
3922
3979
|
break;
|
|
3923
3980
|
}
|
|
3981
|
+
if (resolvedToolName === "programmatic_tool_calling") {
|
|
3982
|
+
if (store && id != null) {
|
|
3983
|
+
input.push({ type: "item_reference", id });
|
|
3984
|
+
break;
|
|
3985
|
+
}
|
|
3986
|
+
const parsedInput = await validateTypes({
|
|
3987
|
+
value: part.input,
|
|
3988
|
+
schema: programmaticToolCallingInputSchema
|
|
3989
|
+
});
|
|
3990
|
+
input.push({
|
|
3991
|
+
type: "program",
|
|
3992
|
+
id: id != null ? id : part.toolCallId,
|
|
3993
|
+
call_id: part.toolCallId,
|
|
3994
|
+
code: parsedInput.code,
|
|
3995
|
+
fingerprint: parsedInput.fingerprint
|
|
3996
|
+
});
|
|
3997
|
+
break;
|
|
3998
|
+
}
|
|
3924
3999
|
if (part.providerExecuted) {
|
|
3925
4000
|
if (store && id != null) {
|
|
3926
4001
|
input.push({ type: "item_reference", id });
|
|
@@ -3930,7 +4005,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3930
4005
|
if (hasPreviousResponseId && store && id != null) {
|
|
3931
4006
|
break;
|
|
3932
4007
|
}
|
|
3933
|
-
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || hasComputerTool && resolvedToolName === "computer" || ((
|
|
4008
|
+
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);
|
|
3934
4009
|
if (store && id != null && isProviderDefinedToolCall) {
|
|
3935
4010
|
input.push({ type: "item_reference", id });
|
|
3936
4011
|
break;
|
|
@@ -4049,7 +4124,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
4049
4124
|
call_id: part.toolCallId,
|
|
4050
4125
|
name: resolvedToolName,
|
|
4051
4126
|
arguments: serializeToolCallArguments2(part.input),
|
|
4052
|
-
...namespace != null && { namespace }
|
|
4127
|
+
...namespace != null && { namespace },
|
|
4128
|
+
...caller != null && {
|
|
4129
|
+
caller: mapToolCaller(caller)
|
|
4130
|
+
}
|
|
4053
4131
|
});
|
|
4054
4132
|
break;
|
|
4055
4133
|
}
|
|
@@ -4065,7 +4143,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4065
4143
|
part.toolName
|
|
4066
4144
|
);
|
|
4067
4145
|
if (resolvedResultToolName === "tool_search") {
|
|
4068
|
-
const itemId = (
|
|
4146
|
+
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;
|
|
4069
4147
|
if (store) {
|
|
4070
4148
|
input.push({ type: "item_reference", id: itemId });
|
|
4071
4149
|
} else if (part.output.type === "json") {
|
|
@@ -4084,6 +4162,25 @@ async function convertToOpenAIResponsesInput({
|
|
|
4084
4162
|
}
|
|
4085
4163
|
break;
|
|
4086
4164
|
}
|
|
4165
|
+
if (resolvedResultToolName === "programmatic_tool_calling") {
|
|
4166
|
+
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;
|
|
4167
|
+
if (store) {
|
|
4168
|
+
input.push({ type: "item_reference", id: itemId });
|
|
4169
|
+
} else if (part.output.type === "json") {
|
|
4170
|
+
const parsedOutput = await validateTypes({
|
|
4171
|
+
value: part.output.value,
|
|
4172
|
+
schema: programmaticToolCallingOutputSchema
|
|
4173
|
+
});
|
|
4174
|
+
input.push({
|
|
4175
|
+
type: "program_output",
|
|
4176
|
+
id: itemId,
|
|
4177
|
+
call_id: part.toolCallId,
|
|
4178
|
+
result: parsedOutput.result,
|
|
4179
|
+
status: parsedOutput.status
|
|
4180
|
+
});
|
|
4181
|
+
}
|
|
4182
|
+
break;
|
|
4183
|
+
}
|
|
4087
4184
|
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
4088
4185
|
if (part.output.type === "json") {
|
|
4089
4186
|
const parsedOutput = await validateTypes({
|
|
@@ -4106,7 +4203,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4106
4203
|
break;
|
|
4107
4204
|
}
|
|
4108
4205
|
if (store) {
|
|
4109
|
-
const itemId = (
|
|
4206
|
+
const itemId = (_D = (_C = (_B = part.providerOptions) == null ? void 0 : _B[providerOptionsName]) == null ? void 0 : _C.itemId) != null ? _D : part.toolCallId;
|
|
4110
4207
|
input.push({ type: "item_reference", id: itemId });
|
|
4111
4208
|
} else {
|
|
4112
4209
|
warnings.push({
|
|
@@ -4191,7 +4288,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4191
4288
|
}
|
|
4192
4289
|
case "custom": {
|
|
4193
4290
|
if (part.kind === "openai.compaction") {
|
|
4194
|
-
const providerOptions2 = (
|
|
4291
|
+
const providerOptions2 = (_E = part.providerOptions) == null ? void 0 : _E[providerOptionsName];
|
|
4195
4292
|
const id = providerOptions2 == null ? void 0 : providerOptions2.itemId;
|
|
4196
4293
|
if (hasConversation && id != null) {
|
|
4197
4294
|
break;
|
|
@@ -4238,7 +4335,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4238
4335
|
}
|
|
4239
4336
|
const output = part.output;
|
|
4240
4337
|
if (output.type === "execution-denied") {
|
|
4241
|
-
const approvalId = (
|
|
4338
|
+
const approvalId = (_G = (_F = output.providerOptions) == null ? void 0 : _F.openai) == null ? void 0 : _G.approvalId;
|
|
4242
4339
|
if (approvalId) {
|
|
4243
4340
|
continue;
|
|
4244
4341
|
}
|
|
@@ -4318,7 +4415,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4318
4415
|
file_id: parsedOutput.output.fileId,
|
|
4319
4416
|
detail: parsedOutput.output.detail
|
|
4320
4417
|
},
|
|
4321
|
-
acknowledged_safety_checks: (
|
|
4418
|
+
acknowledged_safety_checks: (_H = parsedOutput.acknowledgedSafetyChecks) == null ? void 0 : _H.map((safetyCheck) => ({
|
|
4322
4419
|
id: safetyCheck.id,
|
|
4323
4420
|
code: safetyCheck.code,
|
|
4324
4421
|
message: safetyCheck.message
|
|
@@ -4334,7 +4431,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4334
4431
|
outputValue = output.value;
|
|
4335
4432
|
break;
|
|
4336
4433
|
case "execution-denied":
|
|
4337
|
-
outputValue = (
|
|
4434
|
+
outputValue = (_I = output.reason) != null ? _I : "Tool call execution denied.";
|
|
4338
4435
|
break;
|
|
4339
4436
|
case "json":
|
|
4340
4437
|
case "error-json":
|
|
@@ -4433,7 +4530,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4433
4530
|
contentValue = output.value;
|
|
4434
4531
|
break;
|
|
4435
4532
|
case "execution-denied":
|
|
4436
|
-
contentValue = (
|
|
4533
|
+
contentValue = (_J = output.reason) != null ? _J : "Tool call execution denied.";
|
|
4437
4534
|
break;
|
|
4438
4535
|
case "json":
|
|
4439
4536
|
case "error-json":
|
|
@@ -4518,10 +4615,14 @@ async function convertToOpenAIResponsesInput({
|
|
|
4518
4615
|
}).filter(isNonNullable);
|
|
4519
4616
|
break;
|
|
4520
4617
|
}
|
|
4618
|
+
const caller = mapToolCaller(
|
|
4619
|
+
(_L = (_K = part.providerOptions) == null ? void 0 : _K[providerOptionsName]) == null ? void 0 : _L.caller
|
|
4620
|
+
);
|
|
4521
4621
|
input.push({
|
|
4522
4622
|
type: "function_call_output",
|
|
4523
4623
|
call_id: part.toolCallId,
|
|
4524
|
-
output: contentValue
|
|
4624
|
+
output: contentValue,
|
|
4625
|
+
...caller != null && { caller }
|
|
4525
4626
|
});
|
|
4526
4627
|
}
|
|
4527
4628
|
break;
|
|
@@ -4545,9 +4646,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
4545
4646
|
}
|
|
4546
4647
|
return { input, warnings };
|
|
4547
4648
|
}
|
|
4548
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4549
|
-
itemId:
|
|
4550
|
-
reasoningEncryptedContent:
|
|
4649
|
+
var openaiResponsesReasoningProviderOptionsSchema = z25.object({
|
|
4650
|
+
itemId: z25.string().nullish(),
|
|
4651
|
+
reasoningEncryptedContent: z25.string().nullish()
|
|
4551
4652
|
});
|
|
4552
4653
|
|
|
4553
4654
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -4570,643 +4671,670 @@ function mapOpenAIResponseFinishReason({
|
|
|
4570
4671
|
|
|
4571
4672
|
// src/responses/openai-responses-api.ts
|
|
4572
4673
|
import {
|
|
4573
|
-
lazySchema as
|
|
4574
|
-
zodSchema as
|
|
4674
|
+
lazySchema as lazySchema24,
|
|
4675
|
+
zodSchema as zodSchema24
|
|
4575
4676
|
} from "@ai-sdk/provider-utils";
|
|
4576
|
-
import { z as
|
|
4577
|
-
var jsonValueSchema2 =
|
|
4578
|
-
() =>
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4677
|
+
import { z as z26 } from "zod/v4";
|
|
4678
|
+
var jsonValueSchema2 = z26.lazy(
|
|
4679
|
+
() => z26.union([
|
|
4680
|
+
z26.string(),
|
|
4681
|
+
z26.number(),
|
|
4682
|
+
z26.boolean(),
|
|
4683
|
+
z26.null(),
|
|
4684
|
+
z26.array(jsonValueSchema2),
|
|
4685
|
+
z26.record(z26.string(), jsonValueSchema2.optional())
|
|
4585
4686
|
])
|
|
4586
4687
|
);
|
|
4587
|
-
var openaiResponsesComputerSafetyCheckSchema =
|
|
4588
|
-
id:
|
|
4589
|
-
code:
|
|
4590
|
-
message:
|
|
4688
|
+
var openaiResponsesComputerSafetyCheckSchema = z26.object({
|
|
4689
|
+
id: z26.string(),
|
|
4690
|
+
code: z26.string().nullish(),
|
|
4691
|
+
message: z26.string().nullish()
|
|
4591
4692
|
});
|
|
4592
|
-
var openaiResponsesComputerActionSchema =
|
|
4593
|
-
|
|
4594
|
-
type:
|
|
4595
|
-
button:
|
|
4596
|
-
x:
|
|
4597
|
-
y:
|
|
4598
|
-
keys:
|
|
4693
|
+
var openaiResponsesComputerActionSchema = z26.discriminatedUnion("type", [
|
|
4694
|
+
z26.object({
|
|
4695
|
+
type: z26.literal("click"),
|
|
4696
|
+
button: z26.enum(["left", "right", "wheel", "back", "forward"]),
|
|
4697
|
+
x: z26.number(),
|
|
4698
|
+
y: z26.number(),
|
|
4699
|
+
keys: z26.array(z26.string()).nullish()
|
|
4599
4700
|
}),
|
|
4600
|
-
|
|
4601
|
-
type:
|
|
4602
|
-
x:
|
|
4603
|
-
y:
|
|
4604
|
-
keys:
|
|
4701
|
+
z26.object({
|
|
4702
|
+
type: z26.literal("double_click"),
|
|
4703
|
+
x: z26.number(),
|
|
4704
|
+
y: z26.number(),
|
|
4705
|
+
keys: z26.array(z26.string()).nullish()
|
|
4605
4706
|
}),
|
|
4606
|
-
|
|
4607
|
-
type:
|
|
4608
|
-
path:
|
|
4609
|
-
keys:
|
|
4707
|
+
z26.object({
|
|
4708
|
+
type: z26.literal("drag"),
|
|
4709
|
+
path: z26.array(z26.object({ x: z26.number(), y: z26.number() })),
|
|
4710
|
+
keys: z26.array(z26.string()).nullish()
|
|
4610
4711
|
}),
|
|
4611
|
-
|
|
4612
|
-
type:
|
|
4613
|
-
keys:
|
|
4712
|
+
z26.object({
|
|
4713
|
+
type: z26.literal("keypress"),
|
|
4714
|
+
keys: z26.array(z26.string())
|
|
4614
4715
|
}),
|
|
4615
|
-
|
|
4616
|
-
type:
|
|
4617
|
-
x:
|
|
4618
|
-
y:
|
|
4619
|
-
keys:
|
|
4716
|
+
z26.object({
|
|
4717
|
+
type: z26.literal("move"),
|
|
4718
|
+
x: z26.number(),
|
|
4719
|
+
y: z26.number(),
|
|
4720
|
+
keys: z26.array(z26.string()).nullish()
|
|
4620
4721
|
}),
|
|
4621
|
-
|
|
4622
|
-
type:
|
|
4722
|
+
z26.object({
|
|
4723
|
+
type: z26.literal("screenshot")
|
|
4623
4724
|
}),
|
|
4624
|
-
|
|
4625
|
-
type:
|
|
4626
|
-
x:
|
|
4627
|
-
y:
|
|
4628
|
-
scroll_x:
|
|
4629
|
-
scroll_y:
|
|
4630
|
-
keys:
|
|
4725
|
+
z26.object({
|
|
4726
|
+
type: z26.literal("scroll"),
|
|
4727
|
+
x: z26.number(),
|
|
4728
|
+
y: z26.number(),
|
|
4729
|
+
scroll_x: z26.number(),
|
|
4730
|
+
scroll_y: z26.number(),
|
|
4731
|
+
keys: z26.array(z26.string()).nullish()
|
|
4631
4732
|
}),
|
|
4632
|
-
|
|
4633
|
-
type:
|
|
4634
|
-
text:
|
|
4733
|
+
z26.object({
|
|
4734
|
+
type: z26.literal("type"),
|
|
4735
|
+
text: z26.string()
|
|
4635
4736
|
}),
|
|
4636
|
-
|
|
4637
|
-
type:
|
|
4737
|
+
z26.object({
|
|
4738
|
+
type: z26.literal("wait")
|
|
4638
4739
|
})
|
|
4639
4740
|
]);
|
|
4640
|
-
var openaiResponsesComputerCallSchema =
|
|
4641
|
-
type:
|
|
4642
|
-
id:
|
|
4643
|
-
call_id:
|
|
4644
|
-
status:
|
|
4741
|
+
var openaiResponsesComputerCallSchema = z26.object({
|
|
4742
|
+
type: z26.literal("computer_call"),
|
|
4743
|
+
id: z26.string(),
|
|
4744
|
+
call_id: z26.string().nullish(),
|
|
4745
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
4645
4746
|
action: openaiResponsesComputerActionSchema.nullish(),
|
|
4646
|
-
actions:
|
|
4647
|
-
pending_safety_checks:
|
|
4747
|
+
actions: z26.array(openaiResponsesComputerActionSchema).nullish(),
|
|
4748
|
+
pending_safety_checks: z26.array(openaiResponsesComputerSafetyCheckSchema).nullish()
|
|
4648
4749
|
});
|
|
4649
|
-
var
|
|
4650
|
-
type:
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
code: z25.string(),
|
|
4655
|
-
message: z25.string(),
|
|
4656
|
-
param: z25.string().nullish()
|
|
4750
|
+
var openaiResponsesToolCallerSchema = z26.discriminatedUnion("type", [
|
|
4751
|
+
z26.object({ type: z26.literal("direct") }),
|
|
4752
|
+
z26.object({
|
|
4753
|
+
type: z26.literal("program"),
|
|
4754
|
+
caller_id: z26.string()
|
|
4657
4755
|
})
|
|
4756
|
+
]);
|
|
4757
|
+
var openaiResponsesProgramSchema = z26.object({
|
|
4758
|
+
type: z26.literal("program"),
|
|
4759
|
+
id: z26.string(),
|
|
4760
|
+
call_id: z26.string(),
|
|
4761
|
+
code: z26.string(),
|
|
4762
|
+
fingerprint: z26.string()
|
|
4658
4763
|
});
|
|
4659
|
-
var
|
|
4660
|
-
type:
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4764
|
+
var openaiResponsesProgramOutputSchema = z26.object({
|
|
4765
|
+
type: z26.literal("program_output"),
|
|
4766
|
+
id: z26.string(),
|
|
4767
|
+
call_id: z26.string(),
|
|
4768
|
+
result: z26.string(),
|
|
4769
|
+
status: z26.enum(["completed", "incomplete"])
|
|
4665
4770
|
});
|
|
4666
|
-
var
|
|
4667
|
-
()
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4771
|
+
var openaiResponsesNestedErrorChunkSchema = z26.object({
|
|
4772
|
+
type: z26.literal("error"),
|
|
4773
|
+
sequence_number: z26.number(),
|
|
4774
|
+
error: z26.object({
|
|
4775
|
+
type: z26.string(),
|
|
4776
|
+
code: z26.string(),
|
|
4777
|
+
message: z26.string(),
|
|
4778
|
+
param: z26.string().nullish()
|
|
4779
|
+
})
|
|
4780
|
+
});
|
|
4781
|
+
var openaiResponsesErrorChunkSchema = z26.object({
|
|
4782
|
+
type: z26.literal("error"),
|
|
4783
|
+
sequence_number: z26.number(),
|
|
4784
|
+
code: z26.string().nullish(),
|
|
4785
|
+
message: z26.string(),
|
|
4786
|
+
param: z26.string().nullish()
|
|
4787
|
+
});
|
|
4788
|
+
var openaiResponsesChunkSchema = lazySchema24(
|
|
4789
|
+
() => zodSchema24(
|
|
4790
|
+
z26.union([
|
|
4791
|
+
z26.object({
|
|
4792
|
+
type: z26.literal("response.output_text.delta"),
|
|
4793
|
+
item_id: z26.string(),
|
|
4794
|
+
delta: z26.string(),
|
|
4795
|
+
logprobs: z26.array(
|
|
4796
|
+
z26.object({
|
|
4797
|
+
token: z26.string(),
|
|
4798
|
+
logprob: z26.number(),
|
|
4799
|
+
top_logprobs: z26.array(
|
|
4800
|
+
z26.object({
|
|
4801
|
+
token: z26.string(),
|
|
4802
|
+
logprob: z26.number()
|
|
4681
4803
|
})
|
|
4682
4804
|
)
|
|
4683
4805
|
})
|
|
4684
4806
|
).nullish()
|
|
4685
4807
|
}),
|
|
4686
|
-
|
|
4687
|
-
type:
|
|
4688
|
-
response:
|
|
4689
|
-
incomplete_details:
|
|
4690
|
-
usage:
|
|
4691
|
-
input_tokens:
|
|
4692
|
-
input_tokens_details:
|
|
4693
|
-
cached_tokens:
|
|
4694
|
-
cache_write_tokens:
|
|
4695
|
-
orchestration_input_tokens:
|
|
4696
|
-
orchestration_input_cached_tokens:
|
|
4808
|
+
z26.object({
|
|
4809
|
+
type: z26.enum(["response.completed", "response.incomplete"]),
|
|
4810
|
+
response: z26.object({
|
|
4811
|
+
incomplete_details: z26.object({ reason: z26.string() }).nullish(),
|
|
4812
|
+
usage: z26.object({
|
|
4813
|
+
input_tokens: z26.number(),
|
|
4814
|
+
input_tokens_details: z26.object({
|
|
4815
|
+
cached_tokens: z26.number().nullish(),
|
|
4816
|
+
cache_write_tokens: z26.number().nullish(),
|
|
4817
|
+
orchestration_input_tokens: z26.number().nullish(),
|
|
4818
|
+
orchestration_input_cached_tokens: z26.number().nullish()
|
|
4697
4819
|
}).nullish(),
|
|
4698
|
-
output_tokens:
|
|
4699
|
-
output_tokens_details:
|
|
4700
|
-
reasoning_tokens:
|
|
4701
|
-
orchestration_output_tokens:
|
|
4820
|
+
output_tokens: z26.number(),
|
|
4821
|
+
output_tokens_details: z26.object({
|
|
4822
|
+
reasoning_tokens: z26.number().nullish(),
|
|
4823
|
+
orchestration_output_tokens: z26.number().nullish()
|
|
4702
4824
|
}).nullish()
|
|
4703
4825
|
}),
|
|
4704
|
-
reasoning:
|
|
4705
|
-
context:
|
|
4826
|
+
reasoning: z26.object({
|
|
4827
|
+
context: z26.string().nullish()
|
|
4706
4828
|
}).nullish(),
|
|
4707
|
-
service_tier:
|
|
4829
|
+
service_tier: z26.string().nullish()
|
|
4708
4830
|
})
|
|
4709
4831
|
}),
|
|
4710
|
-
|
|
4711
|
-
type:
|
|
4712
|
-
sequence_number:
|
|
4713
|
-
response:
|
|
4714
|
-
error:
|
|
4715
|
-
code:
|
|
4716
|
-
message:
|
|
4832
|
+
z26.object({
|
|
4833
|
+
type: z26.literal("response.failed"),
|
|
4834
|
+
sequence_number: z26.number(),
|
|
4835
|
+
response: z26.object({
|
|
4836
|
+
error: z26.object({
|
|
4837
|
+
code: z26.string().nullish(),
|
|
4838
|
+
message: z26.string()
|
|
4717
4839
|
}).nullish(),
|
|
4718
|
-
incomplete_details:
|
|
4719
|
-
usage:
|
|
4720
|
-
input_tokens:
|
|
4721
|
-
input_tokens_details:
|
|
4722
|
-
cached_tokens:
|
|
4723
|
-
cache_write_tokens:
|
|
4724
|
-
orchestration_input_tokens:
|
|
4725
|
-
orchestration_input_cached_tokens:
|
|
4840
|
+
incomplete_details: z26.object({ reason: z26.string() }).nullish(),
|
|
4841
|
+
usage: z26.object({
|
|
4842
|
+
input_tokens: z26.number(),
|
|
4843
|
+
input_tokens_details: z26.object({
|
|
4844
|
+
cached_tokens: z26.number().nullish(),
|
|
4845
|
+
cache_write_tokens: z26.number().nullish(),
|
|
4846
|
+
orchestration_input_tokens: z26.number().nullish(),
|
|
4847
|
+
orchestration_input_cached_tokens: z26.number().nullish()
|
|
4726
4848
|
}).nullish(),
|
|
4727
|
-
output_tokens:
|
|
4728
|
-
output_tokens_details:
|
|
4729
|
-
reasoning_tokens:
|
|
4730
|
-
orchestration_output_tokens:
|
|
4849
|
+
output_tokens: z26.number(),
|
|
4850
|
+
output_tokens_details: z26.object({
|
|
4851
|
+
reasoning_tokens: z26.number().nullish(),
|
|
4852
|
+
orchestration_output_tokens: z26.number().nullish()
|
|
4731
4853
|
}).nullish()
|
|
4732
4854
|
}).nullish(),
|
|
4733
|
-
reasoning:
|
|
4734
|
-
context:
|
|
4855
|
+
reasoning: z26.object({
|
|
4856
|
+
context: z26.string().nullish()
|
|
4735
4857
|
}).nullish(),
|
|
4736
|
-
service_tier:
|
|
4858
|
+
service_tier: z26.string().nullish()
|
|
4737
4859
|
})
|
|
4738
4860
|
}),
|
|
4739
|
-
|
|
4740
|
-
type:
|
|
4741
|
-
response:
|
|
4742
|
-
id:
|
|
4743
|
-
created_at:
|
|
4744
|
-
model:
|
|
4745
|
-
service_tier:
|
|
4861
|
+
z26.object({
|
|
4862
|
+
type: z26.literal("response.created"),
|
|
4863
|
+
response: z26.object({
|
|
4864
|
+
id: z26.string(),
|
|
4865
|
+
created_at: z26.number(),
|
|
4866
|
+
model: z26.string(),
|
|
4867
|
+
service_tier: z26.string().nullish()
|
|
4746
4868
|
})
|
|
4747
4869
|
}),
|
|
4748
|
-
|
|
4749
|
-
type:
|
|
4750
|
-
output_index:
|
|
4751
|
-
item:
|
|
4752
|
-
|
|
4753
|
-
type:
|
|
4754
|
-
id:
|
|
4755
|
-
phase:
|
|
4870
|
+
z26.object({
|
|
4871
|
+
type: z26.literal("response.output_item.added"),
|
|
4872
|
+
output_index: z26.number(),
|
|
4873
|
+
item: z26.discriminatedUnion("type", [
|
|
4874
|
+
z26.object({
|
|
4875
|
+
type: z26.literal("message"),
|
|
4876
|
+
id: z26.string(),
|
|
4877
|
+
phase: z26.enum(["commentary", "final_answer"]).nullish()
|
|
4756
4878
|
}),
|
|
4757
|
-
|
|
4758
|
-
type:
|
|
4759
|
-
id:
|
|
4760
|
-
encrypted_content:
|
|
4879
|
+
z26.object({
|
|
4880
|
+
type: z26.literal("reasoning"),
|
|
4881
|
+
id: z26.string(),
|
|
4882
|
+
encrypted_content: z26.string().nullish()
|
|
4761
4883
|
}),
|
|
4762
|
-
|
|
4763
|
-
type:
|
|
4764
|
-
id:
|
|
4765
|
-
call_id:
|
|
4766
|
-
name:
|
|
4767
|
-
arguments:
|
|
4768
|
-
namespace:
|
|
4884
|
+
z26.object({
|
|
4885
|
+
type: z26.literal("function_call"),
|
|
4886
|
+
id: z26.string(),
|
|
4887
|
+
call_id: z26.string(),
|
|
4888
|
+
name: z26.string(),
|
|
4889
|
+
arguments: z26.string(),
|
|
4890
|
+
namespace: z26.string().nullish(),
|
|
4891
|
+
caller: openaiResponsesToolCallerSchema.nullish()
|
|
4769
4892
|
}),
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4893
|
+
openaiResponsesProgramSchema,
|
|
4894
|
+
openaiResponsesProgramOutputSchema,
|
|
4895
|
+
z26.object({
|
|
4896
|
+
type: z26.literal("web_search_call"),
|
|
4897
|
+
id: z26.string(),
|
|
4898
|
+
status: z26.string()
|
|
4774
4899
|
}),
|
|
4775
4900
|
openaiResponsesComputerCallSchema,
|
|
4776
|
-
|
|
4777
|
-
type:
|
|
4778
|
-
id:
|
|
4901
|
+
z26.object({
|
|
4902
|
+
type: z26.literal("file_search_call"),
|
|
4903
|
+
id: z26.string()
|
|
4779
4904
|
}),
|
|
4780
|
-
|
|
4781
|
-
type:
|
|
4782
|
-
id:
|
|
4905
|
+
z26.object({
|
|
4906
|
+
type: z26.literal("image_generation_call"),
|
|
4907
|
+
id: z26.string()
|
|
4783
4908
|
}),
|
|
4784
|
-
|
|
4785
|
-
type:
|
|
4786
|
-
id:
|
|
4787
|
-
container_id:
|
|
4788
|
-
code:
|
|
4789
|
-
outputs:
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4909
|
+
z26.object({
|
|
4910
|
+
type: z26.literal("code_interpreter_call"),
|
|
4911
|
+
id: z26.string(),
|
|
4912
|
+
container_id: z26.string(),
|
|
4913
|
+
code: z26.string().nullable(),
|
|
4914
|
+
outputs: z26.array(
|
|
4915
|
+
z26.discriminatedUnion("type", [
|
|
4916
|
+
z26.object({ type: z26.literal("logs"), logs: z26.string() }),
|
|
4917
|
+
z26.object({ type: z26.literal("image"), url: z26.string() })
|
|
4793
4918
|
])
|
|
4794
4919
|
).nullable(),
|
|
4795
|
-
status:
|
|
4920
|
+
status: z26.string()
|
|
4796
4921
|
}),
|
|
4797
|
-
|
|
4798
|
-
type:
|
|
4799
|
-
id:
|
|
4800
|
-
status:
|
|
4801
|
-
approval_request_id:
|
|
4922
|
+
z26.object({
|
|
4923
|
+
type: z26.literal("mcp_call"),
|
|
4924
|
+
id: z26.string(),
|
|
4925
|
+
status: z26.string(),
|
|
4926
|
+
approval_request_id: z26.string().nullish()
|
|
4802
4927
|
}),
|
|
4803
|
-
|
|
4804
|
-
type:
|
|
4805
|
-
id:
|
|
4928
|
+
z26.object({
|
|
4929
|
+
type: z26.literal("mcp_list_tools"),
|
|
4930
|
+
id: z26.string()
|
|
4806
4931
|
}),
|
|
4807
|
-
|
|
4808
|
-
type:
|
|
4809
|
-
id:
|
|
4932
|
+
z26.object({
|
|
4933
|
+
type: z26.literal("mcp_approval_request"),
|
|
4934
|
+
id: z26.string()
|
|
4810
4935
|
}),
|
|
4811
|
-
|
|
4812
|
-
type:
|
|
4813
|
-
id:
|
|
4814
|
-
call_id:
|
|
4815
|
-
status:
|
|
4816
|
-
operation:
|
|
4817
|
-
|
|
4818
|
-
type:
|
|
4819
|
-
path:
|
|
4820
|
-
diff:
|
|
4936
|
+
z26.object({
|
|
4937
|
+
type: z26.literal("apply_patch_call"),
|
|
4938
|
+
id: z26.string(),
|
|
4939
|
+
call_id: z26.string(),
|
|
4940
|
+
status: z26.enum(["in_progress", "completed"]),
|
|
4941
|
+
operation: z26.discriminatedUnion("type", [
|
|
4942
|
+
z26.object({
|
|
4943
|
+
type: z26.literal("create_file"),
|
|
4944
|
+
path: z26.string(),
|
|
4945
|
+
diff: z26.string()
|
|
4821
4946
|
}),
|
|
4822
|
-
|
|
4823
|
-
type:
|
|
4824
|
-
path:
|
|
4947
|
+
z26.object({
|
|
4948
|
+
type: z26.literal("delete_file"),
|
|
4949
|
+
path: z26.string()
|
|
4825
4950
|
}),
|
|
4826
|
-
|
|
4827
|
-
type:
|
|
4828
|
-
path:
|
|
4829
|
-
diff:
|
|
4951
|
+
z26.object({
|
|
4952
|
+
type: z26.literal("update_file"),
|
|
4953
|
+
path: z26.string(),
|
|
4954
|
+
diff: z26.string()
|
|
4830
4955
|
})
|
|
4831
4956
|
])
|
|
4832
4957
|
}),
|
|
4833
|
-
|
|
4834
|
-
type:
|
|
4835
|
-
id:
|
|
4836
|
-
call_id:
|
|
4837
|
-
name:
|
|
4838
|
-
input:
|
|
4958
|
+
z26.object({
|
|
4959
|
+
type: z26.literal("custom_tool_call"),
|
|
4960
|
+
id: z26.string(),
|
|
4961
|
+
call_id: z26.string(),
|
|
4962
|
+
name: z26.string(),
|
|
4963
|
+
input: z26.string()
|
|
4839
4964
|
}),
|
|
4840
|
-
|
|
4841
|
-
type:
|
|
4842
|
-
id:
|
|
4843
|
-
call_id:
|
|
4844
|
-
status:
|
|
4845
|
-
action:
|
|
4846
|
-
commands:
|
|
4965
|
+
z26.object({
|
|
4966
|
+
type: z26.literal("shell_call"),
|
|
4967
|
+
id: z26.string(),
|
|
4968
|
+
call_id: z26.string(),
|
|
4969
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
4970
|
+
action: z26.object({
|
|
4971
|
+
commands: z26.array(z26.string())
|
|
4847
4972
|
})
|
|
4848
4973
|
}),
|
|
4849
|
-
|
|
4850
|
-
type:
|
|
4851
|
-
id:
|
|
4852
|
-
encrypted_content:
|
|
4974
|
+
z26.object({
|
|
4975
|
+
type: z26.literal("compaction"),
|
|
4976
|
+
id: z26.string(),
|
|
4977
|
+
encrypted_content: z26.string().nullish()
|
|
4853
4978
|
}),
|
|
4854
|
-
|
|
4855
|
-
type:
|
|
4856
|
-
id:
|
|
4857
|
-
call_id:
|
|
4858
|
-
status:
|
|
4859
|
-
output:
|
|
4860
|
-
|
|
4861
|
-
stdout:
|
|
4862
|
-
stderr:
|
|
4863
|
-
outcome:
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
type:
|
|
4867
|
-
exit_code:
|
|
4979
|
+
z26.object({
|
|
4980
|
+
type: z26.literal("shell_call_output"),
|
|
4981
|
+
id: z26.string(),
|
|
4982
|
+
call_id: z26.string(),
|
|
4983
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
4984
|
+
output: z26.array(
|
|
4985
|
+
z26.object({
|
|
4986
|
+
stdout: z26.string(),
|
|
4987
|
+
stderr: z26.string(),
|
|
4988
|
+
outcome: z26.discriminatedUnion("type", [
|
|
4989
|
+
z26.object({ type: z26.literal("timeout") }),
|
|
4990
|
+
z26.object({
|
|
4991
|
+
type: z26.literal("exit"),
|
|
4992
|
+
exit_code: z26.number()
|
|
4868
4993
|
})
|
|
4869
4994
|
])
|
|
4870
4995
|
})
|
|
4871
4996
|
)
|
|
4872
4997
|
}),
|
|
4873
|
-
|
|
4874
|
-
type:
|
|
4875
|
-
id:
|
|
4876
|
-
execution:
|
|
4877
|
-
call_id:
|
|
4878
|
-
status:
|
|
4879
|
-
arguments:
|
|
4998
|
+
z26.object({
|
|
4999
|
+
type: z26.literal("tool_search_call"),
|
|
5000
|
+
id: z26.string(),
|
|
5001
|
+
execution: z26.enum(["server", "client"]),
|
|
5002
|
+
call_id: z26.string().nullable(),
|
|
5003
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5004
|
+
arguments: z26.unknown()
|
|
4880
5005
|
}),
|
|
4881
|
-
|
|
4882
|
-
type:
|
|
4883
|
-
id:
|
|
4884
|
-
execution:
|
|
4885
|
-
call_id:
|
|
4886
|
-
status:
|
|
4887
|
-
tools:
|
|
5006
|
+
z26.object({
|
|
5007
|
+
type: z26.literal("tool_search_output"),
|
|
5008
|
+
id: z26.string(),
|
|
5009
|
+
execution: z26.enum(["server", "client"]),
|
|
5010
|
+
call_id: z26.string().nullable(),
|
|
5011
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5012
|
+
tools: z26.array(z26.record(z26.string(), jsonValueSchema2.optional()))
|
|
4888
5013
|
})
|
|
4889
5014
|
])
|
|
4890
5015
|
}),
|
|
4891
|
-
|
|
4892
|
-
type:
|
|
4893
|
-
output_index:
|
|
4894
|
-
item:
|
|
4895
|
-
|
|
4896
|
-
type:
|
|
4897
|
-
id:
|
|
4898
|
-
phase:
|
|
5016
|
+
z26.object({
|
|
5017
|
+
type: z26.literal("response.output_item.done"),
|
|
5018
|
+
output_index: z26.number(),
|
|
5019
|
+
item: z26.discriminatedUnion("type", [
|
|
5020
|
+
z26.object({
|
|
5021
|
+
type: z26.literal("message"),
|
|
5022
|
+
id: z26.string(),
|
|
5023
|
+
phase: z26.enum(["commentary", "final_answer"]).nullish()
|
|
4899
5024
|
}),
|
|
4900
|
-
|
|
4901
|
-
type:
|
|
4902
|
-
id:
|
|
4903
|
-
encrypted_content:
|
|
5025
|
+
z26.object({
|
|
5026
|
+
type: z26.literal("reasoning"),
|
|
5027
|
+
id: z26.string(),
|
|
5028
|
+
encrypted_content: z26.string().nullish()
|
|
4904
5029
|
}),
|
|
4905
|
-
|
|
4906
|
-
type:
|
|
4907
|
-
id:
|
|
4908
|
-
call_id:
|
|
4909
|
-
name:
|
|
4910
|
-
arguments:
|
|
4911
|
-
status:
|
|
4912
|
-
namespace:
|
|
5030
|
+
z26.object({
|
|
5031
|
+
type: z26.literal("function_call"),
|
|
5032
|
+
id: z26.string(),
|
|
5033
|
+
call_id: z26.string(),
|
|
5034
|
+
name: z26.string(),
|
|
5035
|
+
arguments: z26.string(),
|
|
5036
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5037
|
+
namespace: z26.string().nullish(),
|
|
5038
|
+
caller: openaiResponsesToolCallerSchema.nullish()
|
|
4913
5039
|
}),
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
5040
|
+
openaiResponsesProgramSchema,
|
|
5041
|
+
openaiResponsesProgramOutputSchema,
|
|
5042
|
+
z26.object({
|
|
5043
|
+
type: z26.literal("custom_tool_call"),
|
|
5044
|
+
id: z26.string(),
|
|
5045
|
+
call_id: z26.string(),
|
|
5046
|
+
name: z26.string(),
|
|
5047
|
+
input: z26.string(),
|
|
5048
|
+
status: z26.literal("completed")
|
|
4921
5049
|
}),
|
|
4922
|
-
|
|
4923
|
-
type:
|
|
4924
|
-
id:
|
|
4925
|
-
code:
|
|
4926
|
-
container_id:
|
|
4927
|
-
outputs:
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
5050
|
+
z26.object({
|
|
5051
|
+
type: z26.literal("code_interpreter_call"),
|
|
5052
|
+
id: z26.string(),
|
|
5053
|
+
code: z26.string().nullable(),
|
|
5054
|
+
container_id: z26.string(),
|
|
5055
|
+
outputs: z26.array(
|
|
5056
|
+
z26.discriminatedUnion("type", [
|
|
5057
|
+
z26.object({ type: z26.literal("logs"), logs: z26.string() }),
|
|
5058
|
+
z26.object({ type: z26.literal("image"), url: z26.string() })
|
|
4931
5059
|
])
|
|
4932
5060
|
).nullable()
|
|
4933
5061
|
}),
|
|
4934
|
-
|
|
4935
|
-
type:
|
|
4936
|
-
id:
|
|
4937
|
-
result:
|
|
5062
|
+
z26.object({
|
|
5063
|
+
type: z26.literal("image_generation_call"),
|
|
5064
|
+
id: z26.string(),
|
|
5065
|
+
result: z26.string()
|
|
4938
5066
|
}),
|
|
4939
|
-
|
|
4940
|
-
type:
|
|
4941
|
-
id:
|
|
4942
|
-
status:
|
|
4943
|
-
action:
|
|
4944
|
-
|
|
4945
|
-
type:
|
|
4946
|
-
query:
|
|
4947
|
-
queries:
|
|
4948
|
-
sources:
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
5067
|
+
z26.object({
|
|
5068
|
+
type: z26.literal("web_search_call"),
|
|
5069
|
+
id: z26.string(),
|
|
5070
|
+
status: z26.string(),
|
|
5071
|
+
action: z26.discriminatedUnion("type", [
|
|
5072
|
+
z26.object({
|
|
5073
|
+
type: z26.literal("search"),
|
|
5074
|
+
query: z26.string().nullish(),
|
|
5075
|
+
queries: z26.array(z26.string()).nullish(),
|
|
5076
|
+
sources: z26.array(
|
|
5077
|
+
z26.discriminatedUnion("type", [
|
|
5078
|
+
z26.object({ type: z26.literal("url"), url: z26.string() }),
|
|
5079
|
+
z26.object({ type: z26.literal("api"), name: z26.string() })
|
|
4952
5080
|
])
|
|
4953
5081
|
).nullish()
|
|
4954
5082
|
}),
|
|
4955
|
-
|
|
4956
|
-
type:
|
|
4957
|
-
url:
|
|
5083
|
+
z26.object({
|
|
5084
|
+
type: z26.literal("open_page"),
|
|
5085
|
+
url: z26.string().nullish()
|
|
4958
5086
|
}),
|
|
4959
|
-
|
|
4960
|
-
type:
|
|
4961
|
-
url:
|
|
4962
|
-
pattern:
|
|
5087
|
+
z26.object({
|
|
5088
|
+
type: z26.literal("find_in_page"),
|
|
5089
|
+
url: z26.string().nullish(),
|
|
5090
|
+
pattern: z26.string().nullish()
|
|
4963
5091
|
})
|
|
4964
5092
|
]).nullish()
|
|
4965
5093
|
}),
|
|
4966
|
-
|
|
4967
|
-
type:
|
|
4968
|
-
id:
|
|
4969
|
-
queries:
|
|
4970
|
-
results:
|
|
4971
|
-
|
|
4972
|
-
attributes:
|
|
4973
|
-
|
|
4974
|
-
|
|
5094
|
+
z26.object({
|
|
5095
|
+
type: z26.literal("file_search_call"),
|
|
5096
|
+
id: z26.string(),
|
|
5097
|
+
queries: z26.array(z26.string()),
|
|
5098
|
+
results: z26.array(
|
|
5099
|
+
z26.object({
|
|
5100
|
+
attributes: z26.record(
|
|
5101
|
+
z26.string(),
|
|
5102
|
+
z26.union([z26.string(), z26.number(), z26.boolean()])
|
|
4975
5103
|
),
|
|
4976
|
-
file_id:
|
|
4977
|
-
filename:
|
|
4978
|
-
score:
|
|
4979
|
-
text:
|
|
5104
|
+
file_id: z26.string(),
|
|
5105
|
+
filename: z26.string(),
|
|
5106
|
+
score: z26.number(),
|
|
5107
|
+
text: z26.string()
|
|
4980
5108
|
})
|
|
4981
5109
|
).nullish()
|
|
4982
5110
|
}),
|
|
4983
|
-
|
|
4984
|
-
type:
|
|
4985
|
-
id:
|
|
4986
|
-
call_id:
|
|
4987
|
-
action:
|
|
4988
|
-
type:
|
|
4989
|
-
command:
|
|
4990
|
-
timeout_ms:
|
|
4991
|
-
user:
|
|
4992
|
-
working_directory:
|
|
4993
|
-
env:
|
|
5111
|
+
z26.object({
|
|
5112
|
+
type: z26.literal("local_shell_call"),
|
|
5113
|
+
id: z26.string(),
|
|
5114
|
+
call_id: z26.string(),
|
|
5115
|
+
action: z26.object({
|
|
5116
|
+
type: z26.literal("exec"),
|
|
5117
|
+
command: z26.array(z26.string()),
|
|
5118
|
+
timeout_ms: z26.number().optional(),
|
|
5119
|
+
user: z26.string().optional(),
|
|
5120
|
+
working_directory: z26.string().optional(),
|
|
5121
|
+
env: z26.record(z26.string(), z26.string()).optional()
|
|
4994
5122
|
})
|
|
4995
5123
|
}),
|
|
4996
5124
|
openaiResponsesComputerCallSchema,
|
|
4997
|
-
|
|
4998
|
-
type:
|
|
4999
|
-
id:
|
|
5000
|
-
status:
|
|
5001
|
-
arguments:
|
|
5002
|
-
name:
|
|
5003
|
-
server_label:
|
|
5004
|
-
output:
|
|
5005
|
-
error:
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
type:
|
|
5009
|
-
code:
|
|
5010
|
-
message:
|
|
5125
|
+
z26.object({
|
|
5126
|
+
type: z26.literal("mcp_call"),
|
|
5127
|
+
id: z26.string(),
|
|
5128
|
+
status: z26.string(),
|
|
5129
|
+
arguments: z26.string(),
|
|
5130
|
+
name: z26.string(),
|
|
5131
|
+
server_label: z26.string(),
|
|
5132
|
+
output: z26.string().nullish(),
|
|
5133
|
+
error: z26.union([
|
|
5134
|
+
z26.string(),
|
|
5135
|
+
z26.object({
|
|
5136
|
+
type: z26.string().optional(),
|
|
5137
|
+
code: z26.union([z26.number(), z26.string()]).optional(),
|
|
5138
|
+
message: z26.string().optional()
|
|
5011
5139
|
}).loose()
|
|
5012
5140
|
]).nullish(),
|
|
5013
|
-
approval_request_id:
|
|
5141
|
+
approval_request_id: z26.string().nullish()
|
|
5014
5142
|
}),
|
|
5015
|
-
|
|
5016
|
-
type:
|
|
5017
|
-
id:
|
|
5018
|
-
server_label:
|
|
5019
|
-
tools:
|
|
5020
|
-
|
|
5021
|
-
name:
|
|
5022
|
-
description:
|
|
5023
|
-
input_schema:
|
|
5024
|
-
annotations:
|
|
5143
|
+
z26.object({
|
|
5144
|
+
type: z26.literal("mcp_list_tools"),
|
|
5145
|
+
id: z26.string(),
|
|
5146
|
+
server_label: z26.string(),
|
|
5147
|
+
tools: z26.array(
|
|
5148
|
+
z26.object({
|
|
5149
|
+
name: z26.string(),
|
|
5150
|
+
description: z26.string().optional(),
|
|
5151
|
+
input_schema: z26.any(),
|
|
5152
|
+
annotations: z26.record(z26.string(), z26.unknown()).optional()
|
|
5025
5153
|
})
|
|
5026
5154
|
),
|
|
5027
|
-
error:
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
type:
|
|
5031
|
-
code:
|
|
5032
|
-
message:
|
|
5155
|
+
error: z26.union([
|
|
5156
|
+
z26.string(),
|
|
5157
|
+
z26.object({
|
|
5158
|
+
type: z26.string().optional(),
|
|
5159
|
+
code: z26.union([z26.number(), z26.string()]).optional(),
|
|
5160
|
+
message: z26.string().optional()
|
|
5033
5161
|
}).loose()
|
|
5034
5162
|
]).optional()
|
|
5035
5163
|
}),
|
|
5036
|
-
|
|
5037
|
-
type:
|
|
5038
|
-
id:
|
|
5039
|
-
server_label:
|
|
5040
|
-
name:
|
|
5041
|
-
arguments:
|
|
5042
|
-
approval_request_id:
|
|
5164
|
+
z26.object({
|
|
5165
|
+
type: z26.literal("mcp_approval_request"),
|
|
5166
|
+
id: z26.string(),
|
|
5167
|
+
server_label: z26.string(),
|
|
5168
|
+
name: z26.string(),
|
|
5169
|
+
arguments: z26.string(),
|
|
5170
|
+
approval_request_id: z26.string().optional()
|
|
5043
5171
|
}),
|
|
5044
|
-
|
|
5045
|
-
type:
|
|
5046
|
-
id:
|
|
5047
|
-
call_id:
|
|
5048
|
-
status:
|
|
5049
|
-
operation:
|
|
5050
|
-
|
|
5051
|
-
type:
|
|
5052
|
-
path:
|
|
5053
|
-
diff:
|
|
5172
|
+
z26.object({
|
|
5173
|
+
type: z26.literal("apply_patch_call"),
|
|
5174
|
+
id: z26.string(),
|
|
5175
|
+
call_id: z26.string(),
|
|
5176
|
+
status: z26.enum(["in_progress", "completed"]),
|
|
5177
|
+
operation: z26.discriminatedUnion("type", [
|
|
5178
|
+
z26.object({
|
|
5179
|
+
type: z26.literal("create_file"),
|
|
5180
|
+
path: z26.string(),
|
|
5181
|
+
diff: z26.string()
|
|
5054
5182
|
}),
|
|
5055
|
-
|
|
5056
|
-
type:
|
|
5057
|
-
path:
|
|
5183
|
+
z26.object({
|
|
5184
|
+
type: z26.literal("delete_file"),
|
|
5185
|
+
path: z26.string()
|
|
5058
5186
|
}),
|
|
5059
|
-
|
|
5060
|
-
type:
|
|
5061
|
-
path:
|
|
5062
|
-
diff:
|
|
5187
|
+
z26.object({
|
|
5188
|
+
type: z26.literal("update_file"),
|
|
5189
|
+
path: z26.string(),
|
|
5190
|
+
diff: z26.string()
|
|
5063
5191
|
})
|
|
5064
5192
|
])
|
|
5065
5193
|
}),
|
|
5066
|
-
|
|
5067
|
-
type:
|
|
5068
|
-
id:
|
|
5069
|
-
call_id:
|
|
5070
|
-
status:
|
|
5071
|
-
action:
|
|
5072
|
-
commands:
|
|
5194
|
+
z26.object({
|
|
5195
|
+
type: z26.literal("shell_call"),
|
|
5196
|
+
id: z26.string(),
|
|
5197
|
+
call_id: z26.string(),
|
|
5198
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5199
|
+
action: z26.object({
|
|
5200
|
+
commands: z26.array(z26.string())
|
|
5073
5201
|
})
|
|
5074
5202
|
}),
|
|
5075
|
-
|
|
5076
|
-
type:
|
|
5077
|
-
id:
|
|
5078
|
-
encrypted_content:
|
|
5203
|
+
z26.object({
|
|
5204
|
+
type: z26.literal("compaction"),
|
|
5205
|
+
id: z26.string(),
|
|
5206
|
+
encrypted_content: z26.string()
|
|
5079
5207
|
}),
|
|
5080
|
-
|
|
5081
|
-
type:
|
|
5082
|
-
id:
|
|
5083
|
-
call_id:
|
|
5084
|
-
status:
|
|
5085
|
-
output:
|
|
5086
|
-
|
|
5087
|
-
stdout:
|
|
5088
|
-
stderr:
|
|
5089
|
-
outcome:
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
type:
|
|
5093
|
-
exit_code:
|
|
5208
|
+
z26.object({
|
|
5209
|
+
type: z26.literal("shell_call_output"),
|
|
5210
|
+
id: z26.string(),
|
|
5211
|
+
call_id: z26.string(),
|
|
5212
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5213
|
+
output: z26.array(
|
|
5214
|
+
z26.object({
|
|
5215
|
+
stdout: z26.string(),
|
|
5216
|
+
stderr: z26.string(),
|
|
5217
|
+
outcome: z26.discriminatedUnion("type", [
|
|
5218
|
+
z26.object({ type: z26.literal("timeout") }),
|
|
5219
|
+
z26.object({
|
|
5220
|
+
type: z26.literal("exit"),
|
|
5221
|
+
exit_code: z26.number()
|
|
5094
5222
|
})
|
|
5095
5223
|
])
|
|
5096
5224
|
})
|
|
5097
5225
|
)
|
|
5098
5226
|
}),
|
|
5099
|
-
|
|
5100
|
-
type:
|
|
5101
|
-
id:
|
|
5102
|
-
execution:
|
|
5103
|
-
call_id:
|
|
5104
|
-
status:
|
|
5105
|
-
arguments:
|
|
5227
|
+
z26.object({
|
|
5228
|
+
type: z26.literal("tool_search_call"),
|
|
5229
|
+
id: z26.string(),
|
|
5230
|
+
execution: z26.enum(["server", "client"]),
|
|
5231
|
+
call_id: z26.string().nullable(),
|
|
5232
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5233
|
+
arguments: z26.unknown()
|
|
5106
5234
|
}),
|
|
5107
|
-
|
|
5108
|
-
type:
|
|
5109
|
-
id:
|
|
5110
|
-
execution:
|
|
5111
|
-
call_id:
|
|
5112
|
-
status:
|
|
5113
|
-
tools:
|
|
5235
|
+
z26.object({
|
|
5236
|
+
type: z26.literal("tool_search_output"),
|
|
5237
|
+
id: z26.string(),
|
|
5238
|
+
execution: z26.enum(["server", "client"]),
|
|
5239
|
+
call_id: z26.string().nullable(),
|
|
5240
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5241
|
+
tools: z26.array(z26.record(z26.string(), jsonValueSchema2.optional()))
|
|
5114
5242
|
})
|
|
5115
5243
|
])
|
|
5116
5244
|
}),
|
|
5117
|
-
|
|
5118
|
-
type:
|
|
5119
|
-
item_id:
|
|
5120
|
-
output_index:
|
|
5121
|
-
delta:
|
|
5245
|
+
z26.object({
|
|
5246
|
+
type: z26.literal("response.function_call_arguments.delta"),
|
|
5247
|
+
item_id: z26.string(),
|
|
5248
|
+
output_index: z26.number(),
|
|
5249
|
+
delta: z26.string()
|
|
5122
5250
|
}),
|
|
5123
|
-
|
|
5124
|
-
type:
|
|
5125
|
-
item_id:
|
|
5126
|
-
output_index:
|
|
5127
|
-
delta:
|
|
5251
|
+
z26.object({
|
|
5252
|
+
type: z26.literal("response.custom_tool_call_input.delta"),
|
|
5253
|
+
item_id: z26.string(),
|
|
5254
|
+
output_index: z26.number(),
|
|
5255
|
+
delta: z26.string()
|
|
5128
5256
|
}),
|
|
5129
|
-
|
|
5130
|
-
type:
|
|
5131
|
-
item_id:
|
|
5132
|
-
output_index:
|
|
5133
|
-
partial_image_b64:
|
|
5257
|
+
z26.object({
|
|
5258
|
+
type: z26.literal("response.image_generation_call.partial_image"),
|
|
5259
|
+
item_id: z26.string(),
|
|
5260
|
+
output_index: z26.number(),
|
|
5261
|
+
partial_image_b64: z26.string()
|
|
5134
5262
|
}),
|
|
5135
|
-
|
|
5136
|
-
type:
|
|
5137
|
-
item_id:
|
|
5138
|
-
output_index:
|
|
5139
|
-
delta:
|
|
5263
|
+
z26.object({
|
|
5264
|
+
type: z26.literal("response.code_interpreter_call_code.delta"),
|
|
5265
|
+
item_id: z26.string(),
|
|
5266
|
+
output_index: z26.number(),
|
|
5267
|
+
delta: z26.string()
|
|
5140
5268
|
}),
|
|
5141
|
-
|
|
5142
|
-
type:
|
|
5143
|
-
item_id:
|
|
5144
|
-
output_index:
|
|
5145
|
-
code:
|
|
5269
|
+
z26.object({
|
|
5270
|
+
type: z26.literal("response.code_interpreter_call_code.done"),
|
|
5271
|
+
item_id: z26.string(),
|
|
5272
|
+
output_index: z26.number(),
|
|
5273
|
+
code: z26.string()
|
|
5146
5274
|
}),
|
|
5147
|
-
|
|
5148
|
-
type:
|
|
5149
|
-
annotation:
|
|
5150
|
-
|
|
5151
|
-
type:
|
|
5152
|
-
start_index:
|
|
5153
|
-
end_index:
|
|
5154
|
-
url:
|
|
5155
|
-
title:
|
|
5275
|
+
z26.object({
|
|
5276
|
+
type: z26.literal("response.output_text.annotation.added"),
|
|
5277
|
+
annotation: z26.discriminatedUnion("type", [
|
|
5278
|
+
z26.object({
|
|
5279
|
+
type: z26.literal("url_citation"),
|
|
5280
|
+
start_index: z26.number(),
|
|
5281
|
+
end_index: z26.number(),
|
|
5282
|
+
url: z26.string(),
|
|
5283
|
+
title: z26.string()
|
|
5156
5284
|
}),
|
|
5157
|
-
|
|
5158
|
-
type:
|
|
5159
|
-
file_id:
|
|
5160
|
-
filename:
|
|
5161
|
-
index:
|
|
5285
|
+
z26.object({
|
|
5286
|
+
type: z26.literal("file_citation"),
|
|
5287
|
+
file_id: z26.string(),
|
|
5288
|
+
filename: z26.string(),
|
|
5289
|
+
index: z26.number()
|
|
5162
5290
|
}),
|
|
5163
|
-
|
|
5164
|
-
type:
|
|
5165
|
-
container_id:
|
|
5166
|
-
file_id:
|
|
5167
|
-
filename:
|
|
5168
|
-
start_index:
|
|
5169
|
-
end_index:
|
|
5291
|
+
z26.object({
|
|
5292
|
+
type: z26.literal("container_file_citation"),
|
|
5293
|
+
container_id: z26.string(),
|
|
5294
|
+
file_id: z26.string(),
|
|
5295
|
+
filename: z26.string(),
|
|
5296
|
+
start_index: z26.number(),
|
|
5297
|
+
end_index: z26.number()
|
|
5170
5298
|
}),
|
|
5171
|
-
|
|
5172
|
-
type:
|
|
5173
|
-
file_id:
|
|
5174
|
-
index:
|
|
5299
|
+
z26.object({
|
|
5300
|
+
type: z26.literal("file_path"),
|
|
5301
|
+
file_id: z26.string(),
|
|
5302
|
+
index: z26.number()
|
|
5175
5303
|
})
|
|
5176
5304
|
])
|
|
5177
5305
|
}),
|
|
5178
|
-
|
|
5179
|
-
type:
|
|
5180
|
-
item_id:
|
|
5181
|
-
summary_index:
|
|
5306
|
+
z26.object({
|
|
5307
|
+
type: z26.literal("response.reasoning_summary_part.added"),
|
|
5308
|
+
item_id: z26.string(),
|
|
5309
|
+
summary_index: z26.number()
|
|
5182
5310
|
}),
|
|
5183
|
-
|
|
5184
|
-
type:
|
|
5185
|
-
item_id:
|
|
5186
|
-
summary_index:
|
|
5187
|
-
delta:
|
|
5311
|
+
z26.object({
|
|
5312
|
+
type: z26.literal("response.reasoning_summary_text.delta"),
|
|
5313
|
+
item_id: z26.string(),
|
|
5314
|
+
summary_index: z26.number(),
|
|
5315
|
+
delta: z26.string()
|
|
5188
5316
|
}),
|
|
5189
|
-
|
|
5190
|
-
type:
|
|
5191
|
-
item_id:
|
|
5192
|
-
summary_index:
|
|
5317
|
+
z26.object({
|
|
5318
|
+
type: z26.literal("response.reasoning_summary_part.done"),
|
|
5319
|
+
item_id: z26.string(),
|
|
5320
|
+
summary_index: z26.number()
|
|
5193
5321
|
}),
|
|
5194
|
-
|
|
5195
|
-
type:
|
|
5196
|
-
item_id:
|
|
5197
|
-
output_index:
|
|
5198
|
-
delta:
|
|
5199
|
-
obfuscation:
|
|
5322
|
+
z26.object({
|
|
5323
|
+
type: z26.literal("response.apply_patch_call_operation_diff.delta"),
|
|
5324
|
+
item_id: z26.string(),
|
|
5325
|
+
output_index: z26.number(),
|
|
5326
|
+
delta: z26.string(),
|
|
5327
|
+
obfuscation: z26.string().nullish()
|
|
5200
5328
|
}),
|
|
5201
|
-
|
|
5202
|
-
type:
|
|
5203
|
-
item_id:
|
|
5204
|
-
output_index:
|
|
5205
|
-
diff:
|
|
5329
|
+
z26.object({
|
|
5330
|
+
type: z26.literal("response.apply_patch_call_operation_diff.done"),
|
|
5331
|
+
item_id: z26.string(),
|
|
5332
|
+
output_index: z26.number(),
|
|
5333
|
+
diff: z26.string()
|
|
5206
5334
|
}),
|
|
5207
5335
|
openaiResponsesNestedErrorChunkSchema,
|
|
5208
5336
|
openaiResponsesErrorChunkSchema,
|
|
5209
|
-
|
|
5337
|
+
z26.object({ type: z26.string() }).loose().transform((value) => ({
|
|
5210
5338
|
type: "unknown_chunk",
|
|
5211
5339
|
message: value.type
|
|
5212
5340
|
}))
|
|
@@ -5214,315 +5342,318 @@ var openaiResponsesChunkSchema = lazySchema23(
|
|
|
5214
5342
|
])
|
|
5215
5343
|
)
|
|
5216
5344
|
);
|
|
5217
|
-
var openaiResponsesResponseSchema =
|
|
5218
|
-
() =>
|
|
5219
|
-
|
|
5220
|
-
id:
|
|
5221
|
-
created_at:
|
|
5222
|
-
error:
|
|
5223
|
-
message:
|
|
5224
|
-
type:
|
|
5225
|
-
param:
|
|
5226
|
-
code:
|
|
5345
|
+
var openaiResponsesResponseSchema = lazySchema24(
|
|
5346
|
+
() => zodSchema24(
|
|
5347
|
+
z26.object({
|
|
5348
|
+
id: z26.string().optional(),
|
|
5349
|
+
created_at: z26.number().optional(),
|
|
5350
|
+
error: z26.object({
|
|
5351
|
+
message: z26.string(),
|
|
5352
|
+
type: z26.string(),
|
|
5353
|
+
param: z26.string().nullish(),
|
|
5354
|
+
code: z26.string()
|
|
5227
5355
|
}).nullish(),
|
|
5228
|
-
model:
|
|
5229
|
-
output:
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
type:
|
|
5233
|
-
role:
|
|
5234
|
-
id:
|
|
5235
|
-
phase:
|
|
5236
|
-
content:
|
|
5237
|
-
|
|
5238
|
-
type:
|
|
5239
|
-
text:
|
|
5240
|
-
logprobs:
|
|
5241
|
-
|
|
5242
|
-
token:
|
|
5243
|
-
logprob:
|
|
5244
|
-
top_logprobs:
|
|
5245
|
-
|
|
5246
|
-
token:
|
|
5247
|
-
logprob:
|
|
5356
|
+
model: z26.string().optional(),
|
|
5357
|
+
output: z26.array(
|
|
5358
|
+
z26.discriminatedUnion("type", [
|
|
5359
|
+
z26.object({
|
|
5360
|
+
type: z26.literal("message"),
|
|
5361
|
+
role: z26.literal("assistant"),
|
|
5362
|
+
id: z26.string(),
|
|
5363
|
+
phase: z26.enum(["commentary", "final_answer"]).nullish(),
|
|
5364
|
+
content: z26.array(
|
|
5365
|
+
z26.object({
|
|
5366
|
+
type: z26.literal("output_text"),
|
|
5367
|
+
text: z26.string(),
|
|
5368
|
+
logprobs: z26.array(
|
|
5369
|
+
z26.object({
|
|
5370
|
+
token: z26.string(),
|
|
5371
|
+
logprob: z26.number(),
|
|
5372
|
+
top_logprobs: z26.array(
|
|
5373
|
+
z26.object({
|
|
5374
|
+
token: z26.string(),
|
|
5375
|
+
logprob: z26.number()
|
|
5248
5376
|
})
|
|
5249
5377
|
)
|
|
5250
5378
|
})
|
|
5251
5379
|
).nullish(),
|
|
5252
|
-
annotations:
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
type:
|
|
5256
|
-
start_index:
|
|
5257
|
-
end_index:
|
|
5258
|
-
url:
|
|
5259
|
-
title:
|
|
5380
|
+
annotations: z26.array(
|
|
5381
|
+
z26.discriminatedUnion("type", [
|
|
5382
|
+
z26.object({
|
|
5383
|
+
type: z26.literal("url_citation"),
|
|
5384
|
+
start_index: z26.number(),
|
|
5385
|
+
end_index: z26.number(),
|
|
5386
|
+
url: z26.string(),
|
|
5387
|
+
title: z26.string()
|
|
5260
5388
|
}),
|
|
5261
|
-
|
|
5262
|
-
type:
|
|
5263
|
-
file_id:
|
|
5264
|
-
filename:
|
|
5265
|
-
index:
|
|
5389
|
+
z26.object({
|
|
5390
|
+
type: z26.literal("file_citation"),
|
|
5391
|
+
file_id: z26.string(),
|
|
5392
|
+
filename: z26.string(),
|
|
5393
|
+
index: z26.number()
|
|
5266
5394
|
}),
|
|
5267
|
-
|
|
5268
|
-
type:
|
|
5269
|
-
container_id:
|
|
5270
|
-
file_id:
|
|
5271
|
-
filename:
|
|
5272
|
-
start_index:
|
|
5273
|
-
end_index:
|
|
5395
|
+
z26.object({
|
|
5396
|
+
type: z26.literal("container_file_citation"),
|
|
5397
|
+
container_id: z26.string(),
|
|
5398
|
+
file_id: z26.string(),
|
|
5399
|
+
filename: z26.string(),
|
|
5400
|
+
start_index: z26.number(),
|
|
5401
|
+
end_index: z26.number()
|
|
5274
5402
|
}),
|
|
5275
|
-
|
|
5276
|
-
type:
|
|
5277
|
-
file_id:
|
|
5278
|
-
index:
|
|
5403
|
+
z26.object({
|
|
5404
|
+
type: z26.literal("file_path"),
|
|
5405
|
+
file_id: z26.string(),
|
|
5406
|
+
index: z26.number()
|
|
5279
5407
|
})
|
|
5280
5408
|
])
|
|
5281
5409
|
)
|
|
5282
5410
|
})
|
|
5283
5411
|
)
|
|
5284
5412
|
}),
|
|
5285
|
-
|
|
5286
|
-
type:
|
|
5287
|
-
id:
|
|
5288
|
-
status:
|
|
5289
|
-
action:
|
|
5290
|
-
|
|
5291
|
-
type:
|
|
5292
|
-
query:
|
|
5293
|
-
queries:
|
|
5294
|
-
sources:
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
type:
|
|
5299
|
-
name:
|
|
5413
|
+
z26.object({
|
|
5414
|
+
type: z26.literal("web_search_call"),
|
|
5415
|
+
id: z26.string(),
|
|
5416
|
+
status: z26.string(),
|
|
5417
|
+
action: z26.discriminatedUnion("type", [
|
|
5418
|
+
z26.object({
|
|
5419
|
+
type: z26.literal("search"),
|
|
5420
|
+
query: z26.string().nullish(),
|
|
5421
|
+
queries: z26.array(z26.string()).nullish(),
|
|
5422
|
+
sources: z26.array(
|
|
5423
|
+
z26.discriminatedUnion("type", [
|
|
5424
|
+
z26.object({ type: z26.literal("url"), url: z26.string() }),
|
|
5425
|
+
z26.object({
|
|
5426
|
+
type: z26.literal("api"),
|
|
5427
|
+
name: z26.string()
|
|
5300
5428
|
})
|
|
5301
5429
|
])
|
|
5302
5430
|
).nullish()
|
|
5303
5431
|
}),
|
|
5304
|
-
|
|
5305
|
-
type:
|
|
5306
|
-
url:
|
|
5432
|
+
z26.object({
|
|
5433
|
+
type: z26.literal("open_page"),
|
|
5434
|
+
url: z26.string().nullish()
|
|
5307
5435
|
}),
|
|
5308
|
-
|
|
5309
|
-
type:
|
|
5310
|
-
url:
|
|
5311
|
-
pattern:
|
|
5436
|
+
z26.object({
|
|
5437
|
+
type: z26.literal("find_in_page"),
|
|
5438
|
+
url: z26.string().nullish(),
|
|
5439
|
+
pattern: z26.string().nullish()
|
|
5312
5440
|
})
|
|
5313
5441
|
]).nullish()
|
|
5314
5442
|
}),
|
|
5315
|
-
|
|
5316
|
-
type:
|
|
5317
|
-
id:
|
|
5318
|
-
queries:
|
|
5319
|
-
results:
|
|
5320
|
-
|
|
5321
|
-
attributes:
|
|
5322
|
-
|
|
5323
|
-
|
|
5443
|
+
z26.object({
|
|
5444
|
+
type: z26.literal("file_search_call"),
|
|
5445
|
+
id: z26.string(),
|
|
5446
|
+
queries: z26.array(z26.string()),
|
|
5447
|
+
results: z26.array(
|
|
5448
|
+
z26.object({
|
|
5449
|
+
attributes: z26.record(
|
|
5450
|
+
z26.string(),
|
|
5451
|
+
z26.union([z26.string(), z26.number(), z26.boolean()])
|
|
5324
5452
|
),
|
|
5325
|
-
file_id:
|
|
5326
|
-
filename:
|
|
5327
|
-
score:
|
|
5328
|
-
text:
|
|
5453
|
+
file_id: z26.string(),
|
|
5454
|
+
filename: z26.string(),
|
|
5455
|
+
score: z26.number(),
|
|
5456
|
+
text: z26.string()
|
|
5329
5457
|
})
|
|
5330
5458
|
).nullish()
|
|
5331
5459
|
}),
|
|
5332
|
-
|
|
5333
|
-
type:
|
|
5334
|
-
id:
|
|
5335
|
-
code:
|
|
5336
|
-
container_id:
|
|
5337
|
-
outputs:
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5460
|
+
z26.object({
|
|
5461
|
+
type: z26.literal("code_interpreter_call"),
|
|
5462
|
+
id: z26.string(),
|
|
5463
|
+
code: z26.string().nullable(),
|
|
5464
|
+
container_id: z26.string(),
|
|
5465
|
+
outputs: z26.array(
|
|
5466
|
+
z26.discriminatedUnion("type", [
|
|
5467
|
+
z26.object({ type: z26.literal("logs"), logs: z26.string() }),
|
|
5468
|
+
z26.object({ type: z26.literal("image"), url: z26.string() })
|
|
5341
5469
|
])
|
|
5342
5470
|
).nullable()
|
|
5343
5471
|
}),
|
|
5344
|
-
|
|
5345
|
-
type:
|
|
5346
|
-
id:
|
|
5347
|
-
result:
|
|
5472
|
+
z26.object({
|
|
5473
|
+
type: z26.literal("image_generation_call"),
|
|
5474
|
+
id: z26.string(),
|
|
5475
|
+
result: z26.string()
|
|
5348
5476
|
}),
|
|
5349
|
-
|
|
5350
|
-
type:
|
|
5351
|
-
id:
|
|
5352
|
-
call_id:
|
|
5353
|
-
action:
|
|
5354
|
-
type:
|
|
5355
|
-
command:
|
|
5356
|
-
timeout_ms:
|
|
5357
|
-
user:
|
|
5358
|
-
working_directory:
|
|
5359
|
-
env:
|
|
5477
|
+
z26.object({
|
|
5478
|
+
type: z26.literal("local_shell_call"),
|
|
5479
|
+
id: z26.string(),
|
|
5480
|
+
call_id: z26.string(),
|
|
5481
|
+
action: z26.object({
|
|
5482
|
+
type: z26.literal("exec"),
|
|
5483
|
+
command: z26.array(z26.string()),
|
|
5484
|
+
timeout_ms: z26.number().optional(),
|
|
5485
|
+
user: z26.string().optional(),
|
|
5486
|
+
working_directory: z26.string().optional(),
|
|
5487
|
+
env: z26.record(z26.string(), z26.string()).optional()
|
|
5360
5488
|
})
|
|
5361
5489
|
}),
|
|
5362
|
-
|
|
5363
|
-
type:
|
|
5364
|
-
call_id:
|
|
5365
|
-
name:
|
|
5366
|
-
arguments:
|
|
5367
|
-
id:
|
|
5368
|
-
namespace:
|
|
5490
|
+
z26.object({
|
|
5491
|
+
type: z26.literal("function_call"),
|
|
5492
|
+
call_id: z26.string(),
|
|
5493
|
+
name: z26.string(),
|
|
5494
|
+
arguments: z26.string(),
|
|
5495
|
+
id: z26.string(),
|
|
5496
|
+
namespace: z26.string().nullish(),
|
|
5497
|
+
caller: openaiResponsesToolCallerSchema.nullish()
|
|
5369
5498
|
}),
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5499
|
+
openaiResponsesProgramSchema,
|
|
5500
|
+
openaiResponsesProgramOutputSchema,
|
|
5501
|
+
z26.object({
|
|
5502
|
+
type: z26.literal("custom_tool_call"),
|
|
5503
|
+
call_id: z26.string(),
|
|
5504
|
+
name: z26.string(),
|
|
5505
|
+
input: z26.string(),
|
|
5506
|
+
id: z26.string()
|
|
5376
5507
|
}),
|
|
5377
5508
|
openaiResponsesComputerCallSchema,
|
|
5378
|
-
|
|
5379
|
-
type:
|
|
5380
|
-
id:
|
|
5381
|
-
encrypted_content:
|
|
5382
|
-
summary:
|
|
5383
|
-
|
|
5384
|
-
type:
|
|
5385
|
-
text:
|
|
5509
|
+
z26.object({
|
|
5510
|
+
type: z26.literal("reasoning"),
|
|
5511
|
+
id: z26.string(),
|
|
5512
|
+
encrypted_content: z26.string().nullish(),
|
|
5513
|
+
summary: z26.array(
|
|
5514
|
+
z26.object({
|
|
5515
|
+
type: z26.literal("summary_text"),
|
|
5516
|
+
text: z26.string()
|
|
5386
5517
|
})
|
|
5387
5518
|
)
|
|
5388
5519
|
}),
|
|
5389
|
-
|
|
5390
|
-
type:
|
|
5391
|
-
id:
|
|
5392
|
-
status:
|
|
5393
|
-
arguments:
|
|
5394
|
-
name:
|
|
5395
|
-
server_label:
|
|
5396
|
-
output:
|
|
5397
|
-
error:
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
type:
|
|
5401
|
-
code:
|
|
5402
|
-
message:
|
|
5520
|
+
z26.object({
|
|
5521
|
+
type: z26.literal("mcp_call"),
|
|
5522
|
+
id: z26.string(),
|
|
5523
|
+
status: z26.string(),
|
|
5524
|
+
arguments: z26.string(),
|
|
5525
|
+
name: z26.string(),
|
|
5526
|
+
server_label: z26.string(),
|
|
5527
|
+
output: z26.string().nullish(),
|
|
5528
|
+
error: z26.union([
|
|
5529
|
+
z26.string(),
|
|
5530
|
+
z26.object({
|
|
5531
|
+
type: z26.string().optional(),
|
|
5532
|
+
code: z26.union([z26.number(), z26.string()]).optional(),
|
|
5533
|
+
message: z26.string().optional()
|
|
5403
5534
|
}).loose()
|
|
5404
5535
|
]).nullish(),
|
|
5405
|
-
approval_request_id:
|
|
5536
|
+
approval_request_id: z26.string().nullish()
|
|
5406
5537
|
}),
|
|
5407
|
-
|
|
5408
|
-
type:
|
|
5409
|
-
id:
|
|
5410
|
-
server_label:
|
|
5411
|
-
tools:
|
|
5412
|
-
|
|
5413
|
-
name:
|
|
5414
|
-
description:
|
|
5415
|
-
input_schema:
|
|
5416
|
-
annotations:
|
|
5538
|
+
z26.object({
|
|
5539
|
+
type: z26.literal("mcp_list_tools"),
|
|
5540
|
+
id: z26.string(),
|
|
5541
|
+
server_label: z26.string(),
|
|
5542
|
+
tools: z26.array(
|
|
5543
|
+
z26.object({
|
|
5544
|
+
name: z26.string(),
|
|
5545
|
+
description: z26.string().optional(),
|
|
5546
|
+
input_schema: z26.any(),
|
|
5547
|
+
annotations: z26.record(z26.string(), z26.unknown()).optional()
|
|
5417
5548
|
})
|
|
5418
5549
|
),
|
|
5419
|
-
error:
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
type:
|
|
5423
|
-
code:
|
|
5424
|
-
message:
|
|
5550
|
+
error: z26.union([
|
|
5551
|
+
z26.string(),
|
|
5552
|
+
z26.object({
|
|
5553
|
+
type: z26.string().optional(),
|
|
5554
|
+
code: z26.union([z26.number(), z26.string()]).optional(),
|
|
5555
|
+
message: z26.string().optional()
|
|
5425
5556
|
}).loose()
|
|
5426
5557
|
]).optional()
|
|
5427
5558
|
}),
|
|
5428
|
-
|
|
5429
|
-
type:
|
|
5430
|
-
id:
|
|
5431
|
-
server_label:
|
|
5432
|
-
name:
|
|
5433
|
-
arguments:
|
|
5434
|
-
approval_request_id:
|
|
5559
|
+
z26.object({
|
|
5560
|
+
type: z26.literal("mcp_approval_request"),
|
|
5561
|
+
id: z26.string(),
|
|
5562
|
+
server_label: z26.string(),
|
|
5563
|
+
name: z26.string(),
|
|
5564
|
+
arguments: z26.string(),
|
|
5565
|
+
approval_request_id: z26.string().optional()
|
|
5435
5566
|
}),
|
|
5436
|
-
|
|
5437
|
-
type:
|
|
5438
|
-
id:
|
|
5439
|
-
call_id:
|
|
5440
|
-
status:
|
|
5441
|
-
operation:
|
|
5442
|
-
|
|
5443
|
-
type:
|
|
5444
|
-
path:
|
|
5445
|
-
diff:
|
|
5567
|
+
z26.object({
|
|
5568
|
+
type: z26.literal("apply_patch_call"),
|
|
5569
|
+
id: z26.string(),
|
|
5570
|
+
call_id: z26.string(),
|
|
5571
|
+
status: z26.enum(["in_progress", "completed"]),
|
|
5572
|
+
operation: z26.discriminatedUnion("type", [
|
|
5573
|
+
z26.object({
|
|
5574
|
+
type: z26.literal("create_file"),
|
|
5575
|
+
path: z26.string(),
|
|
5576
|
+
diff: z26.string()
|
|
5446
5577
|
}),
|
|
5447
|
-
|
|
5448
|
-
type:
|
|
5449
|
-
path:
|
|
5578
|
+
z26.object({
|
|
5579
|
+
type: z26.literal("delete_file"),
|
|
5580
|
+
path: z26.string()
|
|
5450
5581
|
}),
|
|
5451
|
-
|
|
5452
|
-
type:
|
|
5453
|
-
path:
|
|
5454
|
-
diff:
|
|
5582
|
+
z26.object({
|
|
5583
|
+
type: z26.literal("update_file"),
|
|
5584
|
+
path: z26.string(),
|
|
5585
|
+
diff: z26.string()
|
|
5455
5586
|
})
|
|
5456
5587
|
])
|
|
5457
5588
|
}),
|
|
5458
|
-
|
|
5459
|
-
type:
|
|
5460
|
-
id:
|
|
5461
|
-
call_id:
|
|
5462
|
-
status:
|
|
5463
|
-
action:
|
|
5464
|
-
commands:
|
|
5589
|
+
z26.object({
|
|
5590
|
+
type: z26.literal("shell_call"),
|
|
5591
|
+
id: z26.string(),
|
|
5592
|
+
call_id: z26.string(),
|
|
5593
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5594
|
+
action: z26.object({
|
|
5595
|
+
commands: z26.array(z26.string())
|
|
5465
5596
|
})
|
|
5466
5597
|
}),
|
|
5467
|
-
|
|
5468
|
-
type:
|
|
5469
|
-
id:
|
|
5470
|
-
encrypted_content:
|
|
5598
|
+
z26.object({
|
|
5599
|
+
type: z26.literal("compaction"),
|
|
5600
|
+
id: z26.string(),
|
|
5601
|
+
encrypted_content: z26.string()
|
|
5471
5602
|
}),
|
|
5472
|
-
|
|
5473
|
-
type:
|
|
5474
|
-
id:
|
|
5475
|
-
call_id:
|
|
5476
|
-
status:
|
|
5477
|
-
output:
|
|
5478
|
-
|
|
5479
|
-
stdout:
|
|
5480
|
-
stderr:
|
|
5481
|
-
outcome:
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
type:
|
|
5485
|
-
exit_code:
|
|
5603
|
+
z26.object({
|
|
5604
|
+
type: z26.literal("shell_call_output"),
|
|
5605
|
+
id: z26.string(),
|
|
5606
|
+
call_id: z26.string(),
|
|
5607
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5608
|
+
output: z26.array(
|
|
5609
|
+
z26.object({
|
|
5610
|
+
stdout: z26.string(),
|
|
5611
|
+
stderr: z26.string(),
|
|
5612
|
+
outcome: z26.discriminatedUnion("type", [
|
|
5613
|
+
z26.object({ type: z26.literal("timeout") }),
|
|
5614
|
+
z26.object({
|
|
5615
|
+
type: z26.literal("exit"),
|
|
5616
|
+
exit_code: z26.number()
|
|
5486
5617
|
})
|
|
5487
5618
|
])
|
|
5488
5619
|
})
|
|
5489
5620
|
)
|
|
5490
5621
|
}),
|
|
5491
|
-
|
|
5492
|
-
type:
|
|
5493
|
-
id:
|
|
5494
|
-
execution:
|
|
5495
|
-
call_id:
|
|
5496
|
-
status:
|
|
5497
|
-
arguments:
|
|
5622
|
+
z26.object({
|
|
5623
|
+
type: z26.literal("tool_search_call"),
|
|
5624
|
+
id: z26.string(),
|
|
5625
|
+
execution: z26.enum(["server", "client"]),
|
|
5626
|
+
call_id: z26.string().nullable(),
|
|
5627
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5628
|
+
arguments: z26.unknown()
|
|
5498
5629
|
}),
|
|
5499
|
-
|
|
5500
|
-
type:
|
|
5501
|
-
id:
|
|
5502
|
-
execution:
|
|
5503
|
-
call_id:
|
|
5504
|
-
status:
|
|
5505
|
-
tools:
|
|
5630
|
+
z26.object({
|
|
5631
|
+
type: z26.literal("tool_search_output"),
|
|
5632
|
+
id: z26.string(),
|
|
5633
|
+
execution: z26.enum(["server", "client"]),
|
|
5634
|
+
call_id: z26.string().nullable(),
|
|
5635
|
+
status: z26.enum(["in_progress", "completed", "incomplete"]),
|
|
5636
|
+
tools: z26.array(z26.record(z26.string(), jsonValueSchema2.optional()))
|
|
5506
5637
|
})
|
|
5507
5638
|
])
|
|
5508
5639
|
).optional(),
|
|
5509
|
-
service_tier:
|
|
5510
|
-
reasoning:
|
|
5511
|
-
context:
|
|
5640
|
+
service_tier: z26.string().nullish(),
|
|
5641
|
+
reasoning: z26.object({
|
|
5642
|
+
context: z26.string().nullish()
|
|
5512
5643
|
}).nullish(),
|
|
5513
|
-
incomplete_details:
|
|
5514
|
-
usage:
|
|
5515
|
-
input_tokens:
|
|
5516
|
-
input_tokens_details:
|
|
5517
|
-
cached_tokens:
|
|
5518
|
-
cache_write_tokens:
|
|
5519
|
-
orchestration_input_tokens:
|
|
5520
|
-
orchestration_input_cached_tokens:
|
|
5644
|
+
incomplete_details: z26.object({ reason: z26.string() }).nullish(),
|
|
5645
|
+
usage: z26.object({
|
|
5646
|
+
input_tokens: z26.number(),
|
|
5647
|
+
input_tokens_details: z26.object({
|
|
5648
|
+
cached_tokens: z26.number().nullish(),
|
|
5649
|
+
cache_write_tokens: z26.number().nullish(),
|
|
5650
|
+
orchestration_input_tokens: z26.number().nullish(),
|
|
5651
|
+
orchestration_input_cached_tokens: z26.number().nullish()
|
|
5521
5652
|
}).nullish(),
|
|
5522
|
-
output_tokens:
|
|
5523
|
-
output_tokens_details:
|
|
5524
|
-
reasoning_tokens:
|
|
5525
|
-
orchestration_output_tokens:
|
|
5653
|
+
output_tokens: z26.number(),
|
|
5654
|
+
output_tokens_details: z26.object({
|
|
5655
|
+
reasoning_tokens: z26.number().nullish(),
|
|
5656
|
+
orchestration_output_tokens: z26.number().nullish()
|
|
5526
5657
|
}).nullish()
|
|
5527
5658
|
}).optional()
|
|
5528
5659
|
})
|
|
@@ -5531,10 +5662,10 @@ var openaiResponsesResponseSchema = lazySchema23(
|
|
|
5531
5662
|
|
|
5532
5663
|
// src/responses/openai-responses-language-model-options.ts
|
|
5533
5664
|
import {
|
|
5534
|
-
lazySchema as
|
|
5535
|
-
zodSchema as
|
|
5665
|
+
lazySchema as lazySchema25,
|
|
5666
|
+
zodSchema as zodSchema25
|
|
5536
5667
|
} from "@ai-sdk/provider-utils";
|
|
5537
|
-
import { z as
|
|
5668
|
+
import { z as z27 } from "zod/v4";
|
|
5538
5669
|
var TOP_LOGPROBS_MAX = 20;
|
|
5539
5670
|
var openaiResponsesReasoningModelIds = [
|
|
5540
5671
|
"o1",
|
|
@@ -5605,9 +5736,9 @@ var openaiResponsesModelIds = [
|
|
|
5605
5736
|
"gpt-5-chat-latest",
|
|
5606
5737
|
...openaiResponsesReasoningModelIds
|
|
5607
5738
|
];
|
|
5608
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
5609
|
-
() =>
|
|
5610
|
-
|
|
5739
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema25(
|
|
5740
|
+
() => zodSchema25(
|
|
5741
|
+
z27.object({
|
|
5611
5742
|
/**
|
|
5612
5743
|
* The ID of the OpenAI Conversation to continue.
|
|
5613
5744
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -5615,13 +5746,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
|
|
|
5615
5746
|
* Defaults to `undefined`.
|
|
5616
5747
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
5617
5748
|
*/
|
|
5618
|
-
conversation:
|
|
5749
|
+
conversation: z27.string().nullish(),
|
|
5619
5750
|
/**
|
|
5620
5751
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
5621
5752
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
|
|
5622
5753
|
*/
|
|
5623
|
-
include:
|
|
5624
|
-
|
|
5754
|
+
include: z27.array(
|
|
5755
|
+
z27.enum([
|
|
5625
5756
|
"reasoning.encrypted_content",
|
|
5626
5757
|
// handled internally by default, only needed for unknown reasoning models
|
|
5627
5758
|
"file_search_call.results",
|
|
@@ -5634,7 +5765,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
|
|
|
5634
5765
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
5635
5766
|
* Defaults to `undefined`.
|
|
5636
5767
|
*/
|
|
5637
|
-
instructions:
|
|
5768
|
+
instructions: z27.string().nullish(),
|
|
5638
5769
|
/**
|
|
5639
5770
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
5640
5771
|
* the response size and can slow down response times. However, it can
|
|
@@ -5649,38 +5780,38 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
|
|
|
5649
5780
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
5650
5781
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
5651
5782
|
*/
|
|
5652
|
-
logprobs:
|
|
5783
|
+
logprobs: z27.union([z27.boolean(), z27.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
5653
5784
|
/**
|
|
5654
5785
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
5655
5786
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
5656
5787
|
* Any further attempts to call a tool by the model will be ignored.
|
|
5657
5788
|
*/
|
|
5658
|
-
maxToolCalls:
|
|
5789
|
+
maxToolCalls: z27.number().nullish(),
|
|
5659
5790
|
/**
|
|
5660
5791
|
* Additional metadata to store with the generation.
|
|
5661
5792
|
*/
|
|
5662
|
-
metadata:
|
|
5793
|
+
metadata: z27.any().nullish(),
|
|
5663
5794
|
/**
|
|
5664
5795
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
5665
5796
|
*/
|
|
5666
|
-
parallelToolCalls:
|
|
5797
|
+
parallelToolCalls: z27.boolean().nullish(),
|
|
5667
5798
|
/**
|
|
5668
5799
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
5669
5800
|
* Defaults to `undefined`.
|
|
5670
5801
|
*/
|
|
5671
|
-
previousResponseId:
|
|
5802
|
+
previousResponseId: z27.string().nullish(),
|
|
5672
5803
|
/**
|
|
5673
5804
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
5674
5805
|
*/
|
|
5675
|
-
promptCacheKey:
|
|
5806
|
+
promptCacheKey: z27.string().nullish(),
|
|
5676
5807
|
/**
|
|
5677
5808
|
* Prompt cache behavior for GPT-5.6 and later models.
|
|
5678
5809
|
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
5679
5810
|
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
5680
5811
|
*/
|
|
5681
|
-
promptCacheOptions:
|
|
5682
|
-
mode:
|
|
5683
|
-
ttl:
|
|
5812
|
+
promptCacheOptions: z27.object({
|
|
5813
|
+
mode: z27.enum(["implicit", "explicit"]).optional(),
|
|
5814
|
+
ttl: z27.literal("30m").optional()
|
|
5684
5815
|
}).optional(),
|
|
5685
5816
|
/**
|
|
5686
5817
|
* The retention policy for the prompt cache.
|
|
@@ -5692,35 +5823,35 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
|
|
|
5692
5823
|
*
|
|
5693
5824
|
* @default 'in_memory'
|
|
5694
5825
|
*/
|
|
5695
|
-
promptCacheRetention:
|
|
5826
|
+
promptCacheRetention: z27.enum(["in_memory", "24h"]).nullish(),
|
|
5696
5827
|
/**
|
|
5697
5828
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
5698
5829
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
5699
5830
|
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
5700
5831
|
* Supported values vary by model.
|
|
5701
5832
|
*/
|
|
5702
|
-
reasoningEffort:
|
|
5833
|
+
reasoningEffort: z27.string().nullish(),
|
|
5703
5834
|
/**
|
|
5704
5835
|
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
5705
5836
|
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
5706
5837
|
*/
|
|
5707
|
-
reasoningMode:
|
|
5838
|
+
reasoningMode: z27.enum(["standard", "pro"]).optional(),
|
|
5708
5839
|
/**
|
|
5709
5840
|
* Controls which available reasoning items GPT-5.6 can use.
|
|
5710
5841
|
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
5711
5842
|
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
5712
5843
|
*/
|
|
5713
|
-
reasoningContext:
|
|
5844
|
+
reasoningContext: z27.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
5714
5845
|
/**
|
|
5715
5846
|
* Controls reasoning summary output from the model.
|
|
5716
5847
|
* Set to "auto" to automatically receive the richest level available,
|
|
5717
5848
|
* or "detailed" for comprehensive summaries.
|
|
5718
5849
|
*/
|
|
5719
|
-
reasoningSummary:
|
|
5850
|
+
reasoningSummary: z27.string().nullish(),
|
|
5720
5851
|
/**
|
|
5721
5852
|
* The identifier for safety monitoring and tracking.
|
|
5722
5853
|
*/
|
|
5723
|
-
safetyIdentifier:
|
|
5854
|
+
safetyIdentifier: z27.string().nullish(),
|
|
5724
5855
|
/**
|
|
5725
5856
|
* Service tier for the request.
|
|
5726
5857
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -5728,11 +5859,11 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
|
|
|
5728
5859
|
*
|
|
5729
5860
|
* Defaults to 'auto'.
|
|
5730
5861
|
*/
|
|
5731
|
-
serviceTier:
|
|
5862
|
+
serviceTier: z27.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
5732
5863
|
/**
|
|
5733
5864
|
* Whether to store the generation. Defaults to `true`.
|
|
5734
5865
|
*/
|
|
5735
|
-
store:
|
|
5866
|
+
store: z27.boolean().nullish(),
|
|
5736
5867
|
/**
|
|
5737
5868
|
* Whether to pass through non-image file types as generic input files.
|
|
5738
5869
|
*
|
|
@@ -5740,30 +5871,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
|
|
|
5740
5871
|
* Enable this when the target OpenAI Responses model supports additional
|
|
5741
5872
|
* file media types, such as text/csv.
|
|
5742
5873
|
*/
|
|
5743
|
-
passThroughUnsupportedFiles:
|
|
5874
|
+
passThroughUnsupportedFiles: z27.boolean().optional(),
|
|
5744
5875
|
/**
|
|
5745
5876
|
* Whether to use strict JSON schema validation.
|
|
5746
5877
|
* Defaults to `true`.
|
|
5747
5878
|
*/
|
|
5748
|
-
strictJsonSchema:
|
|
5879
|
+
strictJsonSchema: z27.boolean().nullish(),
|
|
5749
5880
|
/**
|
|
5750
5881
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
5751
5882
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
5752
5883
|
* Valid values: 'low', 'medium', 'high'.
|
|
5753
5884
|
*/
|
|
5754
|
-
textVerbosity:
|
|
5885
|
+
textVerbosity: z27.enum(["low", "medium", "high"]).nullish(),
|
|
5755
5886
|
/**
|
|
5756
5887
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
5757
5888
|
* 'disabled' turns truncation off.
|
|
5758
5889
|
*/
|
|
5759
|
-
truncation:
|
|
5890
|
+
truncation: z27.enum(["auto", "disabled"]).nullish(),
|
|
5760
5891
|
/**
|
|
5761
5892
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
5762
5893
|
* monitor and detect abuse.
|
|
5763
5894
|
* Defaults to `undefined`.
|
|
5764
5895
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
5765
5896
|
*/
|
|
5766
|
-
user:
|
|
5897
|
+
user: z27.string().nullish(),
|
|
5767
5898
|
/**
|
|
5768
5899
|
* Override the system message mode for this model.
|
|
5769
5900
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -5772,7 +5903,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
|
|
|
5772
5903
|
*
|
|
5773
5904
|
* If not specified, the mode is automatically determined based on the model.
|
|
5774
5905
|
*/
|
|
5775
|
-
systemMessageMode:
|
|
5906
|
+
systemMessageMode: z27.enum(["system", "developer", "remove"]).optional(),
|
|
5776
5907
|
/**
|
|
5777
5908
|
* Force treating this model as a reasoning model.
|
|
5778
5909
|
*
|
|
@@ -5782,14 +5913,14 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
|
|
|
5782
5913
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
5783
5914
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
5784
5915
|
*/
|
|
5785
|
-
forceReasoning:
|
|
5916
|
+
forceReasoning: z27.boolean().optional(),
|
|
5786
5917
|
/**
|
|
5787
5918
|
* Enable server-side context management (compaction).
|
|
5788
5919
|
*/
|
|
5789
|
-
contextManagement:
|
|
5790
|
-
|
|
5791
|
-
type:
|
|
5792
|
-
compactThreshold:
|
|
5920
|
+
contextManagement: z27.array(
|
|
5921
|
+
z27.object({
|
|
5922
|
+
type: z27.literal("compaction"),
|
|
5923
|
+
compactThreshold: z27.number()
|
|
5793
5924
|
})
|
|
5794
5925
|
).nullish(),
|
|
5795
5926
|
/**
|
|
@@ -5802,9 +5933,9 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
|
|
|
5802
5933
|
*
|
|
5803
5934
|
* @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
|
|
5804
5935
|
*/
|
|
5805
|
-
allowedTools:
|
|
5806
|
-
toolNames:
|
|
5807
|
-
mode:
|
|
5936
|
+
allowedTools: z27.object({
|
|
5937
|
+
toolNames: z27.array(z27.string()).min(1),
|
|
5938
|
+
mode: z27.enum(["auto", "required"]).optional()
|
|
5808
5939
|
}).optional()
|
|
5809
5940
|
})
|
|
5810
5941
|
)
|
|
@@ -6015,6 +6146,12 @@ async function prepareResponsesTools({
|
|
|
6015
6146
|
resolvedCustomProviderToolNames.add(tool.name);
|
|
6016
6147
|
break;
|
|
6017
6148
|
}
|
|
6149
|
+
case "openai.programmatic_tool_calling": {
|
|
6150
|
+
openaiTools2.push({
|
|
6151
|
+
type: "programmatic_tool_calling"
|
|
6152
|
+
});
|
|
6153
|
+
break;
|
|
6154
|
+
}
|
|
6018
6155
|
case "openai.tool_search": {
|
|
6019
6156
|
const args = await validateTypes2({
|
|
6020
6157
|
value: tool.args,
|
|
@@ -6069,7 +6206,7 @@ async function prepareResponsesTools({
|
|
|
6069
6206
|
const resolvedToolName = (_c = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _c : toolChoice.toolName;
|
|
6070
6207
|
return {
|
|
6071
6208
|
tools: openaiTools2,
|
|
6072
|
-
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 },
|
|
6209
|
+
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 },
|
|
6073
6210
|
toolWarnings
|
|
6074
6211
|
};
|
|
6075
6212
|
}
|
|
@@ -6092,7 +6229,9 @@ function prepareFunctionTool({
|
|
|
6092
6229
|
description: tool.description,
|
|
6093
6230
|
parameters: tool.inputSchema,
|
|
6094
6231
|
...tool.strict != null ? { strict: tool.strict } : {},
|
|
6095
|
-
...deferLoading != null ? { defer_loading: deferLoading } : {}
|
|
6232
|
+
...deferLoading != null ? { defer_loading: deferLoading } : {},
|
|
6233
|
+
...(options == null ? void 0 : options.allowedCallers) != null ? { allowed_callers: options.allowedCallers } : {},
|
|
6234
|
+
...(options == null ? void 0 : options.outputSchema) != null ? { output_schema: options.outputSchema } : {}
|
|
6096
6235
|
};
|
|
6097
6236
|
}
|
|
6098
6237
|
function mapShellEnvironment(environment) {
|
|
@@ -6324,7 +6463,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6324
6463
|
"openai.web_search_preview": "web_search_preview",
|
|
6325
6464
|
"openai.mcp": "mcp",
|
|
6326
6465
|
"openai.apply_patch": "apply_patch",
|
|
6327
|
-
"openai.tool_search": "tool_search"
|
|
6466
|
+
"openai.tool_search": "tool_search",
|
|
6467
|
+
"openai.programmatic_tool_calling": "programmatic_tool_calling"
|
|
6328
6468
|
}
|
|
6329
6469
|
});
|
|
6330
6470
|
const customProviderToolNames = /* @__PURE__ */ new Set();
|
|
@@ -6811,7 +6951,52 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6811
6951
|
providerMetadata: {
|
|
6812
6952
|
[providerOptionsName]: {
|
|
6813
6953
|
itemId: part.id,
|
|
6814
|
-
...part.namespace != null && { namespace: part.namespace }
|
|
6954
|
+
...part.namespace != null && { namespace: part.namespace },
|
|
6955
|
+
...part.caller != null && {
|
|
6956
|
+
caller: part.caller.type === "program" ? {
|
|
6957
|
+
type: "program",
|
|
6958
|
+
callerId: part.caller.caller_id
|
|
6959
|
+
} : part.caller
|
|
6960
|
+
}
|
|
6961
|
+
}
|
|
6962
|
+
}
|
|
6963
|
+
});
|
|
6964
|
+
break;
|
|
6965
|
+
}
|
|
6966
|
+
case "program": {
|
|
6967
|
+
content.push({
|
|
6968
|
+
type: "tool-call",
|
|
6969
|
+
toolCallId: part.call_id,
|
|
6970
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
6971
|
+
"programmatic_tool_calling"
|
|
6972
|
+
),
|
|
6973
|
+
input: JSON.stringify({
|
|
6974
|
+
code: part.code,
|
|
6975
|
+
fingerprint: part.fingerprint
|
|
6976
|
+
}),
|
|
6977
|
+
providerExecuted: true,
|
|
6978
|
+
providerMetadata: {
|
|
6979
|
+
[providerOptionsName]: {
|
|
6980
|
+
itemId: part.id
|
|
6981
|
+
}
|
|
6982
|
+
}
|
|
6983
|
+
});
|
|
6984
|
+
break;
|
|
6985
|
+
}
|
|
6986
|
+
case "program_output": {
|
|
6987
|
+
content.push({
|
|
6988
|
+
type: "tool-result",
|
|
6989
|
+
toolCallId: part.call_id,
|
|
6990
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
6991
|
+
"programmatic_tool_calling"
|
|
6992
|
+
),
|
|
6993
|
+
result: {
|
|
6994
|
+
result: part.result,
|
|
6995
|
+
status: part.status
|
|
6996
|
+
},
|
|
6997
|
+
providerMetadata: {
|
|
6998
|
+
[providerOptionsName]: {
|
|
6999
|
+
itemId: part.id
|
|
6815
7000
|
}
|
|
6816
7001
|
}
|
|
6817
7002
|
});
|
|
@@ -7363,10 +7548,51 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7363
7548
|
itemId: value.item.id,
|
|
7364
7549
|
...value.item.namespace != null && {
|
|
7365
7550
|
namespace: value.item.namespace
|
|
7551
|
+
},
|
|
7552
|
+
...value.item.caller != null && {
|
|
7553
|
+
caller: value.item.caller.type === "program" ? {
|
|
7554
|
+
type: "program",
|
|
7555
|
+
callerId: value.item.caller.caller_id
|
|
7556
|
+
} : value.item.caller
|
|
7366
7557
|
}
|
|
7367
7558
|
}
|
|
7368
7559
|
}
|
|
7369
7560
|
});
|
|
7561
|
+
} else if (value.item.type === "program") {
|
|
7562
|
+
controller.enqueue({
|
|
7563
|
+
type: "tool-call",
|
|
7564
|
+
toolCallId: value.item.call_id,
|
|
7565
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
7566
|
+
"programmatic_tool_calling"
|
|
7567
|
+
),
|
|
7568
|
+
input: JSON.stringify({
|
|
7569
|
+
code: value.item.code,
|
|
7570
|
+
fingerprint: value.item.fingerprint
|
|
7571
|
+
}),
|
|
7572
|
+
providerExecuted: true,
|
|
7573
|
+
providerMetadata: {
|
|
7574
|
+
[providerOptionsName]: {
|
|
7575
|
+
itemId: value.item.id
|
|
7576
|
+
}
|
|
7577
|
+
}
|
|
7578
|
+
});
|
|
7579
|
+
} else if (value.item.type === "program_output") {
|
|
7580
|
+
controller.enqueue({
|
|
7581
|
+
type: "tool-result",
|
|
7582
|
+
toolCallId: value.item.call_id,
|
|
7583
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
7584
|
+
"programmatic_tool_calling"
|
|
7585
|
+
),
|
|
7586
|
+
result: {
|
|
7587
|
+
result: value.item.result,
|
|
7588
|
+
status: value.item.status
|
|
7589
|
+
},
|
|
7590
|
+
providerMetadata: {
|
|
7591
|
+
[providerOptionsName]: {
|
|
7592
|
+
itemId: value.item.id
|
|
7593
|
+
}
|
|
7594
|
+
}
|
|
7595
|
+
});
|
|
7370
7596
|
} else if (value.item.type === "custom_tool_call") {
|
|
7371
7597
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7372
7598
|
hasFunctionCall = true;
|
|
@@ -8132,15 +8358,15 @@ import {
|
|
|
8132
8358
|
|
|
8133
8359
|
// src/speech/openai-speech-model-options.ts
|
|
8134
8360
|
import {
|
|
8135
|
-
lazySchema as
|
|
8136
|
-
zodSchema as
|
|
8361
|
+
lazySchema as lazySchema26,
|
|
8362
|
+
zodSchema as zodSchema26
|
|
8137
8363
|
} from "@ai-sdk/provider-utils";
|
|
8138
|
-
import { z as
|
|
8139
|
-
var openaiSpeechModelOptionsSchema =
|
|
8140
|
-
() =>
|
|
8141
|
-
|
|
8142
|
-
instructions:
|
|
8143
|
-
speed:
|
|
8364
|
+
import { z as z28 } from "zod/v4";
|
|
8365
|
+
var openaiSpeechModelOptionsSchema = lazySchema26(
|
|
8366
|
+
() => zodSchema26(
|
|
8367
|
+
z28.object({
|
|
8368
|
+
instructions: z28.string().nullish(),
|
|
8369
|
+
speed: z28.number().min(0.25).max(4).default(1).nullish()
|
|
8144
8370
|
})
|
|
8145
8371
|
)
|
|
8146
8372
|
);
|
|
@@ -8277,33 +8503,33 @@ import {
|
|
|
8277
8503
|
} from "@ai-sdk/provider-utils";
|
|
8278
8504
|
|
|
8279
8505
|
// src/transcription/openai-transcription-api.ts
|
|
8280
|
-
import { lazySchema as
|
|
8281
|
-
import { z as
|
|
8282
|
-
var openaiTranscriptionResponseSchema =
|
|
8283
|
-
() =>
|
|
8284
|
-
|
|
8285
|
-
text:
|
|
8286
|
-
language:
|
|
8287
|
-
duration:
|
|
8288
|
-
words:
|
|
8289
|
-
|
|
8290
|
-
word:
|
|
8291
|
-
start:
|
|
8292
|
-
end:
|
|
8506
|
+
import { lazySchema as lazySchema27, zodSchema as zodSchema27 } from "@ai-sdk/provider-utils";
|
|
8507
|
+
import { z as z29 } from "zod/v4";
|
|
8508
|
+
var openaiTranscriptionResponseSchema = lazySchema27(
|
|
8509
|
+
() => zodSchema27(
|
|
8510
|
+
z29.object({
|
|
8511
|
+
text: z29.string(),
|
|
8512
|
+
language: z29.string().nullish(),
|
|
8513
|
+
duration: z29.number().nullish(),
|
|
8514
|
+
words: z29.array(
|
|
8515
|
+
z29.object({
|
|
8516
|
+
word: z29.string(),
|
|
8517
|
+
start: z29.number(),
|
|
8518
|
+
end: z29.number()
|
|
8293
8519
|
})
|
|
8294
8520
|
).nullish(),
|
|
8295
|
-
segments:
|
|
8296
|
-
|
|
8297
|
-
id:
|
|
8298
|
-
seek:
|
|
8299
|
-
start:
|
|
8300
|
-
end:
|
|
8301
|
-
text:
|
|
8302
|
-
tokens:
|
|
8303
|
-
temperature:
|
|
8304
|
-
avg_logprob:
|
|
8305
|
-
compression_ratio:
|
|
8306
|
-
no_speech_prob:
|
|
8521
|
+
segments: z29.array(
|
|
8522
|
+
z29.object({
|
|
8523
|
+
id: z29.number(),
|
|
8524
|
+
seek: z29.number(),
|
|
8525
|
+
start: z29.number(),
|
|
8526
|
+
end: z29.number(),
|
|
8527
|
+
text: z29.string(),
|
|
8528
|
+
tokens: z29.array(z29.number()),
|
|
8529
|
+
temperature: z29.number(),
|
|
8530
|
+
avg_logprob: z29.number(),
|
|
8531
|
+
compression_ratio: z29.number(),
|
|
8532
|
+
no_speech_prob: z29.number()
|
|
8307
8533
|
})
|
|
8308
8534
|
).nullish()
|
|
8309
8535
|
})
|
|
@@ -8312,47 +8538,47 @@ var openaiTranscriptionResponseSchema = lazySchema26(
|
|
|
8312
8538
|
|
|
8313
8539
|
// src/transcription/openai-transcription-model-options.ts
|
|
8314
8540
|
import {
|
|
8315
|
-
lazySchema as
|
|
8316
|
-
zodSchema as
|
|
8541
|
+
lazySchema as lazySchema28,
|
|
8542
|
+
zodSchema as zodSchema28
|
|
8317
8543
|
} from "@ai-sdk/provider-utils";
|
|
8318
|
-
import { z as
|
|
8319
|
-
var openAITranscriptionModelOptions =
|
|
8320
|
-
() =>
|
|
8321
|
-
|
|
8544
|
+
import { z as z30 } from "zod/v4";
|
|
8545
|
+
var openAITranscriptionModelOptions = lazySchema28(
|
|
8546
|
+
() => zodSchema28(
|
|
8547
|
+
z30.object({
|
|
8322
8548
|
/**
|
|
8323
8549
|
* Additional information to include in the transcription response.
|
|
8324
8550
|
*/
|
|
8325
|
-
include:
|
|
8551
|
+
include: z30.array(z30.string()).optional(),
|
|
8326
8552
|
/**
|
|
8327
8553
|
* The language of the input audio in ISO-639-1 format.
|
|
8328
8554
|
*/
|
|
8329
|
-
language:
|
|
8555
|
+
language: z30.string().optional(),
|
|
8330
8556
|
/**
|
|
8331
8557
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
8332
8558
|
*/
|
|
8333
|
-
prompt:
|
|
8559
|
+
prompt: z30.string().optional(),
|
|
8334
8560
|
/**
|
|
8335
8561
|
* The sampling temperature, between 0 and 1.
|
|
8336
8562
|
* @default 0
|
|
8337
8563
|
*/
|
|
8338
|
-
temperature:
|
|
8564
|
+
temperature: z30.number().min(0).max(1).default(0).optional(),
|
|
8339
8565
|
/**
|
|
8340
8566
|
* The timestamp granularities to populate for this transcription.
|
|
8341
8567
|
* @default ['segment']
|
|
8342
8568
|
*/
|
|
8343
|
-
timestampGranularities:
|
|
8569
|
+
timestampGranularities: z30.array(z30.enum(["word", "segment"])).default(["segment"]).optional(),
|
|
8344
8570
|
/**
|
|
8345
8571
|
* Options for streaming transcription models such as `gpt-realtime-whisper`.
|
|
8346
8572
|
*/
|
|
8347
|
-
streaming:
|
|
8573
|
+
streaming: z30.object({
|
|
8348
8574
|
/**
|
|
8349
8575
|
* Latency/accuracy tradeoff for realtime transcription.
|
|
8350
8576
|
*/
|
|
8351
|
-
delay:
|
|
8577
|
+
delay: z30.enum(["minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
8352
8578
|
/**
|
|
8353
8579
|
* Additional fields to include in realtime transcription events.
|
|
8354
8580
|
*/
|
|
8355
|
-
include:
|
|
8581
|
+
include: z30.array(z30.string()).optional()
|
|
8356
8582
|
}).optional()
|
|
8357
8583
|
})
|
|
8358
8584
|
)
|
|
@@ -8797,28 +9023,28 @@ import {
|
|
|
8797
9023
|
} from "@ai-sdk/provider-utils";
|
|
8798
9024
|
|
|
8799
9025
|
// src/skills/openai-skills-api.ts
|
|
8800
|
-
import { lazySchema as
|
|
8801
|
-
import { z as
|
|
8802
|
-
var openaiSkillResponseSchema =
|
|
8803
|
-
() =>
|
|
8804
|
-
|
|
8805
|
-
id:
|
|
8806
|
-
name:
|
|
8807
|
-
description:
|
|
8808
|
-
default_version:
|
|
8809
|
-
latest_version:
|
|
8810
|
-
created_at:
|
|
8811
|
-
updated_at:
|
|
9026
|
+
import { lazySchema as lazySchema29, zodSchema as zodSchema29 } from "@ai-sdk/provider-utils";
|
|
9027
|
+
import { z as z31 } from "zod/v4";
|
|
9028
|
+
var openaiSkillResponseSchema = lazySchema29(
|
|
9029
|
+
() => zodSchema29(
|
|
9030
|
+
z31.object({
|
|
9031
|
+
id: z31.string(),
|
|
9032
|
+
name: z31.string().nullish(),
|
|
9033
|
+
description: z31.string().nullish(),
|
|
9034
|
+
default_version: z31.string().nullish(),
|
|
9035
|
+
latest_version: z31.string().nullish(),
|
|
9036
|
+
created_at: z31.number(),
|
|
9037
|
+
updated_at: z31.number().nullish()
|
|
8812
9038
|
})
|
|
8813
9039
|
)
|
|
8814
9040
|
);
|
|
8815
|
-
var openaiSkillVersionResponseSchema =
|
|
8816
|
-
() =>
|
|
8817
|
-
|
|
8818
|
-
id:
|
|
8819
|
-
version:
|
|
8820
|
-
name:
|
|
8821
|
-
description:
|
|
9041
|
+
var openaiSkillVersionResponseSchema = lazySchema29(
|
|
9042
|
+
() => zodSchema29(
|
|
9043
|
+
z31.object({
|
|
9044
|
+
id: z31.string(),
|
|
9045
|
+
version: z31.string().nullish(),
|
|
9046
|
+
name: z31.string().nullish(),
|
|
9047
|
+
description: z31.string().nullish()
|
|
8822
9048
|
})
|
|
8823
9049
|
)
|
|
8824
9050
|
);
|
|
@@ -8873,7 +9099,7 @@ var OpenAISkills = class {
|
|
|
8873
9099
|
};
|
|
8874
9100
|
|
|
8875
9101
|
// src/version.ts
|
|
8876
|
-
var VERSION = true ? "4.0.
|
|
9102
|
+
var VERSION = true ? "4.0.20" : "0.0.0-test";
|
|
8877
9103
|
|
|
8878
9104
|
// src/openai-provider.ts
|
|
8879
9105
|
function createOpenAI(options = {}) {
|