@ai-sdk/openai 4.0.14 → 4.0.16
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 +17 -0
- package/dist/index.d.ts +285 -24
- package/dist/index.js +1525 -1169
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +184 -8
- package/dist/internal/index.js +1467 -1121
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +93 -4
- package/package.json +2 -2
- package/src/index.ts +4 -0
- package/src/openai-tools.ts +11 -0
- package/src/responses/convert-to-openai-responses-input.ts +83 -1
- package/src/responses/openai-responses-api.ts +96 -19
- package/src/responses/openai-responses-language-model.ts +179 -33
- package/src/responses/openai-responses-prepare-tools.ts +9 -1
- package/src/tool/computer.ts +147 -0
package/dist/internal/index.js
CHANGED
|
@@ -3052,7 +3052,7 @@ import {
|
|
|
3052
3052
|
resolveProviderReference as resolveProviderReference2,
|
|
3053
3053
|
validateTypes
|
|
3054
3054
|
} from "@ai-sdk/provider-utils";
|
|
3055
|
-
import { z as
|
|
3055
|
+
import { z as z18 } from "zod/v4";
|
|
3056
3056
|
|
|
3057
3057
|
// src/tool/apply-patch.ts
|
|
3058
3058
|
import {
|
|
@@ -3100,124 +3100,220 @@ var applyPatchToolFactory = createProviderDefinedToolFactoryWithOutputSchema({
|
|
|
3100
3100
|
});
|
|
3101
3101
|
var applyPatch = applyPatchToolFactory;
|
|
3102
3102
|
|
|
3103
|
-
// src/tool/
|
|
3103
|
+
// src/tool/computer.ts
|
|
3104
3104
|
import {
|
|
3105
3105
|
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
|
|
3106
3106
|
lazySchema as lazySchema13,
|
|
3107
3107
|
zodSchema as zodSchema13
|
|
3108
3108
|
} from "@ai-sdk/provider-utils";
|
|
3109
3109
|
import { z as z14 } from "zod/v4";
|
|
3110
|
-
var
|
|
3110
|
+
var safetyCheckSchema = z14.object({
|
|
3111
|
+
id: z14.string(),
|
|
3112
|
+
code: z14.string().optional(),
|
|
3113
|
+
message: z14.string().optional()
|
|
3114
|
+
});
|
|
3115
|
+
var computerActionSchema = z14.discriminatedUnion("type", [
|
|
3116
|
+
z14.object({
|
|
3117
|
+
type: z14.literal("click"),
|
|
3118
|
+
button: z14.enum(["left", "right", "wheel", "back", "forward"]),
|
|
3119
|
+
x: z14.number(),
|
|
3120
|
+
y: z14.number(),
|
|
3121
|
+
keys: z14.array(z14.string()).optional()
|
|
3122
|
+
}),
|
|
3123
|
+
z14.object({
|
|
3124
|
+
type: z14.literal("double_click"),
|
|
3125
|
+
x: z14.number(),
|
|
3126
|
+
y: z14.number(),
|
|
3127
|
+
keys: z14.array(z14.string()).optional()
|
|
3128
|
+
}),
|
|
3129
|
+
z14.object({
|
|
3130
|
+
type: z14.literal("drag"),
|
|
3131
|
+
path: z14.array(z14.object({ x: z14.number(), y: z14.number() })),
|
|
3132
|
+
keys: z14.array(z14.string()).optional()
|
|
3133
|
+
}),
|
|
3134
|
+
z14.object({
|
|
3135
|
+
type: z14.literal("keypress"),
|
|
3136
|
+
keys: z14.array(z14.string())
|
|
3137
|
+
}),
|
|
3138
|
+
z14.object({
|
|
3139
|
+
type: z14.literal("move"),
|
|
3140
|
+
x: z14.number(),
|
|
3141
|
+
y: z14.number(),
|
|
3142
|
+
keys: z14.array(z14.string()).optional()
|
|
3143
|
+
}),
|
|
3144
|
+
z14.object({
|
|
3145
|
+
type: z14.literal("screenshot")
|
|
3146
|
+
}),
|
|
3147
|
+
z14.object({
|
|
3148
|
+
type: z14.literal("scroll"),
|
|
3149
|
+
x: z14.number(),
|
|
3150
|
+
y: z14.number(),
|
|
3151
|
+
scrollX: z14.number(),
|
|
3152
|
+
scrollY: z14.number(),
|
|
3153
|
+
keys: z14.array(z14.string()).optional()
|
|
3154
|
+
}),
|
|
3155
|
+
z14.object({
|
|
3156
|
+
type: z14.literal("type"),
|
|
3157
|
+
text: z14.string()
|
|
3158
|
+
}),
|
|
3159
|
+
z14.object({
|
|
3160
|
+
type: z14.literal("wait")
|
|
3161
|
+
})
|
|
3162
|
+
]);
|
|
3163
|
+
var computerInputSchema = lazySchema13(
|
|
3111
3164
|
() => zodSchema13(
|
|
3112
3165
|
z14.object({
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
timeoutMs: z14.number().optional(),
|
|
3117
|
-
user: z14.string().optional(),
|
|
3118
|
-
workingDirectory: z14.string().optional(),
|
|
3119
|
-
env: z14.record(z14.string(), z14.string()).optional()
|
|
3120
|
-
})
|
|
3166
|
+
actions: z14.array(computerActionSchema),
|
|
3167
|
+
pendingSafetyChecks: z14.array(safetyCheckSchema),
|
|
3168
|
+
status: z14.enum(["in_progress", "completed", "incomplete"])
|
|
3121
3169
|
})
|
|
3122
3170
|
)
|
|
3123
3171
|
);
|
|
3124
|
-
var
|
|
3125
|
-
() => zodSchema13(
|
|
3172
|
+
var computerOutputSchema = lazySchema13(
|
|
3173
|
+
() => zodSchema13(
|
|
3174
|
+
z14.object({
|
|
3175
|
+
output: z14.union([
|
|
3176
|
+
z14.object({
|
|
3177
|
+
type: z14.literal("computer_screenshot"),
|
|
3178
|
+
imageUrl: z14.string(),
|
|
3179
|
+
fileId: z14.string().optional(),
|
|
3180
|
+
detail: z14.enum(["auto", "low", "high", "original"]).optional()
|
|
3181
|
+
}),
|
|
3182
|
+
z14.object({
|
|
3183
|
+
type: z14.literal("computer_screenshot"),
|
|
3184
|
+
fileId: z14.string(),
|
|
3185
|
+
imageUrl: z14.string().optional(),
|
|
3186
|
+
detail: z14.enum(["auto", "low", "high", "original"]).optional()
|
|
3187
|
+
})
|
|
3188
|
+
]),
|
|
3189
|
+
acknowledgedSafetyChecks: z14.array(safetyCheckSchema).optional()
|
|
3190
|
+
})
|
|
3191
|
+
)
|
|
3126
3192
|
);
|
|
3127
|
-
var
|
|
3128
|
-
id: "openai.
|
|
3129
|
-
inputSchema:
|
|
3130
|
-
outputSchema:
|
|
3193
|
+
var computerToolFactory = createProviderDefinedToolFactoryWithOutputSchema2({
|
|
3194
|
+
id: "openai.computer",
|
|
3195
|
+
inputSchema: computerInputSchema,
|
|
3196
|
+
outputSchema: computerOutputSchema
|
|
3131
3197
|
});
|
|
3132
3198
|
|
|
3133
|
-
// src/tool/shell.ts
|
|
3199
|
+
// src/tool/local-shell.ts
|
|
3134
3200
|
import {
|
|
3135
3201
|
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
|
|
3136
3202
|
lazySchema as lazySchema14,
|
|
3137
3203
|
zodSchema as zodSchema14
|
|
3138
3204
|
} from "@ai-sdk/provider-utils";
|
|
3139
3205
|
import { z as z15 } from "zod/v4";
|
|
3140
|
-
var
|
|
3206
|
+
var localShellInputSchema = lazySchema14(
|
|
3141
3207
|
() => zodSchema14(
|
|
3142
3208
|
z15.object({
|
|
3143
3209
|
action: z15.object({
|
|
3144
|
-
|
|
3210
|
+
type: z15.literal("exec"),
|
|
3211
|
+
command: z15.array(z15.string()),
|
|
3145
3212
|
timeoutMs: z15.number().optional(),
|
|
3146
|
-
|
|
3213
|
+
user: z15.string().optional(),
|
|
3214
|
+
workingDirectory: z15.string().optional(),
|
|
3215
|
+
env: z15.record(z15.string(), z15.string()).optional()
|
|
3147
3216
|
})
|
|
3148
3217
|
})
|
|
3149
3218
|
)
|
|
3150
3219
|
);
|
|
3151
|
-
var
|
|
3152
|
-
() => zodSchema14(
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3220
|
+
var localShellOutputSchema = lazySchema14(
|
|
3221
|
+
() => zodSchema14(z15.object({ output: z15.string() }))
|
|
3222
|
+
);
|
|
3223
|
+
var localShell = createProviderDefinedToolFactoryWithOutputSchema3({
|
|
3224
|
+
id: "openai.local_shell",
|
|
3225
|
+
inputSchema: localShellInputSchema,
|
|
3226
|
+
outputSchema: localShellOutputSchema
|
|
3227
|
+
});
|
|
3228
|
+
|
|
3229
|
+
// src/tool/shell.ts
|
|
3230
|
+
import {
|
|
3231
|
+
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
|
|
3232
|
+
lazySchema as lazySchema15,
|
|
3233
|
+
zodSchema as zodSchema15
|
|
3234
|
+
} from "@ai-sdk/provider-utils";
|
|
3235
|
+
import { z as z16 } from "zod/v4";
|
|
3236
|
+
var shellInputSchema = lazySchema15(
|
|
3237
|
+
() => zodSchema15(
|
|
3238
|
+
z16.object({
|
|
3239
|
+
action: z16.object({
|
|
3240
|
+
commands: z16.array(z16.string()),
|
|
3241
|
+
timeoutMs: z16.number().optional(),
|
|
3242
|
+
maxOutputLength: z16.number().optional()
|
|
3243
|
+
})
|
|
3244
|
+
})
|
|
3245
|
+
)
|
|
3246
|
+
);
|
|
3247
|
+
var shellOutputSchema = lazySchema15(
|
|
3248
|
+
() => zodSchema15(
|
|
3249
|
+
z16.object({
|
|
3250
|
+
output: z16.array(
|
|
3251
|
+
z16.object({
|
|
3252
|
+
stdout: z16.string(),
|
|
3253
|
+
stderr: z16.string(),
|
|
3254
|
+
outcome: z16.discriminatedUnion("type", [
|
|
3255
|
+
z16.object({ type: z16.literal("timeout") }),
|
|
3256
|
+
z16.object({ type: z16.literal("exit"), exitCode: z16.number() })
|
|
3161
3257
|
])
|
|
3162
3258
|
})
|
|
3163
3259
|
)
|
|
3164
3260
|
})
|
|
3165
3261
|
)
|
|
3166
3262
|
);
|
|
3167
|
-
var shellSkillsSchema =
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
type:
|
|
3171
|
-
providerReference:
|
|
3172
|
-
version:
|
|
3263
|
+
var shellSkillsSchema = z16.array(
|
|
3264
|
+
z16.discriminatedUnion("type", [
|
|
3265
|
+
z16.object({
|
|
3266
|
+
type: z16.literal("skillReference"),
|
|
3267
|
+
providerReference: z16.record(z16.string(), z16.string()),
|
|
3268
|
+
version: z16.string().optional()
|
|
3173
3269
|
}),
|
|
3174
|
-
|
|
3175
|
-
type:
|
|
3176
|
-
name:
|
|
3177
|
-
description:
|
|
3178
|
-
source:
|
|
3179
|
-
type:
|
|
3180
|
-
mediaType:
|
|
3181
|
-
data:
|
|
3270
|
+
z16.object({
|
|
3271
|
+
type: z16.literal("inline"),
|
|
3272
|
+
name: z16.string(),
|
|
3273
|
+
description: z16.string(),
|
|
3274
|
+
source: z16.object({
|
|
3275
|
+
type: z16.literal("base64"),
|
|
3276
|
+
mediaType: z16.literal("application/zip"),
|
|
3277
|
+
data: z16.string()
|
|
3182
3278
|
})
|
|
3183
3279
|
})
|
|
3184
3280
|
])
|
|
3185
3281
|
).optional();
|
|
3186
|
-
var shellArgsSchema =
|
|
3187
|
-
() =>
|
|
3188
|
-
|
|
3189
|
-
environment:
|
|
3190
|
-
|
|
3191
|
-
type:
|
|
3192
|
-
fileIds:
|
|
3193
|
-
memoryLimit:
|
|
3194
|
-
networkPolicy:
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
type:
|
|
3198
|
-
allowedDomains:
|
|
3199
|
-
domainSecrets:
|
|
3200
|
-
|
|
3201
|
-
domain:
|
|
3202
|
-
name:
|
|
3203
|
-
value:
|
|
3282
|
+
var shellArgsSchema = lazySchema15(
|
|
3283
|
+
() => zodSchema15(
|
|
3284
|
+
z16.object({
|
|
3285
|
+
environment: z16.union([
|
|
3286
|
+
z16.object({
|
|
3287
|
+
type: z16.literal("containerAuto"),
|
|
3288
|
+
fileIds: z16.array(z16.string()).optional(),
|
|
3289
|
+
memoryLimit: z16.enum(["1g", "4g", "16g", "64g"]).optional(),
|
|
3290
|
+
networkPolicy: z16.discriminatedUnion("type", [
|
|
3291
|
+
z16.object({ type: z16.literal("disabled") }),
|
|
3292
|
+
z16.object({
|
|
3293
|
+
type: z16.literal("allowlist"),
|
|
3294
|
+
allowedDomains: z16.array(z16.string()),
|
|
3295
|
+
domainSecrets: z16.array(
|
|
3296
|
+
z16.object({
|
|
3297
|
+
domain: z16.string(),
|
|
3298
|
+
name: z16.string(),
|
|
3299
|
+
value: z16.string()
|
|
3204
3300
|
})
|
|
3205
3301
|
).optional()
|
|
3206
3302
|
})
|
|
3207
3303
|
]).optional(),
|
|
3208
3304
|
skills: shellSkillsSchema
|
|
3209
3305
|
}),
|
|
3210
|
-
|
|
3211
|
-
type:
|
|
3212
|
-
containerId:
|
|
3306
|
+
z16.object({
|
|
3307
|
+
type: z16.literal("containerReference"),
|
|
3308
|
+
containerId: z16.string()
|
|
3213
3309
|
}),
|
|
3214
|
-
|
|
3215
|
-
type:
|
|
3216
|
-
skills:
|
|
3217
|
-
|
|
3218
|
-
name:
|
|
3219
|
-
description:
|
|
3220
|
-
path:
|
|
3310
|
+
z16.object({
|
|
3311
|
+
type: z16.literal("local").optional(),
|
|
3312
|
+
skills: z16.array(
|
|
3313
|
+
z16.object({
|
|
3314
|
+
name: z16.string(),
|
|
3315
|
+
description: z16.string(),
|
|
3316
|
+
path: z16.string()
|
|
3221
3317
|
})
|
|
3222
3318
|
).optional()
|
|
3223
3319
|
})
|
|
@@ -3225,7 +3321,7 @@ var shellArgsSchema = lazySchema14(
|
|
|
3225
3321
|
})
|
|
3226
3322
|
)
|
|
3227
3323
|
);
|
|
3228
|
-
var shell =
|
|
3324
|
+
var shell = createProviderDefinedToolFactoryWithOutputSchema4({
|
|
3229
3325
|
id: "openai.shell",
|
|
3230
3326
|
inputSchema: shellInputSchema,
|
|
3231
3327
|
outputSchema: shellOutputSchema
|
|
@@ -3233,36 +3329,36 @@ var shell = createProviderDefinedToolFactoryWithOutputSchema3({
|
|
|
3233
3329
|
|
|
3234
3330
|
// src/tool/tool-search.ts
|
|
3235
3331
|
import {
|
|
3236
|
-
createProviderDefinedToolFactoryWithOutputSchema as
|
|
3237
|
-
lazySchema as
|
|
3238
|
-
zodSchema as
|
|
3332
|
+
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5,
|
|
3333
|
+
lazySchema as lazySchema16,
|
|
3334
|
+
zodSchema as zodSchema16
|
|
3239
3335
|
} from "@ai-sdk/provider-utils";
|
|
3240
|
-
import { z as
|
|
3241
|
-
var toolSearchArgsSchema =
|
|
3242
|
-
() =>
|
|
3243
|
-
|
|
3244
|
-
execution:
|
|
3245
|
-
description:
|
|
3246
|
-
parameters:
|
|
3336
|
+
import { z as z17 } from "zod/v4";
|
|
3337
|
+
var toolSearchArgsSchema = lazySchema16(
|
|
3338
|
+
() => zodSchema16(
|
|
3339
|
+
z17.object({
|
|
3340
|
+
execution: z17.enum(["server", "client"]).optional(),
|
|
3341
|
+
description: z17.string().optional(),
|
|
3342
|
+
parameters: z17.record(z17.string(), z17.unknown()).optional()
|
|
3247
3343
|
})
|
|
3248
3344
|
)
|
|
3249
3345
|
);
|
|
3250
|
-
var toolSearchInputSchema =
|
|
3251
|
-
() =>
|
|
3252
|
-
|
|
3253
|
-
arguments:
|
|
3254
|
-
call_id:
|
|
3346
|
+
var toolSearchInputSchema = lazySchema16(
|
|
3347
|
+
() => zodSchema16(
|
|
3348
|
+
z17.object({
|
|
3349
|
+
arguments: z17.unknown().optional(),
|
|
3350
|
+
call_id: z17.string().nullish()
|
|
3255
3351
|
})
|
|
3256
3352
|
)
|
|
3257
3353
|
);
|
|
3258
|
-
var toolSearchOutputSchema =
|
|
3259
|
-
() =>
|
|
3260
|
-
|
|
3261
|
-
tools:
|
|
3354
|
+
var toolSearchOutputSchema = lazySchema16(
|
|
3355
|
+
() => zodSchema16(
|
|
3356
|
+
z17.object({
|
|
3357
|
+
tools: z17.array(z17.record(z17.string(), z17.unknown()))
|
|
3262
3358
|
})
|
|
3263
3359
|
)
|
|
3264
3360
|
);
|
|
3265
|
-
var toolSearchToolFactory =
|
|
3361
|
+
var toolSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema5({
|
|
3266
3362
|
id: "openai.tool_search",
|
|
3267
3363
|
inputSchema: toolSearchInputSchema,
|
|
3268
3364
|
outputSchema: toolSearchOutputSchema
|
|
@@ -3293,9 +3389,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
3293
3389
|
hasLocalShellTool = false,
|
|
3294
3390
|
hasShellTool = false,
|
|
3295
3391
|
hasApplyPatchTool = false,
|
|
3392
|
+
hasComputerTool = false,
|
|
3296
3393
|
customProviderToolNames
|
|
3297
3394
|
}) {
|
|
3298
|
-
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;
|
|
3395
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
3299
3396
|
let input = [];
|
|
3300
3397
|
const warnings = [];
|
|
3301
3398
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -3519,7 +3616,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3519
3616
|
if (hasPreviousResponseId && store && id != null) {
|
|
3520
3617
|
break;
|
|
3521
3618
|
}
|
|
3522
|
-
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
|
|
3619
|
+
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || hasComputerTool && resolvedToolName === "computer" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
|
|
3523
3620
|
if (store && id != null && isProviderDefinedToolCall) {
|
|
3524
3621
|
input.push({ type: "item_reference", id });
|
|
3525
3622
|
break;
|
|
@@ -3576,6 +3673,53 @@ async function convertToOpenAIResponsesInput({
|
|
|
3576
3673
|
});
|
|
3577
3674
|
break;
|
|
3578
3675
|
}
|
|
3676
|
+
if (hasComputerTool && resolvedToolName === "computer") {
|
|
3677
|
+
const parsedInput = await validateTypes({
|
|
3678
|
+
value: part.input,
|
|
3679
|
+
schema: computerInputSchema
|
|
3680
|
+
});
|
|
3681
|
+
input.push({
|
|
3682
|
+
type: "computer_call",
|
|
3683
|
+
call_id: part.toolCallId,
|
|
3684
|
+
id,
|
|
3685
|
+
status: parsedInput.status,
|
|
3686
|
+
actions: parsedInput.actions.map((action) => {
|
|
3687
|
+
switch (action.type) {
|
|
3688
|
+
case "click":
|
|
3689
|
+
case "double_click":
|
|
3690
|
+
case "move":
|
|
3691
|
+
return {
|
|
3692
|
+
...action,
|
|
3693
|
+
keys: action.keys
|
|
3694
|
+
};
|
|
3695
|
+
case "drag":
|
|
3696
|
+
return {
|
|
3697
|
+
...action,
|
|
3698
|
+
keys: action.keys
|
|
3699
|
+
};
|
|
3700
|
+
case "scroll":
|
|
3701
|
+
return {
|
|
3702
|
+
type: "scroll",
|
|
3703
|
+
x: action.x,
|
|
3704
|
+
y: action.y,
|
|
3705
|
+
scroll_x: action.scrollX,
|
|
3706
|
+
scroll_y: action.scrollY,
|
|
3707
|
+
keys: action.keys
|
|
3708
|
+
};
|
|
3709
|
+
default:
|
|
3710
|
+
return action;
|
|
3711
|
+
}
|
|
3712
|
+
}),
|
|
3713
|
+
pending_safety_checks: parsedInput.pendingSafetyChecks.map(
|
|
3714
|
+
(safetyCheck) => ({
|
|
3715
|
+
id: safetyCheck.id,
|
|
3716
|
+
code: safetyCheck.code,
|
|
3717
|
+
message: safetyCheck.message
|
|
3718
|
+
})
|
|
3719
|
+
)
|
|
3720
|
+
});
|
|
3721
|
+
break;
|
|
3722
|
+
}
|
|
3579
3723
|
if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
|
|
3580
3724
|
input.push({
|
|
3581
3725
|
type: "custom_tool_call",
|
|
@@ -3846,6 +3990,28 @@ async function convertToOpenAIResponsesInput({
|
|
|
3846
3990
|
});
|
|
3847
3991
|
continue;
|
|
3848
3992
|
}
|
|
3993
|
+
if (hasComputerTool && resolvedToolName === "computer" && output.type === "json") {
|
|
3994
|
+
const parsedOutput = await validateTypes({
|
|
3995
|
+
value: output.value,
|
|
3996
|
+
schema: computerOutputSchema
|
|
3997
|
+
});
|
|
3998
|
+
input.push({
|
|
3999
|
+
type: "computer_call_output",
|
|
4000
|
+
call_id: part.toolCallId,
|
|
4001
|
+
output: {
|
|
4002
|
+
type: "computer_screenshot",
|
|
4003
|
+
image_url: parsedOutput.output.imageUrl,
|
|
4004
|
+
file_id: parsedOutput.output.fileId,
|
|
4005
|
+
detail: parsedOutput.output.detail
|
|
4006
|
+
},
|
|
4007
|
+
acknowledged_safety_checks: (_w = parsedOutput.acknowledgedSafetyChecks) == null ? void 0 : _w.map((safetyCheck) => ({
|
|
4008
|
+
id: safetyCheck.id,
|
|
4009
|
+
code: safetyCheck.code,
|
|
4010
|
+
message: safetyCheck.message
|
|
4011
|
+
}))
|
|
4012
|
+
});
|
|
4013
|
+
continue;
|
|
4014
|
+
}
|
|
3849
4015
|
if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
|
|
3850
4016
|
let outputValue;
|
|
3851
4017
|
switch (output.type) {
|
|
@@ -3854,7 +4020,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3854
4020
|
outputValue = output.value;
|
|
3855
4021
|
break;
|
|
3856
4022
|
case "execution-denied":
|
|
3857
|
-
outputValue = (
|
|
4023
|
+
outputValue = (_x = output.reason) != null ? _x : "Tool call execution denied.";
|
|
3858
4024
|
break;
|
|
3859
4025
|
case "json":
|
|
3860
4026
|
case "error-json":
|
|
@@ -3953,7 +4119,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3953
4119
|
contentValue = output.value;
|
|
3954
4120
|
break;
|
|
3955
4121
|
case "execution-denied":
|
|
3956
|
-
contentValue = (
|
|
4122
|
+
contentValue = (_y = output.reason) != null ? _y : "Tool call execution denied.";
|
|
3957
4123
|
break;
|
|
3958
4124
|
case "json":
|
|
3959
4125
|
case "error-json":
|
|
@@ -4065,9 +4231,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
4065
4231
|
}
|
|
4066
4232
|
return { input, warnings };
|
|
4067
4233
|
}
|
|
4068
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4069
|
-
itemId:
|
|
4070
|
-
reasoningEncryptedContent:
|
|
4234
|
+
var openaiResponsesReasoningProviderOptionsSchema = z18.object({
|
|
4235
|
+
itemId: z18.string().nullish(),
|
|
4236
|
+
reasoningEncryptedContent: z18.string().nullish()
|
|
4071
4237
|
});
|
|
4072
4238
|
|
|
4073
4239
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -4090,589 +4256,643 @@ function mapOpenAIResponseFinishReason({
|
|
|
4090
4256
|
|
|
4091
4257
|
// src/responses/openai-responses-api.ts
|
|
4092
4258
|
import {
|
|
4093
|
-
lazySchema as
|
|
4094
|
-
zodSchema as
|
|
4259
|
+
lazySchema as lazySchema17,
|
|
4260
|
+
zodSchema as zodSchema17
|
|
4095
4261
|
} from "@ai-sdk/provider-utils";
|
|
4096
|
-
import { z as
|
|
4097
|
-
var jsonValueSchema =
|
|
4098
|
-
() =>
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4262
|
+
import { z as z19 } from "zod/v4";
|
|
4263
|
+
var jsonValueSchema = z19.lazy(
|
|
4264
|
+
() => z19.union([
|
|
4265
|
+
z19.string(),
|
|
4266
|
+
z19.number(),
|
|
4267
|
+
z19.boolean(),
|
|
4268
|
+
z19.null(),
|
|
4269
|
+
z19.array(jsonValueSchema),
|
|
4270
|
+
z19.record(z19.string(), jsonValueSchema.optional())
|
|
4105
4271
|
])
|
|
4106
4272
|
);
|
|
4107
|
-
var
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4273
|
+
var openaiResponsesComputerSafetyCheckSchema = z19.object({
|
|
4274
|
+
id: z19.string(),
|
|
4275
|
+
code: z19.string().nullish(),
|
|
4276
|
+
message: z19.string().nullish()
|
|
4277
|
+
});
|
|
4278
|
+
var openaiResponsesComputerActionSchema = z19.discriminatedUnion("type", [
|
|
4279
|
+
z19.object({
|
|
4280
|
+
type: z19.literal("click"),
|
|
4281
|
+
button: z19.enum(["left", "right", "wheel", "back", "forward"]),
|
|
4282
|
+
x: z19.number(),
|
|
4283
|
+
y: z19.number(),
|
|
4284
|
+
keys: z19.array(z19.string()).nullish()
|
|
4285
|
+
}),
|
|
4286
|
+
z19.object({
|
|
4287
|
+
type: z19.literal("double_click"),
|
|
4288
|
+
x: z19.number(),
|
|
4289
|
+
y: z19.number(),
|
|
4290
|
+
keys: z19.array(z19.string()).nullish()
|
|
4291
|
+
}),
|
|
4292
|
+
z19.object({
|
|
4293
|
+
type: z19.literal("drag"),
|
|
4294
|
+
path: z19.array(z19.object({ x: z19.number(), y: z19.number() })),
|
|
4295
|
+
keys: z19.array(z19.string()).nullish()
|
|
4296
|
+
}),
|
|
4297
|
+
z19.object({
|
|
4298
|
+
type: z19.literal("keypress"),
|
|
4299
|
+
keys: z19.array(z19.string())
|
|
4300
|
+
}),
|
|
4301
|
+
z19.object({
|
|
4302
|
+
type: z19.literal("move"),
|
|
4303
|
+
x: z19.number(),
|
|
4304
|
+
y: z19.number(),
|
|
4305
|
+
keys: z19.array(z19.string()).nullish()
|
|
4306
|
+
}),
|
|
4307
|
+
z19.object({
|
|
4308
|
+
type: z19.literal("screenshot")
|
|
4309
|
+
}),
|
|
4310
|
+
z19.object({
|
|
4311
|
+
type: z19.literal("scroll"),
|
|
4312
|
+
x: z19.number(),
|
|
4313
|
+
y: z19.number(),
|
|
4314
|
+
scroll_x: z19.number(),
|
|
4315
|
+
scroll_y: z19.number(),
|
|
4316
|
+
keys: z19.array(z19.string()).nullish()
|
|
4317
|
+
}),
|
|
4318
|
+
z19.object({
|
|
4319
|
+
type: z19.literal("type"),
|
|
4320
|
+
text: z19.string()
|
|
4321
|
+
}),
|
|
4322
|
+
z19.object({
|
|
4323
|
+
type: z19.literal("wait")
|
|
4115
4324
|
})
|
|
4325
|
+
]);
|
|
4326
|
+
var openaiResponsesComputerCallSchema = z19.object({
|
|
4327
|
+
type: z19.literal("computer_call"),
|
|
4328
|
+
id: z19.string(),
|
|
4329
|
+
call_id: z19.string().nullish(),
|
|
4330
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4331
|
+
action: openaiResponsesComputerActionSchema.nullish(),
|
|
4332
|
+
actions: z19.array(openaiResponsesComputerActionSchema).nullish(),
|
|
4333
|
+
pending_safety_checks: z19.array(openaiResponsesComputerSafetyCheckSchema).nullish()
|
|
4116
4334
|
});
|
|
4117
|
-
var
|
|
4118
|
-
type:
|
|
4119
|
-
sequence_number:
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4335
|
+
var openaiResponsesNestedErrorChunkSchema = z19.object({
|
|
4336
|
+
type: z19.literal("error"),
|
|
4337
|
+
sequence_number: z19.number(),
|
|
4338
|
+
error: z19.object({
|
|
4339
|
+
type: z19.string(),
|
|
4340
|
+
code: z19.string(),
|
|
4341
|
+
message: z19.string(),
|
|
4342
|
+
param: z19.string().nullish()
|
|
4343
|
+
})
|
|
4123
4344
|
});
|
|
4124
|
-
var
|
|
4125
|
-
()
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4345
|
+
var openaiResponsesErrorChunkSchema = z19.object({
|
|
4346
|
+
type: z19.literal("error"),
|
|
4347
|
+
sequence_number: z19.number(),
|
|
4348
|
+
code: z19.string().nullish(),
|
|
4349
|
+
message: z19.string(),
|
|
4350
|
+
param: z19.string().nullish()
|
|
4351
|
+
});
|
|
4352
|
+
var openaiResponsesChunkSchema = lazySchema17(
|
|
4353
|
+
() => zodSchema17(
|
|
4354
|
+
z19.union([
|
|
4355
|
+
z19.object({
|
|
4356
|
+
type: z19.literal("response.output_text.delta"),
|
|
4357
|
+
item_id: z19.string(),
|
|
4358
|
+
delta: z19.string(),
|
|
4359
|
+
logprobs: z19.array(
|
|
4360
|
+
z19.object({
|
|
4361
|
+
token: z19.string(),
|
|
4362
|
+
logprob: z19.number(),
|
|
4363
|
+
top_logprobs: z19.array(
|
|
4364
|
+
z19.object({
|
|
4365
|
+
token: z19.string(),
|
|
4366
|
+
logprob: z19.number()
|
|
4139
4367
|
})
|
|
4140
4368
|
)
|
|
4141
4369
|
})
|
|
4142
4370
|
).nullish()
|
|
4143
4371
|
}),
|
|
4144
|
-
|
|
4145
|
-
type:
|
|
4146
|
-
response:
|
|
4147
|
-
incomplete_details:
|
|
4148
|
-
usage:
|
|
4149
|
-
input_tokens:
|
|
4150
|
-
input_tokens_details:
|
|
4151
|
-
cached_tokens:
|
|
4152
|
-
cache_write_tokens:
|
|
4153
|
-
orchestration_input_tokens:
|
|
4154
|
-
orchestration_input_cached_tokens:
|
|
4372
|
+
z19.object({
|
|
4373
|
+
type: z19.enum(["response.completed", "response.incomplete"]),
|
|
4374
|
+
response: z19.object({
|
|
4375
|
+
incomplete_details: z19.object({ reason: z19.string() }).nullish(),
|
|
4376
|
+
usage: z19.object({
|
|
4377
|
+
input_tokens: z19.number(),
|
|
4378
|
+
input_tokens_details: z19.object({
|
|
4379
|
+
cached_tokens: z19.number().nullish(),
|
|
4380
|
+
cache_write_tokens: z19.number().nullish(),
|
|
4381
|
+
orchestration_input_tokens: z19.number().nullish(),
|
|
4382
|
+
orchestration_input_cached_tokens: z19.number().nullish()
|
|
4155
4383
|
}).nullish(),
|
|
4156
|
-
output_tokens:
|
|
4157
|
-
output_tokens_details:
|
|
4158
|
-
reasoning_tokens:
|
|
4159
|
-
orchestration_output_tokens:
|
|
4384
|
+
output_tokens: z19.number(),
|
|
4385
|
+
output_tokens_details: z19.object({
|
|
4386
|
+
reasoning_tokens: z19.number().nullish(),
|
|
4387
|
+
orchestration_output_tokens: z19.number().nullish()
|
|
4160
4388
|
}).nullish()
|
|
4161
4389
|
}),
|
|
4162
|
-
reasoning:
|
|
4163
|
-
context:
|
|
4390
|
+
reasoning: z19.object({
|
|
4391
|
+
context: z19.string().nullish()
|
|
4164
4392
|
}).nullish(),
|
|
4165
|
-
service_tier:
|
|
4393
|
+
service_tier: z19.string().nullish()
|
|
4166
4394
|
})
|
|
4167
4395
|
}),
|
|
4168
|
-
|
|
4169
|
-
type:
|
|
4170
|
-
sequence_number:
|
|
4171
|
-
response:
|
|
4172
|
-
error:
|
|
4173
|
-
code:
|
|
4174
|
-
message:
|
|
4396
|
+
z19.object({
|
|
4397
|
+
type: z19.literal("response.failed"),
|
|
4398
|
+
sequence_number: z19.number(),
|
|
4399
|
+
response: z19.object({
|
|
4400
|
+
error: z19.object({
|
|
4401
|
+
code: z19.string().nullish(),
|
|
4402
|
+
message: z19.string()
|
|
4175
4403
|
}).nullish(),
|
|
4176
|
-
incomplete_details:
|
|
4177
|
-
usage:
|
|
4178
|
-
input_tokens:
|
|
4179
|
-
input_tokens_details:
|
|
4180
|
-
cached_tokens:
|
|
4181
|
-
cache_write_tokens:
|
|
4182
|
-
orchestration_input_tokens:
|
|
4183
|
-
orchestration_input_cached_tokens:
|
|
4404
|
+
incomplete_details: z19.object({ reason: z19.string() }).nullish(),
|
|
4405
|
+
usage: z19.object({
|
|
4406
|
+
input_tokens: z19.number(),
|
|
4407
|
+
input_tokens_details: z19.object({
|
|
4408
|
+
cached_tokens: z19.number().nullish(),
|
|
4409
|
+
cache_write_tokens: z19.number().nullish(),
|
|
4410
|
+
orchestration_input_tokens: z19.number().nullish(),
|
|
4411
|
+
orchestration_input_cached_tokens: z19.number().nullish()
|
|
4184
4412
|
}).nullish(),
|
|
4185
|
-
output_tokens:
|
|
4186
|
-
output_tokens_details:
|
|
4187
|
-
reasoning_tokens:
|
|
4188
|
-
orchestration_output_tokens:
|
|
4413
|
+
output_tokens: z19.number(),
|
|
4414
|
+
output_tokens_details: z19.object({
|
|
4415
|
+
reasoning_tokens: z19.number().nullish(),
|
|
4416
|
+
orchestration_output_tokens: z19.number().nullish()
|
|
4189
4417
|
}).nullish()
|
|
4190
4418
|
}).nullish(),
|
|
4191
|
-
reasoning:
|
|
4192
|
-
context:
|
|
4419
|
+
reasoning: z19.object({
|
|
4420
|
+
context: z19.string().nullish()
|
|
4193
4421
|
}).nullish(),
|
|
4194
|
-
service_tier:
|
|
4422
|
+
service_tier: z19.string().nullish()
|
|
4195
4423
|
})
|
|
4196
4424
|
}),
|
|
4197
|
-
|
|
4198
|
-
type:
|
|
4199
|
-
response:
|
|
4200
|
-
id:
|
|
4201
|
-
created_at:
|
|
4202
|
-
model:
|
|
4203
|
-
service_tier:
|
|
4425
|
+
z19.object({
|
|
4426
|
+
type: z19.literal("response.created"),
|
|
4427
|
+
response: z19.object({
|
|
4428
|
+
id: z19.string(),
|
|
4429
|
+
created_at: z19.number(),
|
|
4430
|
+
model: z19.string(),
|
|
4431
|
+
service_tier: z19.string().nullish()
|
|
4204
4432
|
})
|
|
4205
4433
|
}),
|
|
4206
|
-
|
|
4207
|
-
type:
|
|
4208
|
-
output_index:
|
|
4209
|
-
item:
|
|
4210
|
-
|
|
4211
|
-
type:
|
|
4212
|
-
id:
|
|
4213
|
-
phase:
|
|
4214
|
-
}),
|
|
4215
|
-
z18.object({
|
|
4216
|
-
type: z18.literal("reasoning"),
|
|
4217
|
-
id: z18.string(),
|
|
4218
|
-
encrypted_content: z18.string().nullish()
|
|
4434
|
+
z19.object({
|
|
4435
|
+
type: z19.literal("response.output_item.added"),
|
|
4436
|
+
output_index: z19.number(),
|
|
4437
|
+
item: z19.discriminatedUnion("type", [
|
|
4438
|
+
z19.object({
|
|
4439
|
+
type: z19.literal("message"),
|
|
4440
|
+
id: z19.string(),
|
|
4441
|
+
phase: z19.enum(["commentary", "final_answer"]).nullish()
|
|
4219
4442
|
}),
|
|
4220
|
-
|
|
4221
|
-
type:
|
|
4222
|
-
id:
|
|
4223
|
-
|
|
4224
|
-
name: z18.string(),
|
|
4225
|
-
arguments: z18.string(),
|
|
4226
|
-
namespace: z18.string().nullish()
|
|
4443
|
+
z19.object({
|
|
4444
|
+
type: z19.literal("reasoning"),
|
|
4445
|
+
id: z19.string(),
|
|
4446
|
+
encrypted_content: z19.string().nullish()
|
|
4227
4447
|
}),
|
|
4228
|
-
|
|
4229
|
-
type:
|
|
4230
|
-
id:
|
|
4231
|
-
|
|
4448
|
+
z19.object({
|
|
4449
|
+
type: z19.literal("function_call"),
|
|
4450
|
+
id: z19.string(),
|
|
4451
|
+
call_id: z19.string(),
|
|
4452
|
+
name: z19.string(),
|
|
4453
|
+
arguments: z19.string(),
|
|
4454
|
+
namespace: z19.string().nullish()
|
|
4232
4455
|
}),
|
|
4233
|
-
|
|
4234
|
-
type:
|
|
4235
|
-
id:
|
|
4236
|
-
status:
|
|
4456
|
+
z19.object({
|
|
4457
|
+
type: z19.literal("web_search_call"),
|
|
4458
|
+
id: z19.string(),
|
|
4459
|
+
status: z19.string()
|
|
4237
4460
|
}),
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4461
|
+
openaiResponsesComputerCallSchema,
|
|
4462
|
+
z19.object({
|
|
4463
|
+
type: z19.literal("file_search_call"),
|
|
4464
|
+
id: z19.string()
|
|
4241
4465
|
}),
|
|
4242
|
-
|
|
4243
|
-
type:
|
|
4244
|
-
id:
|
|
4466
|
+
z19.object({
|
|
4467
|
+
type: z19.literal("image_generation_call"),
|
|
4468
|
+
id: z19.string()
|
|
4245
4469
|
}),
|
|
4246
|
-
|
|
4247
|
-
type:
|
|
4248
|
-
id:
|
|
4249
|
-
container_id:
|
|
4250
|
-
code:
|
|
4251
|
-
outputs:
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4470
|
+
z19.object({
|
|
4471
|
+
type: z19.literal("code_interpreter_call"),
|
|
4472
|
+
id: z19.string(),
|
|
4473
|
+
container_id: z19.string(),
|
|
4474
|
+
code: z19.string().nullable(),
|
|
4475
|
+
outputs: z19.array(
|
|
4476
|
+
z19.discriminatedUnion("type", [
|
|
4477
|
+
z19.object({ type: z19.literal("logs"), logs: z19.string() }),
|
|
4478
|
+
z19.object({ type: z19.literal("image"), url: z19.string() })
|
|
4255
4479
|
])
|
|
4256
4480
|
).nullable(),
|
|
4257
|
-
status:
|
|
4481
|
+
status: z19.string()
|
|
4258
4482
|
}),
|
|
4259
|
-
|
|
4260
|
-
type:
|
|
4261
|
-
id:
|
|
4262
|
-
status:
|
|
4263
|
-
approval_request_id:
|
|
4483
|
+
z19.object({
|
|
4484
|
+
type: z19.literal("mcp_call"),
|
|
4485
|
+
id: z19.string(),
|
|
4486
|
+
status: z19.string(),
|
|
4487
|
+
approval_request_id: z19.string().nullish()
|
|
4264
4488
|
}),
|
|
4265
|
-
|
|
4266
|
-
type:
|
|
4267
|
-
id:
|
|
4489
|
+
z19.object({
|
|
4490
|
+
type: z19.literal("mcp_list_tools"),
|
|
4491
|
+
id: z19.string()
|
|
4268
4492
|
}),
|
|
4269
|
-
|
|
4270
|
-
type:
|
|
4271
|
-
id:
|
|
4493
|
+
z19.object({
|
|
4494
|
+
type: z19.literal("mcp_approval_request"),
|
|
4495
|
+
id: z19.string()
|
|
4272
4496
|
}),
|
|
4273
|
-
|
|
4274
|
-
type:
|
|
4275
|
-
id:
|
|
4276
|
-
call_id:
|
|
4277
|
-
status:
|
|
4278
|
-
operation:
|
|
4279
|
-
|
|
4280
|
-
type:
|
|
4281
|
-
path:
|
|
4282
|
-
diff:
|
|
4497
|
+
z19.object({
|
|
4498
|
+
type: z19.literal("apply_patch_call"),
|
|
4499
|
+
id: z19.string(),
|
|
4500
|
+
call_id: z19.string(),
|
|
4501
|
+
status: z19.enum(["in_progress", "completed"]),
|
|
4502
|
+
operation: z19.discriminatedUnion("type", [
|
|
4503
|
+
z19.object({
|
|
4504
|
+
type: z19.literal("create_file"),
|
|
4505
|
+
path: z19.string(),
|
|
4506
|
+
diff: z19.string()
|
|
4283
4507
|
}),
|
|
4284
|
-
|
|
4285
|
-
type:
|
|
4286
|
-
path:
|
|
4508
|
+
z19.object({
|
|
4509
|
+
type: z19.literal("delete_file"),
|
|
4510
|
+
path: z19.string()
|
|
4287
4511
|
}),
|
|
4288
|
-
|
|
4289
|
-
type:
|
|
4290
|
-
path:
|
|
4291
|
-
diff:
|
|
4512
|
+
z19.object({
|
|
4513
|
+
type: z19.literal("update_file"),
|
|
4514
|
+
path: z19.string(),
|
|
4515
|
+
diff: z19.string()
|
|
4292
4516
|
})
|
|
4293
4517
|
])
|
|
4294
4518
|
}),
|
|
4295
|
-
|
|
4296
|
-
type:
|
|
4297
|
-
id:
|
|
4298
|
-
call_id:
|
|
4299
|
-
name:
|
|
4300
|
-
input:
|
|
4519
|
+
z19.object({
|
|
4520
|
+
type: z19.literal("custom_tool_call"),
|
|
4521
|
+
id: z19.string(),
|
|
4522
|
+
call_id: z19.string(),
|
|
4523
|
+
name: z19.string(),
|
|
4524
|
+
input: z19.string()
|
|
4301
4525
|
}),
|
|
4302
|
-
|
|
4303
|
-
type:
|
|
4304
|
-
id:
|
|
4305
|
-
call_id:
|
|
4306
|
-
status:
|
|
4307
|
-
action:
|
|
4308
|
-
commands:
|
|
4526
|
+
z19.object({
|
|
4527
|
+
type: z19.literal("shell_call"),
|
|
4528
|
+
id: z19.string(),
|
|
4529
|
+
call_id: z19.string(),
|
|
4530
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4531
|
+
action: z19.object({
|
|
4532
|
+
commands: z19.array(z19.string())
|
|
4309
4533
|
})
|
|
4310
4534
|
}),
|
|
4311
|
-
|
|
4312
|
-
type:
|
|
4313
|
-
id:
|
|
4314
|
-
encrypted_content:
|
|
4535
|
+
z19.object({
|
|
4536
|
+
type: z19.literal("compaction"),
|
|
4537
|
+
id: z19.string(),
|
|
4538
|
+
encrypted_content: z19.string().nullish()
|
|
4315
4539
|
}),
|
|
4316
|
-
|
|
4317
|
-
type:
|
|
4318
|
-
id:
|
|
4319
|
-
call_id:
|
|
4320
|
-
status:
|
|
4321
|
-
output:
|
|
4322
|
-
|
|
4323
|
-
stdout:
|
|
4324
|
-
stderr:
|
|
4325
|
-
outcome:
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
type:
|
|
4329
|
-
exit_code:
|
|
4540
|
+
z19.object({
|
|
4541
|
+
type: z19.literal("shell_call_output"),
|
|
4542
|
+
id: z19.string(),
|
|
4543
|
+
call_id: z19.string(),
|
|
4544
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4545
|
+
output: z19.array(
|
|
4546
|
+
z19.object({
|
|
4547
|
+
stdout: z19.string(),
|
|
4548
|
+
stderr: z19.string(),
|
|
4549
|
+
outcome: z19.discriminatedUnion("type", [
|
|
4550
|
+
z19.object({ type: z19.literal("timeout") }),
|
|
4551
|
+
z19.object({
|
|
4552
|
+
type: z19.literal("exit"),
|
|
4553
|
+
exit_code: z19.number()
|
|
4330
4554
|
})
|
|
4331
4555
|
])
|
|
4332
4556
|
})
|
|
4333
4557
|
)
|
|
4334
4558
|
}),
|
|
4335
|
-
|
|
4336
|
-
type:
|
|
4337
|
-
id:
|
|
4338
|
-
execution:
|
|
4339
|
-
call_id:
|
|
4340
|
-
status:
|
|
4341
|
-
arguments:
|
|
4559
|
+
z19.object({
|
|
4560
|
+
type: z19.literal("tool_search_call"),
|
|
4561
|
+
id: z19.string(),
|
|
4562
|
+
execution: z19.enum(["server", "client"]),
|
|
4563
|
+
call_id: z19.string().nullable(),
|
|
4564
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4565
|
+
arguments: z19.unknown()
|
|
4342
4566
|
}),
|
|
4343
|
-
|
|
4344
|
-
type:
|
|
4345
|
-
id:
|
|
4346
|
-
execution:
|
|
4347
|
-
call_id:
|
|
4348
|
-
status:
|
|
4349
|
-
tools:
|
|
4567
|
+
z19.object({
|
|
4568
|
+
type: z19.literal("tool_search_output"),
|
|
4569
|
+
id: z19.string(),
|
|
4570
|
+
execution: z19.enum(["server", "client"]),
|
|
4571
|
+
call_id: z19.string().nullable(),
|
|
4572
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4573
|
+
tools: z19.array(z19.record(z19.string(), jsonValueSchema.optional()))
|
|
4350
4574
|
})
|
|
4351
4575
|
])
|
|
4352
4576
|
}),
|
|
4353
|
-
|
|
4354
|
-
type:
|
|
4355
|
-
output_index:
|
|
4356
|
-
item:
|
|
4357
|
-
|
|
4358
|
-
type:
|
|
4359
|
-
id:
|
|
4360
|
-
phase:
|
|
4577
|
+
z19.object({
|
|
4578
|
+
type: z19.literal("response.output_item.done"),
|
|
4579
|
+
output_index: z19.number(),
|
|
4580
|
+
item: z19.discriminatedUnion("type", [
|
|
4581
|
+
z19.object({
|
|
4582
|
+
type: z19.literal("message"),
|
|
4583
|
+
id: z19.string(),
|
|
4584
|
+
phase: z19.enum(["commentary", "final_answer"]).nullish()
|
|
4361
4585
|
}),
|
|
4362
|
-
|
|
4363
|
-
type:
|
|
4364
|
-
id:
|
|
4365
|
-
encrypted_content:
|
|
4586
|
+
z19.object({
|
|
4587
|
+
type: z19.literal("reasoning"),
|
|
4588
|
+
id: z19.string(),
|
|
4589
|
+
encrypted_content: z19.string().nullish()
|
|
4366
4590
|
}),
|
|
4367
|
-
|
|
4368
|
-
type:
|
|
4369
|
-
id:
|
|
4370
|
-
call_id:
|
|
4371
|
-
name:
|
|
4372
|
-
arguments:
|
|
4373
|
-
status:
|
|
4374
|
-
namespace:
|
|
4591
|
+
z19.object({
|
|
4592
|
+
type: z19.literal("function_call"),
|
|
4593
|
+
id: z19.string(),
|
|
4594
|
+
call_id: z19.string(),
|
|
4595
|
+
name: z19.string(),
|
|
4596
|
+
arguments: z19.string(),
|
|
4597
|
+
status: z19.literal("completed"),
|
|
4598
|
+
namespace: z19.string().nullish()
|
|
4375
4599
|
}),
|
|
4376
|
-
|
|
4377
|
-
type:
|
|
4378
|
-
id:
|
|
4379
|
-
call_id:
|
|
4380
|
-
name:
|
|
4381
|
-
input:
|
|
4382
|
-
status:
|
|
4600
|
+
z19.object({
|
|
4601
|
+
type: z19.literal("custom_tool_call"),
|
|
4602
|
+
id: z19.string(),
|
|
4603
|
+
call_id: z19.string(),
|
|
4604
|
+
name: z19.string(),
|
|
4605
|
+
input: z19.string(),
|
|
4606
|
+
status: z19.literal("completed")
|
|
4383
4607
|
}),
|
|
4384
|
-
|
|
4385
|
-
type:
|
|
4386
|
-
id:
|
|
4387
|
-
code:
|
|
4388
|
-
container_id:
|
|
4389
|
-
outputs:
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4608
|
+
z19.object({
|
|
4609
|
+
type: z19.literal("code_interpreter_call"),
|
|
4610
|
+
id: z19.string(),
|
|
4611
|
+
code: z19.string().nullable(),
|
|
4612
|
+
container_id: z19.string(),
|
|
4613
|
+
outputs: z19.array(
|
|
4614
|
+
z19.discriminatedUnion("type", [
|
|
4615
|
+
z19.object({ type: z19.literal("logs"), logs: z19.string() }),
|
|
4616
|
+
z19.object({ type: z19.literal("image"), url: z19.string() })
|
|
4393
4617
|
])
|
|
4394
4618
|
).nullable()
|
|
4395
4619
|
}),
|
|
4396
|
-
|
|
4397
|
-
type:
|
|
4398
|
-
id:
|
|
4399
|
-
result:
|
|
4620
|
+
z19.object({
|
|
4621
|
+
type: z19.literal("image_generation_call"),
|
|
4622
|
+
id: z19.string(),
|
|
4623
|
+
result: z19.string()
|
|
4400
4624
|
}),
|
|
4401
|
-
|
|
4402
|
-
type:
|
|
4403
|
-
id:
|
|
4404
|
-
status:
|
|
4405
|
-
action:
|
|
4406
|
-
|
|
4407
|
-
type:
|
|
4408
|
-
query:
|
|
4409
|
-
queries:
|
|
4410
|
-
sources:
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4625
|
+
z19.object({
|
|
4626
|
+
type: z19.literal("web_search_call"),
|
|
4627
|
+
id: z19.string(),
|
|
4628
|
+
status: z19.string(),
|
|
4629
|
+
action: z19.discriminatedUnion("type", [
|
|
4630
|
+
z19.object({
|
|
4631
|
+
type: z19.literal("search"),
|
|
4632
|
+
query: z19.string().nullish(),
|
|
4633
|
+
queries: z19.array(z19.string()).nullish(),
|
|
4634
|
+
sources: z19.array(
|
|
4635
|
+
z19.discriminatedUnion("type", [
|
|
4636
|
+
z19.object({ type: z19.literal("url"), url: z19.string() }),
|
|
4637
|
+
z19.object({ type: z19.literal("api"), name: z19.string() })
|
|
4414
4638
|
])
|
|
4415
4639
|
).nullish()
|
|
4416
4640
|
}),
|
|
4417
|
-
|
|
4418
|
-
type:
|
|
4419
|
-
url:
|
|
4641
|
+
z19.object({
|
|
4642
|
+
type: z19.literal("open_page"),
|
|
4643
|
+
url: z19.string().nullish()
|
|
4420
4644
|
}),
|
|
4421
|
-
|
|
4422
|
-
type:
|
|
4423
|
-
url:
|
|
4424
|
-
pattern:
|
|
4645
|
+
z19.object({
|
|
4646
|
+
type: z19.literal("find_in_page"),
|
|
4647
|
+
url: z19.string().nullish(),
|
|
4648
|
+
pattern: z19.string().nullish()
|
|
4425
4649
|
})
|
|
4426
4650
|
]).nullish()
|
|
4427
4651
|
}),
|
|
4428
|
-
|
|
4429
|
-
type:
|
|
4430
|
-
id:
|
|
4431
|
-
queries:
|
|
4432
|
-
results:
|
|
4433
|
-
|
|
4434
|
-
attributes:
|
|
4435
|
-
|
|
4436
|
-
|
|
4652
|
+
z19.object({
|
|
4653
|
+
type: z19.literal("file_search_call"),
|
|
4654
|
+
id: z19.string(),
|
|
4655
|
+
queries: z19.array(z19.string()),
|
|
4656
|
+
results: z19.array(
|
|
4657
|
+
z19.object({
|
|
4658
|
+
attributes: z19.record(
|
|
4659
|
+
z19.string(),
|
|
4660
|
+
z19.union([z19.string(), z19.number(), z19.boolean()])
|
|
4437
4661
|
),
|
|
4438
|
-
file_id:
|
|
4439
|
-
filename:
|
|
4440
|
-
score:
|
|
4441
|
-
text:
|
|
4662
|
+
file_id: z19.string(),
|
|
4663
|
+
filename: z19.string(),
|
|
4664
|
+
score: z19.number(),
|
|
4665
|
+
text: z19.string()
|
|
4442
4666
|
})
|
|
4443
4667
|
).nullish()
|
|
4444
4668
|
}),
|
|
4445
|
-
|
|
4446
|
-
type:
|
|
4447
|
-
id:
|
|
4448
|
-
call_id:
|
|
4449
|
-
action:
|
|
4450
|
-
type:
|
|
4451
|
-
command:
|
|
4452
|
-
timeout_ms:
|
|
4453
|
-
user:
|
|
4454
|
-
working_directory:
|
|
4455
|
-
env:
|
|
4669
|
+
z19.object({
|
|
4670
|
+
type: z19.literal("local_shell_call"),
|
|
4671
|
+
id: z19.string(),
|
|
4672
|
+
call_id: z19.string(),
|
|
4673
|
+
action: z19.object({
|
|
4674
|
+
type: z19.literal("exec"),
|
|
4675
|
+
command: z19.array(z19.string()),
|
|
4676
|
+
timeout_ms: z19.number().optional(),
|
|
4677
|
+
user: z19.string().optional(),
|
|
4678
|
+
working_directory: z19.string().optional(),
|
|
4679
|
+
env: z19.record(z19.string(), z19.string()).optional()
|
|
4456
4680
|
})
|
|
4457
4681
|
}),
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
z18.object({
|
|
4474
|
-
type: z18.string().optional(),
|
|
4475
|
-
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
4476
|
-
message: z18.string().optional()
|
|
4682
|
+
openaiResponsesComputerCallSchema,
|
|
4683
|
+
z19.object({
|
|
4684
|
+
type: z19.literal("mcp_call"),
|
|
4685
|
+
id: z19.string(),
|
|
4686
|
+
status: z19.string(),
|
|
4687
|
+
arguments: z19.string(),
|
|
4688
|
+
name: z19.string(),
|
|
4689
|
+
server_label: z19.string(),
|
|
4690
|
+
output: z19.string().nullish(),
|
|
4691
|
+
error: z19.union([
|
|
4692
|
+
z19.string(),
|
|
4693
|
+
z19.object({
|
|
4694
|
+
type: z19.string().optional(),
|
|
4695
|
+
code: z19.union([z19.number(), z19.string()]).optional(),
|
|
4696
|
+
message: z19.string().optional()
|
|
4477
4697
|
}).loose()
|
|
4478
4698
|
]).nullish(),
|
|
4479
|
-
approval_request_id:
|
|
4699
|
+
approval_request_id: z19.string().nullish()
|
|
4480
4700
|
}),
|
|
4481
|
-
|
|
4482
|
-
type:
|
|
4483
|
-
id:
|
|
4484
|
-
server_label:
|
|
4485
|
-
tools:
|
|
4486
|
-
|
|
4487
|
-
name:
|
|
4488
|
-
description:
|
|
4489
|
-
input_schema:
|
|
4490
|
-
annotations:
|
|
4701
|
+
z19.object({
|
|
4702
|
+
type: z19.literal("mcp_list_tools"),
|
|
4703
|
+
id: z19.string(),
|
|
4704
|
+
server_label: z19.string(),
|
|
4705
|
+
tools: z19.array(
|
|
4706
|
+
z19.object({
|
|
4707
|
+
name: z19.string(),
|
|
4708
|
+
description: z19.string().optional(),
|
|
4709
|
+
input_schema: z19.any(),
|
|
4710
|
+
annotations: z19.record(z19.string(), z19.unknown()).optional()
|
|
4491
4711
|
})
|
|
4492
4712
|
),
|
|
4493
|
-
error:
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
type:
|
|
4497
|
-
code:
|
|
4498
|
-
message:
|
|
4713
|
+
error: z19.union([
|
|
4714
|
+
z19.string(),
|
|
4715
|
+
z19.object({
|
|
4716
|
+
type: z19.string().optional(),
|
|
4717
|
+
code: z19.union([z19.number(), z19.string()]).optional(),
|
|
4718
|
+
message: z19.string().optional()
|
|
4499
4719
|
}).loose()
|
|
4500
4720
|
]).optional()
|
|
4501
4721
|
}),
|
|
4502
|
-
|
|
4503
|
-
type:
|
|
4504
|
-
id:
|
|
4505
|
-
server_label:
|
|
4506
|
-
name:
|
|
4507
|
-
arguments:
|
|
4508
|
-
approval_request_id:
|
|
4722
|
+
z19.object({
|
|
4723
|
+
type: z19.literal("mcp_approval_request"),
|
|
4724
|
+
id: z19.string(),
|
|
4725
|
+
server_label: z19.string(),
|
|
4726
|
+
name: z19.string(),
|
|
4727
|
+
arguments: z19.string(),
|
|
4728
|
+
approval_request_id: z19.string().optional()
|
|
4509
4729
|
}),
|
|
4510
|
-
|
|
4511
|
-
type:
|
|
4512
|
-
id:
|
|
4513
|
-
call_id:
|
|
4514
|
-
status:
|
|
4515
|
-
operation:
|
|
4516
|
-
|
|
4517
|
-
type:
|
|
4518
|
-
path:
|
|
4519
|
-
diff:
|
|
4730
|
+
z19.object({
|
|
4731
|
+
type: z19.literal("apply_patch_call"),
|
|
4732
|
+
id: z19.string(),
|
|
4733
|
+
call_id: z19.string(),
|
|
4734
|
+
status: z19.enum(["in_progress", "completed"]),
|
|
4735
|
+
operation: z19.discriminatedUnion("type", [
|
|
4736
|
+
z19.object({
|
|
4737
|
+
type: z19.literal("create_file"),
|
|
4738
|
+
path: z19.string(),
|
|
4739
|
+
diff: z19.string()
|
|
4520
4740
|
}),
|
|
4521
|
-
|
|
4522
|
-
type:
|
|
4523
|
-
path:
|
|
4741
|
+
z19.object({
|
|
4742
|
+
type: z19.literal("delete_file"),
|
|
4743
|
+
path: z19.string()
|
|
4524
4744
|
}),
|
|
4525
|
-
|
|
4526
|
-
type:
|
|
4527
|
-
path:
|
|
4528
|
-
diff:
|
|
4745
|
+
z19.object({
|
|
4746
|
+
type: z19.literal("update_file"),
|
|
4747
|
+
path: z19.string(),
|
|
4748
|
+
diff: z19.string()
|
|
4529
4749
|
})
|
|
4530
4750
|
])
|
|
4531
4751
|
}),
|
|
4532
|
-
|
|
4533
|
-
type:
|
|
4534
|
-
id:
|
|
4535
|
-
call_id:
|
|
4536
|
-
status:
|
|
4537
|
-
action:
|
|
4538
|
-
commands:
|
|
4752
|
+
z19.object({
|
|
4753
|
+
type: z19.literal("shell_call"),
|
|
4754
|
+
id: z19.string(),
|
|
4755
|
+
call_id: z19.string(),
|
|
4756
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4757
|
+
action: z19.object({
|
|
4758
|
+
commands: z19.array(z19.string())
|
|
4539
4759
|
})
|
|
4540
4760
|
}),
|
|
4541
|
-
|
|
4542
|
-
type:
|
|
4543
|
-
id:
|
|
4544
|
-
encrypted_content:
|
|
4761
|
+
z19.object({
|
|
4762
|
+
type: z19.literal("compaction"),
|
|
4763
|
+
id: z19.string(),
|
|
4764
|
+
encrypted_content: z19.string()
|
|
4545
4765
|
}),
|
|
4546
|
-
|
|
4547
|
-
type:
|
|
4548
|
-
id:
|
|
4549
|
-
call_id:
|
|
4550
|
-
status:
|
|
4551
|
-
output:
|
|
4552
|
-
|
|
4553
|
-
stdout:
|
|
4554
|
-
stderr:
|
|
4555
|
-
outcome:
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
type:
|
|
4559
|
-
exit_code:
|
|
4766
|
+
z19.object({
|
|
4767
|
+
type: z19.literal("shell_call_output"),
|
|
4768
|
+
id: z19.string(),
|
|
4769
|
+
call_id: z19.string(),
|
|
4770
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4771
|
+
output: z19.array(
|
|
4772
|
+
z19.object({
|
|
4773
|
+
stdout: z19.string(),
|
|
4774
|
+
stderr: z19.string(),
|
|
4775
|
+
outcome: z19.discriminatedUnion("type", [
|
|
4776
|
+
z19.object({ type: z19.literal("timeout") }),
|
|
4777
|
+
z19.object({
|
|
4778
|
+
type: z19.literal("exit"),
|
|
4779
|
+
exit_code: z19.number()
|
|
4560
4780
|
})
|
|
4561
4781
|
])
|
|
4562
4782
|
})
|
|
4563
4783
|
)
|
|
4564
4784
|
}),
|
|
4565
|
-
|
|
4566
|
-
type:
|
|
4567
|
-
id:
|
|
4568
|
-
execution:
|
|
4569
|
-
call_id:
|
|
4570
|
-
status:
|
|
4571
|
-
arguments:
|
|
4785
|
+
z19.object({
|
|
4786
|
+
type: z19.literal("tool_search_call"),
|
|
4787
|
+
id: z19.string(),
|
|
4788
|
+
execution: z19.enum(["server", "client"]),
|
|
4789
|
+
call_id: z19.string().nullable(),
|
|
4790
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4791
|
+
arguments: z19.unknown()
|
|
4572
4792
|
}),
|
|
4573
|
-
|
|
4574
|
-
type:
|
|
4575
|
-
id:
|
|
4576
|
-
execution:
|
|
4577
|
-
call_id:
|
|
4578
|
-
status:
|
|
4579
|
-
tools:
|
|
4793
|
+
z19.object({
|
|
4794
|
+
type: z19.literal("tool_search_output"),
|
|
4795
|
+
id: z19.string(),
|
|
4796
|
+
execution: z19.enum(["server", "client"]),
|
|
4797
|
+
call_id: z19.string().nullable(),
|
|
4798
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4799
|
+
tools: z19.array(z19.record(z19.string(), jsonValueSchema.optional()))
|
|
4580
4800
|
})
|
|
4581
4801
|
])
|
|
4582
4802
|
}),
|
|
4583
|
-
|
|
4584
|
-
type:
|
|
4585
|
-
item_id:
|
|
4586
|
-
output_index:
|
|
4587
|
-
delta:
|
|
4803
|
+
z19.object({
|
|
4804
|
+
type: z19.literal("response.function_call_arguments.delta"),
|
|
4805
|
+
item_id: z19.string(),
|
|
4806
|
+
output_index: z19.number(),
|
|
4807
|
+
delta: z19.string()
|
|
4588
4808
|
}),
|
|
4589
|
-
|
|
4590
|
-
type:
|
|
4591
|
-
item_id:
|
|
4592
|
-
output_index:
|
|
4593
|
-
delta:
|
|
4809
|
+
z19.object({
|
|
4810
|
+
type: z19.literal("response.custom_tool_call_input.delta"),
|
|
4811
|
+
item_id: z19.string(),
|
|
4812
|
+
output_index: z19.number(),
|
|
4813
|
+
delta: z19.string()
|
|
4594
4814
|
}),
|
|
4595
|
-
|
|
4596
|
-
type:
|
|
4597
|
-
item_id:
|
|
4598
|
-
output_index:
|
|
4599
|
-
partial_image_b64:
|
|
4815
|
+
z19.object({
|
|
4816
|
+
type: z19.literal("response.image_generation_call.partial_image"),
|
|
4817
|
+
item_id: z19.string(),
|
|
4818
|
+
output_index: z19.number(),
|
|
4819
|
+
partial_image_b64: z19.string()
|
|
4600
4820
|
}),
|
|
4601
|
-
|
|
4602
|
-
type:
|
|
4603
|
-
item_id:
|
|
4604
|
-
output_index:
|
|
4605
|
-
delta:
|
|
4821
|
+
z19.object({
|
|
4822
|
+
type: z19.literal("response.code_interpreter_call_code.delta"),
|
|
4823
|
+
item_id: z19.string(),
|
|
4824
|
+
output_index: z19.number(),
|
|
4825
|
+
delta: z19.string()
|
|
4606
4826
|
}),
|
|
4607
|
-
|
|
4608
|
-
type:
|
|
4609
|
-
item_id:
|
|
4610
|
-
output_index:
|
|
4611
|
-
code:
|
|
4827
|
+
z19.object({
|
|
4828
|
+
type: z19.literal("response.code_interpreter_call_code.done"),
|
|
4829
|
+
item_id: z19.string(),
|
|
4830
|
+
output_index: z19.number(),
|
|
4831
|
+
code: z19.string()
|
|
4612
4832
|
}),
|
|
4613
|
-
|
|
4614
|
-
type:
|
|
4615
|
-
annotation:
|
|
4616
|
-
|
|
4617
|
-
type:
|
|
4618
|
-
start_index:
|
|
4619
|
-
end_index:
|
|
4620
|
-
url:
|
|
4621
|
-
title:
|
|
4833
|
+
z19.object({
|
|
4834
|
+
type: z19.literal("response.output_text.annotation.added"),
|
|
4835
|
+
annotation: z19.discriminatedUnion("type", [
|
|
4836
|
+
z19.object({
|
|
4837
|
+
type: z19.literal("url_citation"),
|
|
4838
|
+
start_index: z19.number(),
|
|
4839
|
+
end_index: z19.number(),
|
|
4840
|
+
url: z19.string(),
|
|
4841
|
+
title: z19.string()
|
|
4622
4842
|
}),
|
|
4623
|
-
|
|
4624
|
-
type:
|
|
4625
|
-
file_id:
|
|
4626
|
-
filename:
|
|
4627
|
-
index:
|
|
4843
|
+
z19.object({
|
|
4844
|
+
type: z19.literal("file_citation"),
|
|
4845
|
+
file_id: z19.string(),
|
|
4846
|
+
filename: z19.string(),
|
|
4847
|
+
index: z19.number()
|
|
4628
4848
|
}),
|
|
4629
|
-
|
|
4630
|
-
type:
|
|
4631
|
-
container_id:
|
|
4632
|
-
file_id:
|
|
4633
|
-
filename:
|
|
4634
|
-
start_index:
|
|
4635
|
-
end_index:
|
|
4849
|
+
z19.object({
|
|
4850
|
+
type: z19.literal("container_file_citation"),
|
|
4851
|
+
container_id: z19.string(),
|
|
4852
|
+
file_id: z19.string(),
|
|
4853
|
+
filename: z19.string(),
|
|
4854
|
+
start_index: z19.number(),
|
|
4855
|
+
end_index: z19.number()
|
|
4636
4856
|
}),
|
|
4637
|
-
|
|
4638
|
-
type:
|
|
4639
|
-
file_id:
|
|
4640
|
-
index:
|
|
4857
|
+
z19.object({
|
|
4858
|
+
type: z19.literal("file_path"),
|
|
4859
|
+
file_id: z19.string(),
|
|
4860
|
+
index: z19.number()
|
|
4641
4861
|
})
|
|
4642
4862
|
])
|
|
4643
4863
|
}),
|
|
4644
|
-
|
|
4645
|
-
type:
|
|
4646
|
-
item_id:
|
|
4647
|
-
summary_index:
|
|
4864
|
+
z19.object({
|
|
4865
|
+
type: z19.literal("response.reasoning_summary_part.added"),
|
|
4866
|
+
item_id: z19.string(),
|
|
4867
|
+
summary_index: z19.number()
|
|
4648
4868
|
}),
|
|
4649
|
-
|
|
4650
|
-
type:
|
|
4651
|
-
item_id:
|
|
4652
|
-
summary_index:
|
|
4653
|
-
delta:
|
|
4869
|
+
z19.object({
|
|
4870
|
+
type: z19.literal("response.reasoning_summary_text.delta"),
|
|
4871
|
+
item_id: z19.string(),
|
|
4872
|
+
summary_index: z19.number(),
|
|
4873
|
+
delta: z19.string()
|
|
4654
4874
|
}),
|
|
4655
|
-
|
|
4656
|
-
type:
|
|
4657
|
-
item_id:
|
|
4658
|
-
summary_index:
|
|
4875
|
+
z19.object({
|
|
4876
|
+
type: z19.literal("response.reasoning_summary_part.done"),
|
|
4877
|
+
item_id: z19.string(),
|
|
4878
|
+
summary_index: z19.number()
|
|
4659
4879
|
}),
|
|
4660
|
-
|
|
4661
|
-
type:
|
|
4662
|
-
item_id:
|
|
4663
|
-
output_index:
|
|
4664
|
-
delta:
|
|
4665
|
-
obfuscation:
|
|
4880
|
+
z19.object({
|
|
4881
|
+
type: z19.literal("response.apply_patch_call_operation_diff.delta"),
|
|
4882
|
+
item_id: z19.string(),
|
|
4883
|
+
output_index: z19.number(),
|
|
4884
|
+
delta: z19.string(),
|
|
4885
|
+
obfuscation: z19.string().nullish()
|
|
4666
4886
|
}),
|
|
4667
|
-
|
|
4668
|
-
type:
|
|
4669
|
-
item_id:
|
|
4670
|
-
output_index:
|
|
4671
|
-
diff:
|
|
4887
|
+
z19.object({
|
|
4888
|
+
type: z19.literal("response.apply_patch_call_operation_diff.done"),
|
|
4889
|
+
item_id: z19.string(),
|
|
4890
|
+
output_index: z19.number(),
|
|
4891
|
+
diff: z19.string()
|
|
4672
4892
|
}),
|
|
4673
4893
|
openaiResponsesNestedErrorChunkSchema,
|
|
4674
4894
|
openaiResponsesErrorChunkSchema,
|
|
4675
|
-
|
|
4895
|
+
z19.object({ type: z19.string() }).loose().transform((value) => ({
|
|
4676
4896
|
type: "unknown_chunk",
|
|
4677
4897
|
message: value.type
|
|
4678
4898
|
}))
|
|
@@ -4680,319 +4900,315 @@ var openaiResponsesChunkSchema = lazySchema16(
|
|
|
4680
4900
|
])
|
|
4681
4901
|
)
|
|
4682
4902
|
);
|
|
4683
|
-
var openaiResponsesResponseSchema =
|
|
4684
|
-
() =>
|
|
4685
|
-
|
|
4686
|
-
id:
|
|
4687
|
-
created_at:
|
|
4688
|
-
error:
|
|
4689
|
-
message:
|
|
4690
|
-
type:
|
|
4691
|
-
param:
|
|
4692
|
-
code:
|
|
4903
|
+
var openaiResponsesResponseSchema = lazySchema17(
|
|
4904
|
+
() => zodSchema17(
|
|
4905
|
+
z19.object({
|
|
4906
|
+
id: z19.string().optional(),
|
|
4907
|
+
created_at: z19.number().optional(),
|
|
4908
|
+
error: z19.object({
|
|
4909
|
+
message: z19.string(),
|
|
4910
|
+
type: z19.string(),
|
|
4911
|
+
param: z19.string().nullish(),
|
|
4912
|
+
code: z19.string()
|
|
4693
4913
|
}).nullish(),
|
|
4694
|
-
model:
|
|
4695
|
-
output:
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
type:
|
|
4699
|
-
role:
|
|
4700
|
-
id:
|
|
4701
|
-
phase:
|
|
4702
|
-
content:
|
|
4703
|
-
|
|
4704
|
-
type:
|
|
4705
|
-
text:
|
|
4706
|
-
logprobs:
|
|
4707
|
-
|
|
4708
|
-
token:
|
|
4709
|
-
logprob:
|
|
4710
|
-
top_logprobs:
|
|
4711
|
-
|
|
4712
|
-
token:
|
|
4713
|
-
logprob:
|
|
4914
|
+
model: z19.string().optional(),
|
|
4915
|
+
output: z19.array(
|
|
4916
|
+
z19.discriminatedUnion("type", [
|
|
4917
|
+
z19.object({
|
|
4918
|
+
type: z19.literal("message"),
|
|
4919
|
+
role: z19.literal("assistant"),
|
|
4920
|
+
id: z19.string(),
|
|
4921
|
+
phase: z19.enum(["commentary", "final_answer"]).nullish(),
|
|
4922
|
+
content: z19.array(
|
|
4923
|
+
z19.object({
|
|
4924
|
+
type: z19.literal("output_text"),
|
|
4925
|
+
text: z19.string(),
|
|
4926
|
+
logprobs: z19.array(
|
|
4927
|
+
z19.object({
|
|
4928
|
+
token: z19.string(),
|
|
4929
|
+
logprob: z19.number(),
|
|
4930
|
+
top_logprobs: z19.array(
|
|
4931
|
+
z19.object({
|
|
4932
|
+
token: z19.string(),
|
|
4933
|
+
logprob: z19.number()
|
|
4714
4934
|
})
|
|
4715
4935
|
)
|
|
4716
4936
|
})
|
|
4717
4937
|
).nullish(),
|
|
4718
|
-
annotations:
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
type:
|
|
4722
|
-
start_index:
|
|
4723
|
-
end_index:
|
|
4724
|
-
url:
|
|
4725
|
-
title:
|
|
4938
|
+
annotations: z19.array(
|
|
4939
|
+
z19.discriminatedUnion("type", [
|
|
4940
|
+
z19.object({
|
|
4941
|
+
type: z19.literal("url_citation"),
|
|
4942
|
+
start_index: z19.number(),
|
|
4943
|
+
end_index: z19.number(),
|
|
4944
|
+
url: z19.string(),
|
|
4945
|
+
title: z19.string()
|
|
4726
4946
|
}),
|
|
4727
|
-
|
|
4728
|
-
type:
|
|
4729
|
-
file_id:
|
|
4730
|
-
filename:
|
|
4731
|
-
index:
|
|
4947
|
+
z19.object({
|
|
4948
|
+
type: z19.literal("file_citation"),
|
|
4949
|
+
file_id: z19.string(),
|
|
4950
|
+
filename: z19.string(),
|
|
4951
|
+
index: z19.number()
|
|
4732
4952
|
}),
|
|
4733
|
-
|
|
4734
|
-
type:
|
|
4735
|
-
container_id:
|
|
4736
|
-
file_id:
|
|
4737
|
-
filename:
|
|
4738
|
-
start_index:
|
|
4739
|
-
end_index:
|
|
4953
|
+
z19.object({
|
|
4954
|
+
type: z19.literal("container_file_citation"),
|
|
4955
|
+
container_id: z19.string(),
|
|
4956
|
+
file_id: z19.string(),
|
|
4957
|
+
filename: z19.string(),
|
|
4958
|
+
start_index: z19.number(),
|
|
4959
|
+
end_index: z19.number()
|
|
4740
4960
|
}),
|
|
4741
|
-
|
|
4742
|
-
type:
|
|
4743
|
-
file_id:
|
|
4744
|
-
index:
|
|
4961
|
+
z19.object({
|
|
4962
|
+
type: z19.literal("file_path"),
|
|
4963
|
+
file_id: z19.string(),
|
|
4964
|
+
index: z19.number()
|
|
4745
4965
|
})
|
|
4746
4966
|
])
|
|
4747
4967
|
)
|
|
4748
4968
|
})
|
|
4749
4969
|
)
|
|
4750
4970
|
}),
|
|
4751
|
-
|
|
4752
|
-
type:
|
|
4753
|
-
id:
|
|
4754
|
-
status:
|
|
4755
|
-
action:
|
|
4756
|
-
|
|
4757
|
-
type:
|
|
4758
|
-
query:
|
|
4759
|
-
queries:
|
|
4760
|
-
sources:
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
type:
|
|
4765
|
-
name:
|
|
4971
|
+
z19.object({
|
|
4972
|
+
type: z19.literal("web_search_call"),
|
|
4973
|
+
id: z19.string(),
|
|
4974
|
+
status: z19.string(),
|
|
4975
|
+
action: z19.discriminatedUnion("type", [
|
|
4976
|
+
z19.object({
|
|
4977
|
+
type: z19.literal("search"),
|
|
4978
|
+
query: z19.string().nullish(),
|
|
4979
|
+
queries: z19.array(z19.string()).nullish(),
|
|
4980
|
+
sources: z19.array(
|
|
4981
|
+
z19.discriminatedUnion("type", [
|
|
4982
|
+
z19.object({ type: z19.literal("url"), url: z19.string() }),
|
|
4983
|
+
z19.object({
|
|
4984
|
+
type: z19.literal("api"),
|
|
4985
|
+
name: z19.string()
|
|
4766
4986
|
})
|
|
4767
4987
|
])
|
|
4768
4988
|
).nullish()
|
|
4769
4989
|
}),
|
|
4770
|
-
|
|
4771
|
-
type:
|
|
4772
|
-
url:
|
|
4990
|
+
z19.object({
|
|
4991
|
+
type: z19.literal("open_page"),
|
|
4992
|
+
url: z19.string().nullish()
|
|
4773
4993
|
}),
|
|
4774
|
-
|
|
4775
|
-
type:
|
|
4776
|
-
url:
|
|
4777
|
-
pattern:
|
|
4994
|
+
z19.object({
|
|
4995
|
+
type: z19.literal("find_in_page"),
|
|
4996
|
+
url: z19.string().nullish(),
|
|
4997
|
+
pattern: z19.string().nullish()
|
|
4778
4998
|
})
|
|
4779
4999
|
]).nullish()
|
|
4780
5000
|
}),
|
|
4781
|
-
|
|
4782
|
-
type:
|
|
4783
|
-
id:
|
|
4784
|
-
queries:
|
|
4785
|
-
results:
|
|
4786
|
-
|
|
4787
|
-
attributes:
|
|
4788
|
-
|
|
4789
|
-
|
|
5001
|
+
z19.object({
|
|
5002
|
+
type: z19.literal("file_search_call"),
|
|
5003
|
+
id: z19.string(),
|
|
5004
|
+
queries: z19.array(z19.string()),
|
|
5005
|
+
results: z19.array(
|
|
5006
|
+
z19.object({
|
|
5007
|
+
attributes: z19.record(
|
|
5008
|
+
z19.string(),
|
|
5009
|
+
z19.union([z19.string(), z19.number(), z19.boolean()])
|
|
4790
5010
|
),
|
|
4791
|
-
file_id:
|
|
4792
|
-
filename:
|
|
4793
|
-
score:
|
|
4794
|
-
text:
|
|
5011
|
+
file_id: z19.string(),
|
|
5012
|
+
filename: z19.string(),
|
|
5013
|
+
score: z19.number(),
|
|
5014
|
+
text: z19.string()
|
|
4795
5015
|
})
|
|
4796
5016
|
).nullish()
|
|
4797
5017
|
}),
|
|
4798
|
-
|
|
4799
|
-
type:
|
|
4800
|
-
id:
|
|
4801
|
-
code:
|
|
4802
|
-
container_id:
|
|
4803
|
-
outputs:
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
5018
|
+
z19.object({
|
|
5019
|
+
type: z19.literal("code_interpreter_call"),
|
|
5020
|
+
id: z19.string(),
|
|
5021
|
+
code: z19.string().nullable(),
|
|
5022
|
+
container_id: z19.string(),
|
|
5023
|
+
outputs: z19.array(
|
|
5024
|
+
z19.discriminatedUnion("type", [
|
|
5025
|
+
z19.object({ type: z19.literal("logs"), logs: z19.string() }),
|
|
5026
|
+
z19.object({ type: z19.literal("image"), url: z19.string() })
|
|
4807
5027
|
])
|
|
4808
5028
|
).nullable()
|
|
4809
5029
|
}),
|
|
4810
|
-
|
|
4811
|
-
type:
|
|
4812
|
-
id:
|
|
4813
|
-
result:
|
|
5030
|
+
z19.object({
|
|
5031
|
+
type: z19.literal("image_generation_call"),
|
|
5032
|
+
id: z19.string(),
|
|
5033
|
+
result: z19.string()
|
|
4814
5034
|
}),
|
|
4815
|
-
|
|
4816
|
-
type:
|
|
4817
|
-
id:
|
|
4818
|
-
call_id:
|
|
4819
|
-
action:
|
|
4820
|
-
type:
|
|
4821
|
-
command:
|
|
4822
|
-
timeout_ms:
|
|
4823
|
-
user:
|
|
4824
|
-
working_directory:
|
|
4825
|
-
env:
|
|
5035
|
+
z19.object({
|
|
5036
|
+
type: z19.literal("local_shell_call"),
|
|
5037
|
+
id: z19.string(),
|
|
5038
|
+
call_id: z19.string(),
|
|
5039
|
+
action: z19.object({
|
|
5040
|
+
type: z19.literal("exec"),
|
|
5041
|
+
command: z19.array(z19.string()),
|
|
5042
|
+
timeout_ms: z19.number().optional(),
|
|
5043
|
+
user: z19.string().optional(),
|
|
5044
|
+
working_directory: z19.string().optional(),
|
|
5045
|
+
env: z19.record(z19.string(), z19.string()).optional()
|
|
4826
5046
|
})
|
|
4827
5047
|
}),
|
|
4828
|
-
|
|
4829
|
-
type:
|
|
4830
|
-
call_id:
|
|
4831
|
-
name:
|
|
4832
|
-
arguments:
|
|
4833
|
-
id:
|
|
4834
|
-
namespace:
|
|
4835
|
-
}),
|
|
4836
|
-
z18.object({
|
|
4837
|
-
type: z18.literal("custom_tool_call"),
|
|
4838
|
-
call_id: z18.string(),
|
|
4839
|
-
name: z18.string(),
|
|
4840
|
-
input: z18.string(),
|
|
4841
|
-
id: z18.string()
|
|
5048
|
+
z19.object({
|
|
5049
|
+
type: z19.literal("function_call"),
|
|
5050
|
+
call_id: z19.string(),
|
|
5051
|
+
name: z19.string(),
|
|
5052
|
+
arguments: z19.string(),
|
|
5053
|
+
id: z19.string(),
|
|
5054
|
+
namespace: z19.string().nullish()
|
|
4842
5055
|
}),
|
|
4843
|
-
|
|
4844
|
-
type:
|
|
4845
|
-
|
|
4846
|
-
|
|
5056
|
+
z19.object({
|
|
5057
|
+
type: z19.literal("custom_tool_call"),
|
|
5058
|
+
call_id: z19.string(),
|
|
5059
|
+
name: z19.string(),
|
|
5060
|
+
input: z19.string(),
|
|
5061
|
+
id: z19.string()
|
|
4847
5062
|
}),
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
5063
|
+
openaiResponsesComputerCallSchema,
|
|
5064
|
+
z19.object({
|
|
5065
|
+
type: z19.literal("reasoning"),
|
|
5066
|
+
id: z19.string(),
|
|
5067
|
+
encrypted_content: z19.string().nullish(),
|
|
5068
|
+
summary: z19.array(
|
|
5069
|
+
z19.object({
|
|
5070
|
+
type: z19.literal("summary_text"),
|
|
5071
|
+
text: z19.string()
|
|
4856
5072
|
})
|
|
4857
5073
|
)
|
|
4858
5074
|
}),
|
|
4859
|
-
|
|
4860
|
-
type:
|
|
4861
|
-
id:
|
|
4862
|
-
status:
|
|
4863
|
-
arguments:
|
|
4864
|
-
name:
|
|
4865
|
-
server_label:
|
|
4866
|
-
output:
|
|
4867
|
-
error:
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
type:
|
|
4871
|
-
code:
|
|
4872
|
-
message:
|
|
5075
|
+
z19.object({
|
|
5076
|
+
type: z19.literal("mcp_call"),
|
|
5077
|
+
id: z19.string(),
|
|
5078
|
+
status: z19.string(),
|
|
5079
|
+
arguments: z19.string(),
|
|
5080
|
+
name: z19.string(),
|
|
5081
|
+
server_label: z19.string(),
|
|
5082
|
+
output: z19.string().nullish(),
|
|
5083
|
+
error: z19.union([
|
|
5084
|
+
z19.string(),
|
|
5085
|
+
z19.object({
|
|
5086
|
+
type: z19.string().optional(),
|
|
5087
|
+
code: z19.union([z19.number(), z19.string()]).optional(),
|
|
5088
|
+
message: z19.string().optional()
|
|
4873
5089
|
}).loose()
|
|
4874
5090
|
]).nullish(),
|
|
4875
|
-
approval_request_id:
|
|
5091
|
+
approval_request_id: z19.string().nullish()
|
|
4876
5092
|
}),
|
|
4877
|
-
|
|
4878
|
-
type:
|
|
4879
|
-
id:
|
|
4880
|
-
server_label:
|
|
4881
|
-
tools:
|
|
4882
|
-
|
|
4883
|
-
name:
|
|
4884
|
-
description:
|
|
4885
|
-
input_schema:
|
|
4886
|
-
annotations:
|
|
5093
|
+
z19.object({
|
|
5094
|
+
type: z19.literal("mcp_list_tools"),
|
|
5095
|
+
id: z19.string(),
|
|
5096
|
+
server_label: z19.string(),
|
|
5097
|
+
tools: z19.array(
|
|
5098
|
+
z19.object({
|
|
5099
|
+
name: z19.string(),
|
|
5100
|
+
description: z19.string().optional(),
|
|
5101
|
+
input_schema: z19.any(),
|
|
5102
|
+
annotations: z19.record(z19.string(), z19.unknown()).optional()
|
|
4887
5103
|
})
|
|
4888
5104
|
),
|
|
4889
|
-
error:
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
type:
|
|
4893
|
-
code:
|
|
4894
|
-
message:
|
|
5105
|
+
error: z19.union([
|
|
5106
|
+
z19.string(),
|
|
5107
|
+
z19.object({
|
|
5108
|
+
type: z19.string().optional(),
|
|
5109
|
+
code: z19.union([z19.number(), z19.string()]).optional(),
|
|
5110
|
+
message: z19.string().optional()
|
|
4895
5111
|
}).loose()
|
|
4896
5112
|
]).optional()
|
|
4897
5113
|
}),
|
|
4898
|
-
|
|
4899
|
-
type:
|
|
4900
|
-
id:
|
|
4901
|
-
server_label:
|
|
4902
|
-
name:
|
|
4903
|
-
arguments:
|
|
4904
|
-
approval_request_id:
|
|
5114
|
+
z19.object({
|
|
5115
|
+
type: z19.literal("mcp_approval_request"),
|
|
5116
|
+
id: z19.string(),
|
|
5117
|
+
server_label: z19.string(),
|
|
5118
|
+
name: z19.string(),
|
|
5119
|
+
arguments: z19.string(),
|
|
5120
|
+
approval_request_id: z19.string().optional()
|
|
4905
5121
|
}),
|
|
4906
|
-
|
|
4907
|
-
type:
|
|
4908
|
-
id:
|
|
4909
|
-
call_id:
|
|
4910
|
-
status:
|
|
4911
|
-
operation:
|
|
4912
|
-
|
|
4913
|
-
type:
|
|
4914
|
-
path:
|
|
4915
|
-
diff:
|
|
5122
|
+
z19.object({
|
|
5123
|
+
type: z19.literal("apply_patch_call"),
|
|
5124
|
+
id: z19.string(),
|
|
5125
|
+
call_id: z19.string(),
|
|
5126
|
+
status: z19.enum(["in_progress", "completed"]),
|
|
5127
|
+
operation: z19.discriminatedUnion("type", [
|
|
5128
|
+
z19.object({
|
|
5129
|
+
type: z19.literal("create_file"),
|
|
5130
|
+
path: z19.string(),
|
|
5131
|
+
diff: z19.string()
|
|
4916
5132
|
}),
|
|
4917
|
-
|
|
4918
|
-
type:
|
|
4919
|
-
path:
|
|
5133
|
+
z19.object({
|
|
5134
|
+
type: z19.literal("delete_file"),
|
|
5135
|
+
path: z19.string()
|
|
4920
5136
|
}),
|
|
4921
|
-
|
|
4922
|
-
type:
|
|
4923
|
-
path:
|
|
4924
|
-
diff:
|
|
5137
|
+
z19.object({
|
|
5138
|
+
type: z19.literal("update_file"),
|
|
5139
|
+
path: z19.string(),
|
|
5140
|
+
diff: z19.string()
|
|
4925
5141
|
})
|
|
4926
5142
|
])
|
|
4927
5143
|
}),
|
|
4928
|
-
|
|
4929
|
-
type:
|
|
4930
|
-
id:
|
|
4931
|
-
call_id:
|
|
4932
|
-
status:
|
|
4933
|
-
action:
|
|
4934
|
-
commands:
|
|
5144
|
+
z19.object({
|
|
5145
|
+
type: z19.literal("shell_call"),
|
|
5146
|
+
id: z19.string(),
|
|
5147
|
+
call_id: z19.string(),
|
|
5148
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
5149
|
+
action: z19.object({
|
|
5150
|
+
commands: z19.array(z19.string())
|
|
4935
5151
|
})
|
|
4936
5152
|
}),
|
|
4937
|
-
|
|
4938
|
-
type:
|
|
4939
|
-
id:
|
|
4940
|
-
encrypted_content:
|
|
5153
|
+
z19.object({
|
|
5154
|
+
type: z19.literal("compaction"),
|
|
5155
|
+
id: z19.string(),
|
|
5156
|
+
encrypted_content: z19.string()
|
|
4941
5157
|
}),
|
|
4942
|
-
|
|
4943
|
-
type:
|
|
4944
|
-
id:
|
|
4945
|
-
call_id:
|
|
4946
|
-
status:
|
|
4947
|
-
output:
|
|
4948
|
-
|
|
4949
|
-
stdout:
|
|
4950
|
-
stderr:
|
|
4951
|
-
outcome:
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
type:
|
|
4955
|
-
exit_code:
|
|
5158
|
+
z19.object({
|
|
5159
|
+
type: z19.literal("shell_call_output"),
|
|
5160
|
+
id: z19.string(),
|
|
5161
|
+
call_id: z19.string(),
|
|
5162
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
5163
|
+
output: z19.array(
|
|
5164
|
+
z19.object({
|
|
5165
|
+
stdout: z19.string(),
|
|
5166
|
+
stderr: z19.string(),
|
|
5167
|
+
outcome: z19.discriminatedUnion("type", [
|
|
5168
|
+
z19.object({ type: z19.literal("timeout") }),
|
|
5169
|
+
z19.object({
|
|
5170
|
+
type: z19.literal("exit"),
|
|
5171
|
+
exit_code: z19.number()
|
|
4956
5172
|
})
|
|
4957
5173
|
])
|
|
4958
5174
|
})
|
|
4959
5175
|
)
|
|
4960
5176
|
}),
|
|
4961
|
-
|
|
4962
|
-
type:
|
|
4963
|
-
id:
|
|
4964
|
-
execution:
|
|
4965
|
-
call_id:
|
|
4966
|
-
status:
|
|
4967
|
-
arguments:
|
|
5177
|
+
z19.object({
|
|
5178
|
+
type: z19.literal("tool_search_call"),
|
|
5179
|
+
id: z19.string(),
|
|
5180
|
+
execution: z19.enum(["server", "client"]),
|
|
5181
|
+
call_id: z19.string().nullable(),
|
|
5182
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
5183
|
+
arguments: z19.unknown()
|
|
4968
5184
|
}),
|
|
4969
|
-
|
|
4970
|
-
type:
|
|
4971
|
-
id:
|
|
4972
|
-
execution:
|
|
4973
|
-
call_id:
|
|
4974
|
-
status:
|
|
4975
|
-
tools:
|
|
5185
|
+
z19.object({
|
|
5186
|
+
type: z19.literal("tool_search_output"),
|
|
5187
|
+
id: z19.string(),
|
|
5188
|
+
execution: z19.enum(["server", "client"]),
|
|
5189
|
+
call_id: z19.string().nullable(),
|
|
5190
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
5191
|
+
tools: z19.array(z19.record(z19.string(), jsonValueSchema.optional()))
|
|
4976
5192
|
})
|
|
4977
5193
|
])
|
|
4978
5194
|
).optional(),
|
|
4979
|
-
service_tier:
|
|
4980
|
-
reasoning:
|
|
4981
|
-
context:
|
|
5195
|
+
service_tier: z19.string().nullish(),
|
|
5196
|
+
reasoning: z19.object({
|
|
5197
|
+
context: z19.string().nullish()
|
|
4982
5198
|
}).nullish(),
|
|
4983
|
-
incomplete_details:
|
|
4984
|
-
usage:
|
|
4985
|
-
input_tokens:
|
|
4986
|
-
input_tokens_details:
|
|
4987
|
-
cached_tokens:
|
|
4988
|
-
cache_write_tokens:
|
|
4989
|
-
orchestration_input_tokens:
|
|
4990
|
-
orchestration_input_cached_tokens:
|
|
5199
|
+
incomplete_details: z19.object({ reason: z19.string() }).nullish(),
|
|
5200
|
+
usage: z19.object({
|
|
5201
|
+
input_tokens: z19.number(),
|
|
5202
|
+
input_tokens_details: z19.object({
|
|
5203
|
+
cached_tokens: z19.number().nullish(),
|
|
5204
|
+
cache_write_tokens: z19.number().nullish(),
|
|
5205
|
+
orchestration_input_tokens: z19.number().nullish(),
|
|
5206
|
+
orchestration_input_cached_tokens: z19.number().nullish()
|
|
4991
5207
|
}).nullish(),
|
|
4992
|
-
output_tokens:
|
|
4993
|
-
output_tokens_details:
|
|
4994
|
-
reasoning_tokens:
|
|
4995
|
-
orchestration_output_tokens:
|
|
5208
|
+
output_tokens: z19.number(),
|
|
5209
|
+
output_tokens_details: z19.object({
|
|
5210
|
+
reasoning_tokens: z19.number().nullish(),
|
|
5211
|
+
orchestration_output_tokens: z19.number().nullish()
|
|
4996
5212
|
}).nullish()
|
|
4997
5213
|
}).optional()
|
|
4998
5214
|
})
|
|
@@ -5001,10 +5217,10 @@ var openaiResponsesResponseSchema = lazySchema16(
|
|
|
5001
5217
|
|
|
5002
5218
|
// src/responses/openai-responses-language-model-options.ts
|
|
5003
5219
|
import {
|
|
5004
|
-
lazySchema as
|
|
5005
|
-
zodSchema as
|
|
5220
|
+
lazySchema as lazySchema18,
|
|
5221
|
+
zodSchema as zodSchema18
|
|
5006
5222
|
} from "@ai-sdk/provider-utils";
|
|
5007
|
-
import { z as
|
|
5223
|
+
import { z as z20 } from "zod/v4";
|
|
5008
5224
|
var TOP_LOGPROBS_MAX = 20;
|
|
5009
5225
|
var openaiResponsesReasoningModelIds = [
|
|
5010
5226
|
"o1",
|
|
@@ -5075,9 +5291,9 @@ var openaiResponsesModelIds = [
|
|
|
5075
5291
|
"gpt-5-chat-latest",
|
|
5076
5292
|
...openaiResponsesReasoningModelIds
|
|
5077
5293
|
];
|
|
5078
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
5079
|
-
() =>
|
|
5080
|
-
|
|
5294
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
5295
|
+
() => zodSchema18(
|
|
5296
|
+
z20.object({
|
|
5081
5297
|
/**
|
|
5082
5298
|
* The ID of the OpenAI Conversation to continue.
|
|
5083
5299
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -5085,13 +5301,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
|
5085
5301
|
* Defaults to `undefined`.
|
|
5086
5302
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
5087
5303
|
*/
|
|
5088
|
-
conversation:
|
|
5304
|
+
conversation: z20.string().nullish(),
|
|
5089
5305
|
/**
|
|
5090
5306
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
5091
5307
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
|
|
5092
5308
|
*/
|
|
5093
|
-
include:
|
|
5094
|
-
|
|
5309
|
+
include: z20.array(
|
|
5310
|
+
z20.enum([
|
|
5095
5311
|
"reasoning.encrypted_content",
|
|
5096
5312
|
// handled internally by default, only needed for unknown reasoning models
|
|
5097
5313
|
"file_search_call.results",
|
|
@@ -5104,7 +5320,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
|
5104
5320
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
5105
5321
|
* Defaults to `undefined`.
|
|
5106
5322
|
*/
|
|
5107
|
-
instructions:
|
|
5323
|
+
instructions: z20.string().nullish(),
|
|
5108
5324
|
/**
|
|
5109
5325
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
5110
5326
|
* the response size and can slow down response times. However, it can
|
|
@@ -5119,38 +5335,38 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
|
5119
5335
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
5120
5336
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
5121
5337
|
*/
|
|
5122
|
-
logprobs:
|
|
5338
|
+
logprobs: z20.union([z20.boolean(), z20.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
5123
5339
|
/**
|
|
5124
5340
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
5125
5341
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
5126
5342
|
* Any further attempts to call a tool by the model will be ignored.
|
|
5127
5343
|
*/
|
|
5128
|
-
maxToolCalls:
|
|
5344
|
+
maxToolCalls: z20.number().nullish(),
|
|
5129
5345
|
/**
|
|
5130
5346
|
* Additional metadata to store with the generation.
|
|
5131
5347
|
*/
|
|
5132
|
-
metadata:
|
|
5348
|
+
metadata: z20.any().nullish(),
|
|
5133
5349
|
/**
|
|
5134
5350
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
5135
5351
|
*/
|
|
5136
|
-
parallelToolCalls:
|
|
5352
|
+
parallelToolCalls: z20.boolean().nullish(),
|
|
5137
5353
|
/**
|
|
5138
5354
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
5139
5355
|
* Defaults to `undefined`.
|
|
5140
5356
|
*/
|
|
5141
|
-
previousResponseId:
|
|
5357
|
+
previousResponseId: z20.string().nullish(),
|
|
5142
5358
|
/**
|
|
5143
5359
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
5144
5360
|
*/
|
|
5145
|
-
promptCacheKey:
|
|
5361
|
+
promptCacheKey: z20.string().nullish(),
|
|
5146
5362
|
/**
|
|
5147
5363
|
* Prompt cache behavior for GPT-5.6 and later models.
|
|
5148
5364
|
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
5149
5365
|
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
5150
5366
|
*/
|
|
5151
|
-
promptCacheOptions:
|
|
5152
|
-
mode:
|
|
5153
|
-
ttl:
|
|
5367
|
+
promptCacheOptions: z20.object({
|
|
5368
|
+
mode: z20.enum(["implicit", "explicit"]).optional(),
|
|
5369
|
+
ttl: z20.literal("30m").optional()
|
|
5154
5370
|
}).optional(),
|
|
5155
5371
|
/**
|
|
5156
5372
|
* The retention policy for the prompt cache.
|
|
@@ -5162,35 +5378,35 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
|
5162
5378
|
*
|
|
5163
5379
|
* @default 'in_memory'
|
|
5164
5380
|
*/
|
|
5165
|
-
promptCacheRetention:
|
|
5381
|
+
promptCacheRetention: z20.enum(["in_memory", "24h"]).nullish(),
|
|
5166
5382
|
/**
|
|
5167
5383
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
5168
5384
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
5169
5385
|
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
5170
5386
|
* Supported values vary by model.
|
|
5171
5387
|
*/
|
|
5172
|
-
reasoningEffort:
|
|
5388
|
+
reasoningEffort: z20.string().nullish(),
|
|
5173
5389
|
/**
|
|
5174
5390
|
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
5175
5391
|
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
5176
5392
|
*/
|
|
5177
|
-
reasoningMode:
|
|
5393
|
+
reasoningMode: z20.enum(["standard", "pro"]).optional(),
|
|
5178
5394
|
/**
|
|
5179
5395
|
* Controls which available reasoning items GPT-5.6 can use.
|
|
5180
5396
|
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
5181
5397
|
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
5182
5398
|
*/
|
|
5183
|
-
reasoningContext:
|
|
5399
|
+
reasoningContext: z20.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
5184
5400
|
/**
|
|
5185
5401
|
* Controls reasoning summary output from the model.
|
|
5186
5402
|
* Set to "auto" to automatically receive the richest level available,
|
|
5187
5403
|
* or "detailed" for comprehensive summaries.
|
|
5188
5404
|
*/
|
|
5189
|
-
reasoningSummary:
|
|
5405
|
+
reasoningSummary: z20.string().nullish(),
|
|
5190
5406
|
/**
|
|
5191
5407
|
* The identifier for safety monitoring and tracking.
|
|
5192
5408
|
*/
|
|
5193
|
-
safetyIdentifier:
|
|
5409
|
+
safetyIdentifier: z20.string().nullish(),
|
|
5194
5410
|
/**
|
|
5195
5411
|
* Service tier for the request.
|
|
5196
5412
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -5198,11 +5414,11 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
|
5198
5414
|
*
|
|
5199
5415
|
* Defaults to 'auto'.
|
|
5200
5416
|
*/
|
|
5201
|
-
serviceTier:
|
|
5417
|
+
serviceTier: z20.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
5202
5418
|
/**
|
|
5203
5419
|
* Whether to store the generation. Defaults to `true`.
|
|
5204
5420
|
*/
|
|
5205
|
-
store:
|
|
5421
|
+
store: z20.boolean().nullish(),
|
|
5206
5422
|
/**
|
|
5207
5423
|
* Whether to pass through non-image file types as generic input files.
|
|
5208
5424
|
*
|
|
@@ -5210,30 +5426,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
|
5210
5426
|
* Enable this when the target OpenAI Responses model supports additional
|
|
5211
5427
|
* file media types, such as text/csv.
|
|
5212
5428
|
*/
|
|
5213
|
-
passThroughUnsupportedFiles:
|
|
5429
|
+
passThroughUnsupportedFiles: z20.boolean().optional(),
|
|
5214
5430
|
/**
|
|
5215
5431
|
* Whether to use strict JSON schema validation.
|
|
5216
5432
|
* Defaults to `true`.
|
|
5217
5433
|
*/
|
|
5218
|
-
strictJsonSchema:
|
|
5434
|
+
strictJsonSchema: z20.boolean().nullish(),
|
|
5219
5435
|
/**
|
|
5220
5436
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
5221
5437
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
5222
5438
|
* Valid values: 'low', 'medium', 'high'.
|
|
5223
5439
|
*/
|
|
5224
|
-
textVerbosity:
|
|
5440
|
+
textVerbosity: z20.enum(["low", "medium", "high"]).nullish(),
|
|
5225
5441
|
/**
|
|
5226
5442
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
5227
5443
|
* 'disabled' turns truncation off.
|
|
5228
5444
|
*/
|
|
5229
|
-
truncation:
|
|
5445
|
+
truncation: z20.enum(["auto", "disabled"]).nullish(),
|
|
5230
5446
|
/**
|
|
5231
5447
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
5232
5448
|
* monitor and detect abuse.
|
|
5233
5449
|
* Defaults to `undefined`.
|
|
5234
5450
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
5235
5451
|
*/
|
|
5236
|
-
user:
|
|
5452
|
+
user: z20.string().nullish(),
|
|
5237
5453
|
/**
|
|
5238
5454
|
* Override the system message mode for this model.
|
|
5239
5455
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -5242,7 +5458,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
|
5242
5458
|
*
|
|
5243
5459
|
* If not specified, the mode is automatically determined based on the model.
|
|
5244
5460
|
*/
|
|
5245
|
-
systemMessageMode:
|
|
5461
|
+
systemMessageMode: z20.enum(["system", "developer", "remove"]).optional(),
|
|
5246
5462
|
/**
|
|
5247
5463
|
* Force treating this model as a reasoning model.
|
|
5248
5464
|
*
|
|
@@ -5252,14 +5468,14 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
|
5252
5468
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
5253
5469
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
5254
5470
|
*/
|
|
5255
|
-
forceReasoning:
|
|
5471
|
+
forceReasoning: z20.boolean().optional(),
|
|
5256
5472
|
/**
|
|
5257
5473
|
* Enable server-side context management (compaction).
|
|
5258
5474
|
*/
|
|
5259
|
-
contextManagement:
|
|
5260
|
-
|
|
5261
|
-
type:
|
|
5262
|
-
compactThreshold:
|
|
5475
|
+
contextManagement: z20.array(
|
|
5476
|
+
z20.object({
|
|
5477
|
+
type: z20.literal("compaction"),
|
|
5478
|
+
compactThreshold: z20.number()
|
|
5263
5479
|
})
|
|
5264
5480
|
).nullish(),
|
|
5265
5481
|
/**
|
|
@@ -5272,9 +5488,9 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
|
5272
5488
|
*
|
|
5273
5489
|
* @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
|
|
5274
5490
|
*/
|
|
5275
|
-
allowedTools:
|
|
5276
|
-
toolNames:
|
|
5277
|
-
mode:
|
|
5491
|
+
allowedTools: z20.object({
|
|
5492
|
+
toolNames: z20.array(z20.string()).min(1),
|
|
5493
|
+
mode: z20.enum(["auto", "required"]).optional()
|
|
5278
5494
|
}).optional()
|
|
5279
5495
|
})
|
|
5280
5496
|
)
|
|
@@ -5292,37 +5508,37 @@ import {
|
|
|
5292
5508
|
// src/tool/code-interpreter.ts
|
|
5293
5509
|
import {
|
|
5294
5510
|
createProviderExecutedToolFactory,
|
|
5295
|
-
lazySchema as
|
|
5296
|
-
zodSchema as
|
|
5511
|
+
lazySchema as lazySchema19,
|
|
5512
|
+
zodSchema as zodSchema19
|
|
5297
5513
|
} from "@ai-sdk/provider-utils";
|
|
5298
|
-
import { z as
|
|
5299
|
-
var codeInterpreterInputSchema =
|
|
5300
|
-
() =>
|
|
5301
|
-
|
|
5302
|
-
code:
|
|
5303
|
-
containerId:
|
|
5514
|
+
import { z as z21 } from "zod/v4";
|
|
5515
|
+
var codeInterpreterInputSchema = lazySchema19(
|
|
5516
|
+
() => zodSchema19(
|
|
5517
|
+
z21.object({
|
|
5518
|
+
code: z21.string().nullish(),
|
|
5519
|
+
containerId: z21.string()
|
|
5304
5520
|
})
|
|
5305
5521
|
)
|
|
5306
5522
|
);
|
|
5307
|
-
var codeInterpreterOutputSchema =
|
|
5308
|
-
() =>
|
|
5309
|
-
|
|
5310
|
-
outputs:
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5523
|
+
var codeInterpreterOutputSchema = lazySchema19(
|
|
5524
|
+
() => zodSchema19(
|
|
5525
|
+
z21.object({
|
|
5526
|
+
outputs: z21.array(
|
|
5527
|
+
z21.discriminatedUnion("type", [
|
|
5528
|
+
z21.object({ type: z21.literal("logs"), logs: z21.string() }),
|
|
5529
|
+
z21.object({ type: z21.literal("image"), url: z21.string() })
|
|
5314
5530
|
])
|
|
5315
5531
|
).nullish()
|
|
5316
5532
|
})
|
|
5317
5533
|
)
|
|
5318
5534
|
);
|
|
5319
|
-
var codeInterpreterArgsSchema =
|
|
5320
|
-
() =>
|
|
5321
|
-
|
|
5322
|
-
container:
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
fileIds:
|
|
5535
|
+
var codeInterpreterArgsSchema = lazySchema19(
|
|
5536
|
+
() => zodSchema19(
|
|
5537
|
+
z21.object({
|
|
5538
|
+
container: z21.union([
|
|
5539
|
+
z21.string(),
|
|
5540
|
+
z21.object({
|
|
5541
|
+
fileIds: z21.array(z21.string()).optional()
|
|
5326
5542
|
})
|
|
5327
5543
|
]).optional()
|
|
5328
5544
|
})
|
|
@@ -5340,45 +5556,45 @@ var codeInterpreter = (args = {}) => {
|
|
|
5340
5556
|
// src/tool/file-search.ts
|
|
5341
5557
|
import {
|
|
5342
5558
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
|
|
5343
|
-
lazySchema as
|
|
5344
|
-
zodSchema as
|
|
5559
|
+
lazySchema as lazySchema20,
|
|
5560
|
+
zodSchema as zodSchema20
|
|
5345
5561
|
} from "@ai-sdk/provider-utils";
|
|
5346
|
-
import { z as
|
|
5347
|
-
var comparisonFilterSchema =
|
|
5348
|
-
key:
|
|
5349
|
-
type:
|
|
5350
|
-
value:
|
|
5562
|
+
import { z as z22 } from "zod/v4";
|
|
5563
|
+
var comparisonFilterSchema = z22.object({
|
|
5564
|
+
key: z22.string(),
|
|
5565
|
+
type: z22.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
5566
|
+
value: z22.union([z22.string(), z22.number(), z22.boolean(), z22.array(z22.string())])
|
|
5351
5567
|
});
|
|
5352
|
-
var compoundFilterSchema =
|
|
5353
|
-
type:
|
|
5354
|
-
filters:
|
|
5355
|
-
|
|
5568
|
+
var compoundFilterSchema = z22.object({
|
|
5569
|
+
type: z22.enum(["and", "or"]),
|
|
5570
|
+
filters: z22.array(
|
|
5571
|
+
z22.union([comparisonFilterSchema, z22.lazy(() => compoundFilterSchema)])
|
|
5356
5572
|
)
|
|
5357
5573
|
});
|
|
5358
|
-
var fileSearchArgsSchema =
|
|
5359
|
-
() =>
|
|
5360
|
-
|
|
5361
|
-
vectorStoreIds:
|
|
5362
|
-
maxNumResults:
|
|
5363
|
-
ranking:
|
|
5364
|
-
ranker:
|
|
5365
|
-
scoreThreshold:
|
|
5574
|
+
var fileSearchArgsSchema = lazySchema20(
|
|
5575
|
+
() => zodSchema20(
|
|
5576
|
+
z22.object({
|
|
5577
|
+
vectorStoreIds: z22.array(z22.string()),
|
|
5578
|
+
maxNumResults: z22.number().optional(),
|
|
5579
|
+
ranking: z22.object({
|
|
5580
|
+
ranker: z22.string().optional(),
|
|
5581
|
+
scoreThreshold: z22.number().optional()
|
|
5366
5582
|
}).optional(),
|
|
5367
|
-
filters:
|
|
5583
|
+
filters: z22.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
5368
5584
|
})
|
|
5369
5585
|
)
|
|
5370
5586
|
);
|
|
5371
|
-
var fileSearchOutputSchema =
|
|
5372
|
-
() =>
|
|
5373
|
-
|
|
5374
|
-
queries:
|
|
5375
|
-
results:
|
|
5376
|
-
|
|
5377
|
-
attributes:
|
|
5378
|
-
fileId:
|
|
5379
|
-
filename:
|
|
5380
|
-
score:
|
|
5381
|
-
text:
|
|
5587
|
+
var fileSearchOutputSchema = lazySchema20(
|
|
5588
|
+
() => zodSchema20(
|
|
5589
|
+
z22.object({
|
|
5590
|
+
queries: z22.array(z22.string()),
|
|
5591
|
+
results: z22.array(
|
|
5592
|
+
z22.object({
|
|
5593
|
+
attributes: z22.record(z22.string(), z22.unknown()),
|
|
5594
|
+
fileId: z22.string(),
|
|
5595
|
+
filename: z22.string(),
|
|
5596
|
+
score: z22.number(),
|
|
5597
|
+
text: z22.string()
|
|
5382
5598
|
})
|
|
5383
5599
|
).nullable()
|
|
5384
5600
|
})
|
|
@@ -5386,39 +5602,39 @@ var fileSearchOutputSchema = lazySchema19(
|
|
|
5386
5602
|
);
|
|
5387
5603
|
var fileSearch = createProviderExecutedToolFactory2({
|
|
5388
5604
|
id: "openai.file_search",
|
|
5389
|
-
inputSchema:
|
|
5605
|
+
inputSchema: z22.object({}),
|
|
5390
5606
|
outputSchema: fileSearchOutputSchema
|
|
5391
5607
|
});
|
|
5392
5608
|
|
|
5393
5609
|
// src/tool/image-generation.ts
|
|
5394
5610
|
import {
|
|
5395
5611
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
|
|
5396
|
-
lazySchema as
|
|
5397
|
-
zodSchema as
|
|
5612
|
+
lazySchema as lazySchema21,
|
|
5613
|
+
zodSchema as zodSchema21
|
|
5398
5614
|
} from "@ai-sdk/provider-utils";
|
|
5399
|
-
import { z as
|
|
5400
|
-
var imageGenerationArgsSchema =
|
|
5401
|
-
() =>
|
|
5402
|
-
|
|
5403
|
-
background:
|
|
5404
|
-
inputFidelity:
|
|
5405
|
-
inputImageMask:
|
|
5406
|
-
fileId:
|
|
5407
|
-
imageUrl:
|
|
5615
|
+
import { z as z23 } from "zod/v4";
|
|
5616
|
+
var imageGenerationArgsSchema = lazySchema21(
|
|
5617
|
+
() => zodSchema21(
|
|
5618
|
+
z23.object({
|
|
5619
|
+
background: z23.enum(["auto", "opaque", "transparent"]).optional(),
|
|
5620
|
+
inputFidelity: z23.enum(["low", "high"]).optional(),
|
|
5621
|
+
inputImageMask: z23.object({
|
|
5622
|
+
fileId: z23.string().optional(),
|
|
5623
|
+
imageUrl: z23.string().optional()
|
|
5408
5624
|
}).optional(),
|
|
5409
|
-
model:
|
|
5410
|
-
moderation:
|
|
5411
|
-
outputCompression:
|
|
5412
|
-
outputFormat:
|
|
5413
|
-
partialImages:
|
|
5414
|
-
quality:
|
|
5415
|
-
size:
|
|
5625
|
+
model: z23.string().optional(),
|
|
5626
|
+
moderation: z23.enum(["auto"]).optional(),
|
|
5627
|
+
outputCompression: z23.number().int().min(0).max(100).optional(),
|
|
5628
|
+
outputFormat: z23.enum(["png", "jpeg", "webp"]).optional(),
|
|
5629
|
+
partialImages: z23.number().int().min(0).max(3).optional(),
|
|
5630
|
+
quality: z23.enum(["auto", "low", "medium", "high"]).optional(),
|
|
5631
|
+
size: z23.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
5416
5632
|
}).strict()
|
|
5417
5633
|
)
|
|
5418
5634
|
);
|
|
5419
|
-
var imageGenerationInputSchema =
|
|
5420
|
-
var imageGenerationOutputSchema =
|
|
5421
|
-
() =>
|
|
5635
|
+
var imageGenerationInputSchema = lazySchema21(() => zodSchema21(z23.object({})));
|
|
5636
|
+
var imageGenerationOutputSchema = lazySchema21(
|
|
5637
|
+
() => zodSchema21(z23.object({ result: z23.string() }))
|
|
5422
5638
|
);
|
|
5423
5639
|
var imageGenerationToolFactory = createProviderExecutedToolFactory3({
|
|
5424
5640
|
id: "openai.image_generation",
|
|
@@ -5432,28 +5648,28 @@ var imageGeneration = (args = {}) => {
|
|
|
5432
5648
|
// src/tool/custom.ts
|
|
5433
5649
|
import {
|
|
5434
5650
|
createProviderDefinedToolFactory,
|
|
5435
|
-
lazySchema as
|
|
5436
|
-
zodSchema as
|
|
5651
|
+
lazySchema as lazySchema22,
|
|
5652
|
+
zodSchema as zodSchema22
|
|
5437
5653
|
} from "@ai-sdk/provider-utils";
|
|
5438
|
-
import { z as
|
|
5439
|
-
var customArgsSchema =
|
|
5440
|
-
() =>
|
|
5441
|
-
|
|
5442
|
-
description:
|
|
5443
|
-
format:
|
|
5444
|
-
|
|
5445
|
-
type:
|
|
5446
|
-
syntax:
|
|
5447
|
-
definition:
|
|
5654
|
+
import { z as z24 } from "zod/v4";
|
|
5655
|
+
var customArgsSchema = lazySchema22(
|
|
5656
|
+
() => zodSchema22(
|
|
5657
|
+
z24.object({
|
|
5658
|
+
description: z24.string().optional(),
|
|
5659
|
+
format: z24.union([
|
|
5660
|
+
z24.object({
|
|
5661
|
+
type: z24.literal("grammar"),
|
|
5662
|
+
syntax: z24.enum(["regex", "lark"]),
|
|
5663
|
+
definition: z24.string()
|
|
5448
5664
|
}),
|
|
5449
|
-
|
|
5450
|
-
type:
|
|
5665
|
+
z24.object({
|
|
5666
|
+
type: z24.literal("text")
|
|
5451
5667
|
})
|
|
5452
5668
|
]).optional()
|
|
5453
5669
|
})
|
|
5454
5670
|
)
|
|
5455
5671
|
);
|
|
5456
|
-
var customInputSchema =
|
|
5672
|
+
var customInputSchema = lazySchema22(() => zodSchema22(z24.string()));
|
|
5457
5673
|
var customToolFactory = createProviderDefinedToolFactory({
|
|
5458
5674
|
id: "openai.custom",
|
|
5459
5675
|
inputSchema: customInputSchema
|
|
@@ -5462,60 +5678,60 @@ var customToolFactory = createProviderDefinedToolFactory({
|
|
|
5462
5678
|
// src/tool/mcp.ts
|
|
5463
5679
|
import {
|
|
5464
5680
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
|
|
5465
|
-
lazySchema as
|
|
5466
|
-
zodSchema as
|
|
5681
|
+
lazySchema as lazySchema23,
|
|
5682
|
+
zodSchema as zodSchema23
|
|
5467
5683
|
} from "@ai-sdk/provider-utils";
|
|
5468
|
-
import { z as
|
|
5469
|
-
var jsonValueSchema2 =
|
|
5470
|
-
() =>
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5684
|
+
import { z as z25 } from "zod/v4";
|
|
5685
|
+
var jsonValueSchema2 = z25.lazy(
|
|
5686
|
+
() => z25.union([
|
|
5687
|
+
z25.string(),
|
|
5688
|
+
z25.number(),
|
|
5689
|
+
z25.boolean(),
|
|
5690
|
+
z25.null(),
|
|
5691
|
+
z25.array(jsonValueSchema2),
|
|
5692
|
+
z25.record(z25.string(), jsonValueSchema2)
|
|
5477
5693
|
])
|
|
5478
5694
|
);
|
|
5479
|
-
var mcpArgsSchema =
|
|
5480
|
-
() =>
|
|
5481
|
-
|
|
5482
|
-
serverLabel:
|
|
5483
|
-
allowedTools:
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
readOnly:
|
|
5487
|
-
toolNames:
|
|
5695
|
+
var mcpArgsSchema = lazySchema23(
|
|
5696
|
+
() => zodSchema23(
|
|
5697
|
+
z25.object({
|
|
5698
|
+
serverLabel: z25.string(),
|
|
5699
|
+
allowedTools: z25.union([
|
|
5700
|
+
z25.array(z25.string()),
|
|
5701
|
+
z25.object({
|
|
5702
|
+
readOnly: z25.boolean().optional(),
|
|
5703
|
+
toolNames: z25.array(z25.string()).optional()
|
|
5488
5704
|
})
|
|
5489
5705
|
]).optional(),
|
|
5490
|
-
authorization:
|
|
5491
|
-
connectorId:
|
|
5492
|
-
headers:
|
|
5493
|
-
requireApproval:
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
never:
|
|
5497
|
-
toolNames:
|
|
5706
|
+
authorization: z25.string().optional(),
|
|
5707
|
+
connectorId: z25.string().optional(),
|
|
5708
|
+
headers: z25.record(z25.string(), z25.string()).optional(),
|
|
5709
|
+
requireApproval: z25.union([
|
|
5710
|
+
z25.enum(["always", "never"]),
|
|
5711
|
+
z25.object({
|
|
5712
|
+
never: z25.object({
|
|
5713
|
+
toolNames: z25.array(z25.string()).optional()
|
|
5498
5714
|
}).optional()
|
|
5499
5715
|
})
|
|
5500
5716
|
]).optional(),
|
|
5501
|
-
serverDescription:
|
|
5502
|
-
serverUrl:
|
|
5717
|
+
serverDescription: z25.string().optional(),
|
|
5718
|
+
serverUrl: z25.string().optional()
|
|
5503
5719
|
}).refine(
|
|
5504
5720
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
5505
5721
|
"One of serverUrl or connectorId must be provided."
|
|
5506
5722
|
)
|
|
5507
5723
|
)
|
|
5508
5724
|
);
|
|
5509
|
-
var mcpInputSchema =
|
|
5510
|
-
var mcpOutputSchema =
|
|
5511
|
-
() =>
|
|
5512
|
-
|
|
5513
|
-
type:
|
|
5514
|
-
serverLabel:
|
|
5515
|
-
name:
|
|
5516
|
-
arguments:
|
|
5517
|
-
output:
|
|
5518
|
-
error:
|
|
5725
|
+
var mcpInputSchema = lazySchema23(() => zodSchema23(z25.object({})));
|
|
5726
|
+
var mcpOutputSchema = lazySchema23(
|
|
5727
|
+
() => zodSchema23(
|
|
5728
|
+
z25.object({
|
|
5729
|
+
type: z25.literal("call"),
|
|
5730
|
+
serverLabel: z25.string(),
|
|
5731
|
+
name: z25.string(),
|
|
5732
|
+
arguments: z25.string(),
|
|
5733
|
+
output: z25.string().nullish(),
|
|
5734
|
+
error: z25.union([z25.string(), jsonValueSchema2]).optional()
|
|
5519
5735
|
})
|
|
5520
5736
|
)
|
|
5521
5737
|
);
|
|
@@ -5528,50 +5744,50 @@ var mcpToolFactory = createProviderExecutedToolFactory4({
|
|
|
5528
5744
|
// src/tool/web-search.ts
|
|
5529
5745
|
import {
|
|
5530
5746
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
|
|
5531
|
-
lazySchema as
|
|
5532
|
-
zodSchema as
|
|
5747
|
+
lazySchema as lazySchema24,
|
|
5748
|
+
zodSchema as zodSchema24
|
|
5533
5749
|
} from "@ai-sdk/provider-utils";
|
|
5534
|
-
import { z as
|
|
5535
|
-
var webSearchArgsSchema =
|
|
5536
|
-
() =>
|
|
5537
|
-
|
|
5538
|
-
externalWebAccess:
|
|
5539
|
-
filters:
|
|
5540
|
-
searchContextSize:
|
|
5541
|
-
userLocation:
|
|
5542
|
-
type:
|
|
5543
|
-
country:
|
|
5544
|
-
city:
|
|
5545
|
-
region:
|
|
5546
|
-
timezone:
|
|
5750
|
+
import { z as z26 } from "zod/v4";
|
|
5751
|
+
var webSearchArgsSchema = lazySchema24(
|
|
5752
|
+
() => zodSchema24(
|
|
5753
|
+
z26.object({
|
|
5754
|
+
externalWebAccess: z26.boolean().optional(),
|
|
5755
|
+
filters: z26.object({ allowedDomains: z26.array(z26.string()).optional() }).optional(),
|
|
5756
|
+
searchContextSize: z26.enum(["low", "medium", "high"]).optional(),
|
|
5757
|
+
userLocation: z26.object({
|
|
5758
|
+
type: z26.literal("approximate"),
|
|
5759
|
+
country: z26.string().optional(),
|
|
5760
|
+
city: z26.string().optional(),
|
|
5761
|
+
region: z26.string().optional(),
|
|
5762
|
+
timezone: z26.string().optional()
|
|
5547
5763
|
}).optional()
|
|
5548
5764
|
})
|
|
5549
5765
|
)
|
|
5550
5766
|
);
|
|
5551
|
-
var webSearchInputSchema =
|
|
5552
|
-
var webSearchOutputSchema =
|
|
5553
|
-
() =>
|
|
5554
|
-
|
|
5555
|
-
action:
|
|
5556
|
-
|
|
5557
|
-
type:
|
|
5558
|
-
query:
|
|
5559
|
-
queries:
|
|
5767
|
+
var webSearchInputSchema = lazySchema24(() => zodSchema24(z26.object({})));
|
|
5768
|
+
var webSearchOutputSchema = lazySchema24(
|
|
5769
|
+
() => zodSchema24(
|
|
5770
|
+
z26.object({
|
|
5771
|
+
action: z26.discriminatedUnion("type", [
|
|
5772
|
+
z26.object({
|
|
5773
|
+
type: z26.literal("search"),
|
|
5774
|
+
query: z26.string().optional(),
|
|
5775
|
+
queries: z26.array(z26.string()).optional()
|
|
5560
5776
|
}),
|
|
5561
|
-
|
|
5562
|
-
type:
|
|
5563
|
-
url:
|
|
5777
|
+
z26.object({
|
|
5778
|
+
type: z26.literal("openPage"),
|
|
5779
|
+
url: z26.string().nullish()
|
|
5564
5780
|
}),
|
|
5565
|
-
|
|
5566
|
-
type:
|
|
5567
|
-
url:
|
|
5568
|
-
pattern:
|
|
5781
|
+
z26.object({
|
|
5782
|
+
type: z26.literal("findInPage"),
|
|
5783
|
+
url: z26.string().nullish(),
|
|
5784
|
+
pattern: z26.string().nullish()
|
|
5569
5785
|
})
|
|
5570
5786
|
]).optional(),
|
|
5571
|
-
sources:
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5787
|
+
sources: z26.array(
|
|
5788
|
+
z26.discriminatedUnion("type", [
|
|
5789
|
+
z26.object({ type: z26.literal("url"), url: z26.string() }),
|
|
5790
|
+
z26.object({ type: z26.literal("api"), name: z26.string() })
|
|
5575
5791
|
])
|
|
5576
5792
|
).optional()
|
|
5577
5793
|
})
|
|
@@ -5587,43 +5803,43 @@ var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
|
5587
5803
|
// src/tool/web-search-preview.ts
|
|
5588
5804
|
import {
|
|
5589
5805
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
|
|
5590
|
-
lazySchema as
|
|
5591
|
-
zodSchema as
|
|
5806
|
+
lazySchema as lazySchema25,
|
|
5807
|
+
zodSchema as zodSchema25
|
|
5592
5808
|
} from "@ai-sdk/provider-utils";
|
|
5593
|
-
import { z as
|
|
5594
|
-
var webSearchPreviewArgsSchema =
|
|
5595
|
-
() =>
|
|
5596
|
-
|
|
5597
|
-
searchContextSize:
|
|
5598
|
-
userLocation:
|
|
5599
|
-
type:
|
|
5600
|
-
country:
|
|
5601
|
-
city:
|
|
5602
|
-
region:
|
|
5603
|
-
timezone:
|
|
5809
|
+
import { z as z27 } from "zod/v4";
|
|
5810
|
+
var webSearchPreviewArgsSchema = lazySchema25(
|
|
5811
|
+
() => zodSchema25(
|
|
5812
|
+
z27.object({
|
|
5813
|
+
searchContextSize: z27.enum(["low", "medium", "high"]).optional(),
|
|
5814
|
+
userLocation: z27.object({
|
|
5815
|
+
type: z27.literal("approximate"),
|
|
5816
|
+
country: z27.string().optional(),
|
|
5817
|
+
city: z27.string().optional(),
|
|
5818
|
+
region: z27.string().optional(),
|
|
5819
|
+
timezone: z27.string().optional()
|
|
5604
5820
|
}).optional()
|
|
5605
5821
|
})
|
|
5606
5822
|
)
|
|
5607
5823
|
);
|
|
5608
|
-
var webSearchPreviewInputSchema =
|
|
5609
|
-
() =>
|
|
5824
|
+
var webSearchPreviewInputSchema = lazySchema25(
|
|
5825
|
+
() => zodSchema25(z27.object({}))
|
|
5610
5826
|
);
|
|
5611
|
-
var webSearchPreviewOutputSchema =
|
|
5612
|
-
() =>
|
|
5613
|
-
|
|
5614
|
-
action:
|
|
5615
|
-
|
|
5616
|
-
type:
|
|
5617
|
-
query:
|
|
5827
|
+
var webSearchPreviewOutputSchema = lazySchema25(
|
|
5828
|
+
() => zodSchema25(
|
|
5829
|
+
z27.object({
|
|
5830
|
+
action: z27.discriminatedUnion("type", [
|
|
5831
|
+
z27.object({
|
|
5832
|
+
type: z27.literal("search"),
|
|
5833
|
+
query: z27.string().optional()
|
|
5618
5834
|
}),
|
|
5619
|
-
|
|
5620
|
-
type:
|
|
5621
|
-
url:
|
|
5835
|
+
z27.object({
|
|
5836
|
+
type: z27.literal("openPage"),
|
|
5837
|
+
url: z27.string().nullish()
|
|
5622
5838
|
}),
|
|
5623
|
-
|
|
5624
|
-
type:
|
|
5625
|
-
url:
|
|
5626
|
-
pattern:
|
|
5839
|
+
z27.object({
|
|
5840
|
+
type: z27.literal("findInPage"),
|
|
5841
|
+
url: z27.string().nullish(),
|
|
5842
|
+
pattern: z27.string().nullish()
|
|
5627
5843
|
})
|
|
5628
5844
|
]).optional()
|
|
5629
5845
|
})
|
|
@@ -5727,6 +5943,12 @@ async function prepareResponsesTools({
|
|
|
5727
5943
|
});
|
|
5728
5944
|
break;
|
|
5729
5945
|
}
|
|
5946
|
+
case "openai.computer": {
|
|
5947
|
+
openaiTools.push({
|
|
5948
|
+
type: "computer"
|
|
5949
|
+
});
|
|
5950
|
+
break;
|
|
5951
|
+
}
|
|
5730
5952
|
case "openai.web_search_preview": {
|
|
5731
5953
|
const args = await validateTypes2({
|
|
5732
5954
|
value: tool.args,
|
|
@@ -5881,7 +6103,7 @@ async function prepareResponsesTools({
|
|
|
5881
6103
|
const resolvedToolName = (_c = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _c : toolChoice.toolName;
|
|
5882
6104
|
return {
|
|
5883
6105
|
tools: openaiTools,
|
|
5884
|
-
toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
|
|
6106
|
+
toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" || resolvedToolName === "computer" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
|
|
5885
6107
|
toolWarnings
|
|
5886
6108
|
};
|
|
5887
6109
|
}
|
|
@@ -5976,6 +6198,74 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
|
|
|
5976
6198
|
}
|
|
5977
6199
|
return mapping;
|
|
5978
6200
|
}
|
|
6201
|
+
function mapComputerAction(action) {
|
|
6202
|
+
switch (action.type) {
|
|
6203
|
+
case "click":
|
|
6204
|
+
return {
|
|
6205
|
+
type: "click",
|
|
6206
|
+
button: action.button,
|
|
6207
|
+
x: action.x,
|
|
6208
|
+
y: action.y,
|
|
6209
|
+
...action.keys != null && { keys: action.keys }
|
|
6210
|
+
};
|
|
6211
|
+
case "double_click":
|
|
6212
|
+
return {
|
|
6213
|
+
type: "double_click",
|
|
6214
|
+
x: action.x,
|
|
6215
|
+
y: action.y,
|
|
6216
|
+
...action.keys != null && { keys: action.keys }
|
|
6217
|
+
};
|
|
6218
|
+
case "drag":
|
|
6219
|
+
return {
|
|
6220
|
+
type: "drag",
|
|
6221
|
+
path: action.path,
|
|
6222
|
+
...action.keys != null && { keys: action.keys }
|
|
6223
|
+
};
|
|
6224
|
+
case "keypress":
|
|
6225
|
+
return action;
|
|
6226
|
+
case "move":
|
|
6227
|
+
return {
|
|
6228
|
+
type: "move",
|
|
6229
|
+
x: action.x,
|
|
6230
|
+
y: action.y,
|
|
6231
|
+
...action.keys != null && { keys: action.keys }
|
|
6232
|
+
};
|
|
6233
|
+
case "screenshot":
|
|
6234
|
+
return action;
|
|
6235
|
+
case "scroll":
|
|
6236
|
+
return {
|
|
6237
|
+
type: "scroll",
|
|
6238
|
+
x: action.x,
|
|
6239
|
+
y: action.y,
|
|
6240
|
+
scrollX: action.scroll_x,
|
|
6241
|
+
scrollY: action.scroll_y,
|
|
6242
|
+
...action.keys != null && { keys: action.keys }
|
|
6243
|
+
};
|
|
6244
|
+
case "type":
|
|
6245
|
+
return action;
|
|
6246
|
+
case "wait":
|
|
6247
|
+
return action;
|
|
6248
|
+
}
|
|
6249
|
+
}
|
|
6250
|
+
function mapComputerCallInput({
|
|
6251
|
+
action,
|
|
6252
|
+
actions,
|
|
6253
|
+
pending_safety_checks,
|
|
6254
|
+
status
|
|
6255
|
+
}) {
|
|
6256
|
+
var _a;
|
|
6257
|
+
return {
|
|
6258
|
+
actions: (actions != null ? actions : action != null ? [action] : []).map(
|
|
6259
|
+
mapComputerAction
|
|
6260
|
+
),
|
|
6261
|
+
pendingSafetyChecks: (_a = pending_safety_checks == null ? void 0 : pending_safety_checks.map((safetyCheck) => ({
|
|
6262
|
+
id: safetyCheck.id,
|
|
6263
|
+
...safetyCheck.code != null && { code: safetyCheck.code },
|
|
6264
|
+
...safetyCheck.message != null && { message: safetyCheck.message }
|
|
6265
|
+
}))) != null ? _a : [],
|
|
6266
|
+
status
|
|
6267
|
+
};
|
|
6268
|
+
}
|
|
5979
6269
|
var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
5980
6270
|
constructor(modelId, config) {
|
|
5981
6271
|
this.specificationVersion = "v4";
|
|
@@ -6059,6 +6349,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6059
6349
|
tools,
|
|
6060
6350
|
providerToolNames: {
|
|
6061
6351
|
"openai.code_interpreter": "code_interpreter",
|
|
6352
|
+
"openai.computer": "computer",
|
|
6062
6353
|
"openai.file_search": "file_search",
|
|
6063
6354
|
"openai.image_generation": "image_generation",
|
|
6064
6355
|
"openai.local_shell": "local_shell",
|
|
@@ -6095,6 +6386,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6095
6386
|
hasLocalShellTool: hasOpenAITool("openai.local_shell"),
|
|
6096
6387
|
hasShellTool: hasOpenAITool("openai.shell"),
|
|
6097
6388
|
hasApplyPatchTool: hasOpenAITool("openai.apply_patch"),
|
|
6389
|
+
hasComputerTool: hasOpenAITool("openai.computer"),
|
|
6098
6390
|
customProviderToolNames: customProviderToolNames.size > 0 ? customProviderToolNames : void 0
|
|
6099
6391
|
});
|
|
6100
6392
|
warnings.push(...inputWarnings);
|
|
@@ -6275,7 +6567,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6275
6567
|
};
|
|
6276
6568
|
}
|
|
6277
6569
|
async doGenerate(options) {
|
|
6278
|
-
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;
|
|
6570
|
+
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;
|
|
6279
6571
|
const {
|
|
6280
6572
|
args: body,
|
|
6281
6573
|
warnings,
|
|
@@ -6315,6 +6607,18 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6315
6607
|
isRetryable: false
|
|
6316
6608
|
});
|
|
6317
6609
|
}
|
|
6610
|
+
if (response.output == null) {
|
|
6611
|
+
const detail = (_c = response.incomplete_details) == null ? void 0 : _c.reason;
|
|
6612
|
+
throw new APICallError2({
|
|
6613
|
+
message: detail ? `Responses API returned no output (${detail})` : "Responses API returned no output",
|
|
6614
|
+
url,
|
|
6615
|
+
requestBodyValues: body,
|
|
6616
|
+
statusCode: 500,
|
|
6617
|
+
responseHeaders,
|
|
6618
|
+
responseBody: rawResponse,
|
|
6619
|
+
isRetryable: false
|
|
6620
|
+
});
|
|
6621
|
+
}
|
|
6318
6622
|
const content = [];
|
|
6319
6623
|
const logprobs = [];
|
|
6320
6624
|
let hasFunctionCall = false;
|
|
@@ -6332,7 +6636,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6332
6636
|
providerMetadata: {
|
|
6333
6637
|
[providerOptionsName]: {
|
|
6334
6638
|
itemId: part.id,
|
|
6335
|
-
reasoningEncryptedContent: (
|
|
6639
|
+
reasoningEncryptedContent: (_d = part.encrypted_content) != null ? _d : null
|
|
6336
6640
|
}
|
|
6337
6641
|
}
|
|
6338
6642
|
});
|
|
@@ -6358,7 +6662,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6358
6662
|
break;
|
|
6359
6663
|
}
|
|
6360
6664
|
case "tool_search_call": {
|
|
6361
|
-
const toolCallId = (
|
|
6665
|
+
const toolCallId = (_e = part.call_id) != null ? _e : part.id;
|
|
6362
6666
|
const isHosted = part.execution === "server";
|
|
6363
6667
|
if (isHosted) {
|
|
6364
6668
|
hostedToolSearchCallIds.push(toolCallId);
|
|
@@ -6381,7 +6685,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6381
6685
|
break;
|
|
6382
6686
|
}
|
|
6383
6687
|
case "tool_search_output": {
|
|
6384
|
-
const toolCallId = (
|
|
6688
|
+
const toolCallId = (_g = (_f = part.call_id) != null ? _f : hostedToolSearchCallIds.shift()) != null ? _g : part.id;
|
|
6385
6689
|
content.push({
|
|
6386
6690
|
type: "tool-result",
|
|
6387
6691
|
toolCallId,
|
|
@@ -6452,7 +6756,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6452
6756
|
}
|
|
6453
6757
|
case "message": {
|
|
6454
6758
|
for (const contentPart of part.content) {
|
|
6455
|
-
if (((
|
|
6759
|
+
if (((_i = (_h = options.providerOptions) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.logprobs) && contentPart.logprobs) {
|
|
6456
6760
|
logprobs.push(contentPart.logprobs);
|
|
6457
6761
|
}
|
|
6458
6762
|
const providerMetadata2 = {
|
|
@@ -6474,7 +6778,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6474
6778
|
content.push({
|
|
6475
6779
|
type: "source",
|
|
6476
6780
|
sourceType: "url",
|
|
6477
|
-
id: (
|
|
6781
|
+
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
|
|
6478
6782
|
url: annotation.url,
|
|
6479
6783
|
title: annotation.title
|
|
6480
6784
|
});
|
|
@@ -6482,7 +6786,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6482
6786
|
content.push({
|
|
6483
6787
|
type: "source",
|
|
6484
6788
|
sourceType: "document",
|
|
6485
|
-
id: (
|
|
6789
|
+
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
|
|
6486
6790
|
mediaType: "text/plain",
|
|
6487
6791
|
title: annotation.filename,
|
|
6488
6792
|
filename: annotation.filename,
|
|
@@ -6498,7 +6802,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6498
6802
|
content.push({
|
|
6499
6803
|
type: "source",
|
|
6500
6804
|
sourceType: "document",
|
|
6501
|
-
id: (
|
|
6805
|
+
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : generateId2(),
|
|
6502
6806
|
mediaType: "text/plain",
|
|
6503
6807
|
title: annotation.filename,
|
|
6504
6808
|
filename: annotation.filename,
|
|
@@ -6514,7 +6818,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6514
6818
|
content.push({
|
|
6515
6819
|
type: "source",
|
|
6516
6820
|
sourceType: "document",
|
|
6517
|
-
id: (
|
|
6821
|
+
id: (_u = (_t = (_s = this.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : generateId2(),
|
|
6518
6822
|
mediaType: "application/octet-stream",
|
|
6519
6823
|
title: annotation.file_id,
|
|
6520
6824
|
filename: annotation.file_id,
|
|
@@ -6584,7 +6888,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6584
6888
|
break;
|
|
6585
6889
|
}
|
|
6586
6890
|
case "mcp_call": {
|
|
6587
|
-
const toolCallId = part.approval_request_id != null ? (
|
|
6891
|
+
const toolCallId = part.approval_request_id != null ? (_v = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _v : part.id : part.id;
|
|
6588
6892
|
const toolName = `mcp.${part.name}`;
|
|
6589
6893
|
content.push({
|
|
6590
6894
|
type: "tool-call",
|
|
@@ -6618,8 +6922,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6618
6922
|
break;
|
|
6619
6923
|
}
|
|
6620
6924
|
case "mcp_approval_request": {
|
|
6621
|
-
const approvalRequestId = (
|
|
6622
|
-
const dummyToolCallId = (
|
|
6925
|
+
const approvalRequestId = (_w = part.approval_request_id) != null ? _w : part.id;
|
|
6926
|
+
const dummyToolCallId = (_z = (_y = (_x = this.config).generateId) == null ? void 0 : _y.call(_x)) != null ? _z : generateId2();
|
|
6623
6927
|
const toolName = `mcp.${part.name}`;
|
|
6624
6928
|
content.push({
|
|
6625
6929
|
type: "tool-call",
|
|
@@ -6637,20 +6941,36 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6637
6941
|
break;
|
|
6638
6942
|
}
|
|
6639
6943
|
case "computer_call": {
|
|
6944
|
+
if (part.call_id == null) {
|
|
6945
|
+
content.push({
|
|
6946
|
+
type: "tool-call",
|
|
6947
|
+
toolCallId: part.id,
|
|
6948
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
6949
|
+
input: "",
|
|
6950
|
+
providerExecuted: true
|
|
6951
|
+
});
|
|
6952
|
+
content.push({
|
|
6953
|
+
type: "tool-result",
|
|
6954
|
+
toolCallId: part.id,
|
|
6955
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
6956
|
+
result: {
|
|
6957
|
+
type: "computer_use_tool_result",
|
|
6958
|
+
status: part.status
|
|
6959
|
+
}
|
|
6960
|
+
});
|
|
6961
|
+
break;
|
|
6962
|
+
}
|
|
6963
|
+
hasFunctionCall = true;
|
|
6964
|
+
const toolName = toolNameMapping.toCustomToolName("computer");
|
|
6640
6965
|
content.push({
|
|
6641
6966
|
type: "tool-call",
|
|
6642
|
-
toolCallId: part.
|
|
6643
|
-
toolName
|
|
6644
|
-
input:
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
toolCallId: part.id,
|
|
6650
|
-
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
6651
|
-
result: {
|
|
6652
|
-
type: "computer_use_tool_result",
|
|
6653
|
-
status: part.status || "completed"
|
|
6967
|
+
toolCallId: part.call_id,
|
|
6968
|
+
toolName,
|
|
6969
|
+
input: JSON.stringify(mapComputerCallInput(part)),
|
|
6970
|
+
providerMetadata: {
|
|
6971
|
+
[providerOptionsName]: {
|
|
6972
|
+
itemId: part.id
|
|
6973
|
+
}
|
|
6654
6974
|
}
|
|
6655
6975
|
});
|
|
6656
6976
|
break;
|
|
@@ -6669,13 +6989,13 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6669
6989
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
6670
6990
|
result: {
|
|
6671
6991
|
queries: part.queries,
|
|
6672
|
-
results: (
|
|
6992
|
+
results: (_B = (_A = part.results) == null ? void 0 : _A.map((result) => ({
|
|
6673
6993
|
attributes: result.attributes,
|
|
6674
6994
|
fileId: result.file_id,
|
|
6675
6995
|
filename: result.filename,
|
|
6676
6996
|
score: result.score,
|
|
6677
6997
|
text: result.text
|
|
6678
|
-
}))) != null ?
|
|
6998
|
+
}))) != null ? _B : null
|
|
6679
6999
|
}
|
|
6680
7000
|
});
|
|
6681
7001
|
break;
|
|
@@ -6739,7 +7059,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6739
7059
|
responseId: response.id,
|
|
6740
7060
|
...logprobs.length > 0 ? { logprobs } : {},
|
|
6741
7061
|
...typeof response.service_tier === "string" ? { serviceTier: response.service_tier } : {},
|
|
6742
|
-
...((
|
|
7062
|
+
...((_C = response.reasoning) == null ? void 0 : _C.context) != null ? { reasoningContext: response.reasoning.context } : {}
|
|
6743
7063
|
}
|
|
6744
7064
|
};
|
|
6745
7065
|
const usage = response.usage;
|
|
@@ -6747,10 +7067,10 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6747
7067
|
content,
|
|
6748
7068
|
finishReason: {
|
|
6749
7069
|
unified: mapOpenAIResponseFinishReason({
|
|
6750
|
-
finishReason: (
|
|
7070
|
+
finishReason: (_D = response.incomplete_details) == null ? void 0 : _D.reason,
|
|
6751
7071
|
hasFunctionCall
|
|
6752
7072
|
}),
|
|
6753
|
-
raw: (
|
|
7073
|
+
raw: (_F = (_E = response.incomplete_details) == null ? void 0 : _E.reason) != null ? _F : void 0
|
|
6754
7074
|
},
|
|
6755
7075
|
usage: convertOpenAIResponsesUsage(usage),
|
|
6756
7076
|
request: { body },
|
|
@@ -6828,7 +7148,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6828
7148
|
controller.enqueue({ type: "stream-start", warnings });
|
|
6829
7149
|
},
|
|
6830
7150
|
transform(chunk, controller) {
|
|
6831
|
-
var _a2, _b2, _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, _M, _N;
|
|
7151
|
+
var _a2, _b2, _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, _M, _N, _O;
|
|
6832
7152
|
if (options.includeRawChunks) {
|
|
6833
7153
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
6834
7154
|
}
|
|
@@ -6898,15 +7218,15 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6898
7218
|
providerExecuted: true
|
|
6899
7219
|
});
|
|
6900
7220
|
} else if (value.item.type === "computer_call") {
|
|
7221
|
+
const toolCallId = (_a2 = value.item.call_id) != null ? _a2 : value.item.id;
|
|
6901
7222
|
ongoingToolCalls[value.output_index] = {
|
|
6902
|
-
toolName: toolNameMapping.toCustomToolName("
|
|
6903
|
-
toolCallId
|
|
7223
|
+
toolName: toolNameMapping.toCustomToolName("computer"),
|
|
7224
|
+
toolCallId
|
|
6904
7225
|
};
|
|
6905
7226
|
controller.enqueue({
|
|
6906
7227
|
type: "tool-input-start",
|
|
6907
|
-
id:
|
|
6908
|
-
toolName: toolNameMapping.toCustomToolName("
|
|
6909
|
-
providerExecuted: true
|
|
7228
|
+
id: toolCallId,
|
|
7229
|
+
toolName: toolNameMapping.toCustomToolName("computer")
|
|
6910
7230
|
});
|
|
6911
7231
|
} else if (value.item.type === "code_interpreter_call") {
|
|
6912
7232
|
ongoingToolCalls[value.output_index] = {
|
|
@@ -6950,7 +7270,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6950
7270
|
ongoingToolCalls[value.output_index] = {
|
|
6951
7271
|
toolName,
|
|
6952
7272
|
toolCallId,
|
|
6953
|
-
toolSearchExecution: (
|
|
7273
|
+
toolSearchExecution: (_b2 = value.item.execution) != null ? _b2 : "server"
|
|
6954
7274
|
};
|
|
6955
7275
|
if (isHosted) {
|
|
6956
7276
|
controller.enqueue({
|
|
@@ -7007,7 +7327,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7007
7327
|
} else if (value.item.type === "shell_call_output") {
|
|
7008
7328
|
} else if (value.item.type === "message") {
|
|
7009
7329
|
ongoingAnnotations.splice(0, ongoingAnnotations.length);
|
|
7010
|
-
activeMessagePhase = (
|
|
7330
|
+
activeMessagePhase = (_c = value.item.phase) != null ? _c : void 0;
|
|
7011
7331
|
controller.enqueue({
|
|
7012
7332
|
type: "text-start",
|
|
7013
7333
|
id: value.item.id,
|
|
@@ -7031,14 +7351,14 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7031
7351
|
providerMetadata: {
|
|
7032
7352
|
[providerOptionsName]: {
|
|
7033
7353
|
itemId: value.item.id,
|
|
7034
|
-
reasoningEncryptedContent: (
|
|
7354
|
+
reasoningEncryptedContent: (_d = value.item.encrypted_content) != null ? _d : null
|
|
7035
7355
|
}
|
|
7036
7356
|
}
|
|
7037
7357
|
});
|
|
7038
7358
|
}
|
|
7039
7359
|
} else if (isResponseOutputItemDoneChunk(value)) {
|
|
7040
7360
|
if (value.item.type === "message") {
|
|
7041
|
-
const phase = (
|
|
7361
|
+
const phase = (_e = value.item.phase) != null ? _e : activeMessagePhase;
|
|
7042
7362
|
activeMessagePhase = void 0;
|
|
7043
7363
|
controller.enqueue({
|
|
7044
7364
|
type: "text-end",
|
|
@@ -7114,24 +7434,50 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7114
7434
|
});
|
|
7115
7435
|
} else if (value.item.type === "computer_call") {
|
|
7116
7436
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7437
|
+
if (value.item.call_id == null) {
|
|
7438
|
+
controller.enqueue({
|
|
7439
|
+
type: "tool-input-end",
|
|
7440
|
+
id: value.item.id
|
|
7441
|
+
});
|
|
7442
|
+
controller.enqueue({
|
|
7443
|
+
type: "tool-call",
|
|
7444
|
+
toolCallId: value.item.id,
|
|
7445
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
7446
|
+
input: "",
|
|
7447
|
+
providerExecuted: true
|
|
7448
|
+
});
|
|
7449
|
+
controller.enqueue({
|
|
7450
|
+
type: "tool-result",
|
|
7451
|
+
toolCallId: value.item.id,
|
|
7452
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
7453
|
+
result: {
|
|
7454
|
+
type: "computer_use_tool_result",
|
|
7455
|
+
status: value.item.status
|
|
7456
|
+
}
|
|
7457
|
+
});
|
|
7458
|
+
return;
|
|
7459
|
+
}
|
|
7460
|
+
hasFunctionCall = true;
|
|
7461
|
+
const toolName = toolNameMapping.toCustomToolName("computer");
|
|
7462
|
+
const input = JSON.stringify(mapComputerCallInput(value.item));
|
|
7117
7463
|
controller.enqueue({
|
|
7118
|
-
type: "tool-input-
|
|
7119
|
-
id: value.item.
|
|
7464
|
+
type: "tool-input-delta",
|
|
7465
|
+
id: value.item.call_id,
|
|
7466
|
+
delta: input
|
|
7120
7467
|
});
|
|
7121
7468
|
controller.enqueue({
|
|
7122
|
-
type: "tool-
|
|
7123
|
-
|
|
7124
|
-
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
7125
|
-
input: "",
|
|
7126
|
-
providerExecuted: true
|
|
7469
|
+
type: "tool-input-end",
|
|
7470
|
+
id: value.item.call_id
|
|
7127
7471
|
});
|
|
7128
7472
|
controller.enqueue({
|
|
7129
|
-
type: "tool-
|
|
7130
|
-
toolCallId: value.item.
|
|
7131
|
-
toolName
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7473
|
+
type: "tool-call",
|
|
7474
|
+
toolCallId: value.item.call_id,
|
|
7475
|
+
toolName,
|
|
7476
|
+
input,
|
|
7477
|
+
providerMetadata: {
|
|
7478
|
+
[providerOptionsName]: {
|
|
7479
|
+
itemId: value.item.id
|
|
7480
|
+
}
|
|
7135
7481
|
}
|
|
7136
7482
|
});
|
|
7137
7483
|
} else if (value.item.type === "file_search_call") {
|
|
@@ -7142,13 +7488,13 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7142
7488
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
7143
7489
|
result: {
|
|
7144
7490
|
queries: value.item.queries,
|
|
7145
|
-
results: (
|
|
7491
|
+
results: (_g = (_f = value.item.results) == null ? void 0 : _f.map((result2) => ({
|
|
7146
7492
|
attributes: result2.attributes,
|
|
7147
7493
|
fileId: result2.file_id,
|
|
7148
7494
|
filename: result2.filename,
|
|
7149
7495
|
score: result2.score,
|
|
7150
7496
|
text: result2.text
|
|
7151
|
-
}))) != null ?
|
|
7497
|
+
}))) != null ? _g : null
|
|
7152
7498
|
}
|
|
7153
7499
|
});
|
|
7154
7500
|
} else if (value.item.type === "code_interpreter_call") {
|
|
@@ -7174,7 +7520,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7174
7520
|
const toolCall = ongoingToolCalls[value.output_index];
|
|
7175
7521
|
const isHosted = value.item.execution === "server";
|
|
7176
7522
|
if (toolCall != null) {
|
|
7177
|
-
const toolCallId = isHosted ? toolCall.toolCallId : (
|
|
7523
|
+
const toolCallId = isHosted ? toolCall.toolCallId : (_h = value.item.call_id) != null ? _h : value.item.id;
|
|
7178
7524
|
if (isHosted) {
|
|
7179
7525
|
hostedToolSearchCallIds.push(toolCallId);
|
|
7180
7526
|
} else {
|
|
@@ -7206,7 +7552,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7206
7552
|
}
|
|
7207
7553
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7208
7554
|
} else if (value.item.type === "tool_search_output") {
|
|
7209
|
-
const toolCallId = (
|
|
7555
|
+
const toolCallId = (_j = (_i = value.item.call_id) != null ? _i : hostedToolSearchCallIds.shift()) != null ? _j : value.item.id;
|
|
7210
7556
|
controller.enqueue({
|
|
7211
7557
|
type: "tool-result",
|
|
7212
7558
|
toolCallId,
|
|
@@ -7222,10 +7568,10 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7222
7568
|
});
|
|
7223
7569
|
} else if (value.item.type === "mcp_call") {
|
|
7224
7570
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7225
|
-
const approvalRequestId = (
|
|
7226
|
-
const aliasedToolCallId = approvalRequestId != null ? (
|
|
7571
|
+
const approvalRequestId = (_k = value.item.approval_request_id) != null ? _k : void 0;
|
|
7572
|
+
const aliasedToolCallId = approvalRequestId != null ? (_m = (_l = approvalRequestIdToDummyToolCallIdFromStream.get(
|
|
7227
7573
|
approvalRequestId
|
|
7228
|
-
)) != null ?
|
|
7574
|
+
)) != null ? _l : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _m : value.item.id : value.item.id;
|
|
7229
7575
|
const toolName = `mcp.${value.item.name}`;
|
|
7230
7576
|
controller.enqueue({
|
|
7231
7577
|
type: "tool-call",
|
|
@@ -7295,8 +7641,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7295
7641
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7296
7642
|
} else if (value.item.type === "mcp_approval_request") {
|
|
7297
7643
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7298
|
-
const dummyToolCallId = (
|
|
7299
|
-
const approvalRequestId = (
|
|
7644
|
+
const dummyToolCallId = (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : generateId2();
|
|
7645
|
+
const approvalRequestId = (_q = value.item.approval_request_id) != null ? _q : value.item.id;
|
|
7300
7646
|
approvalRequestIdToDummyToolCallIdFromStream.set(
|
|
7301
7647
|
approvalRequestId,
|
|
7302
7648
|
dummyToolCallId
|
|
@@ -7385,7 +7731,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7385
7731
|
providerMetadata: {
|
|
7386
7732
|
[providerOptionsName]: {
|
|
7387
7733
|
itemId: value.item.id,
|
|
7388
|
-
reasoningEncryptedContent: (
|
|
7734
|
+
reasoningEncryptedContent: (_r = value.item.encrypted_content) != null ? _r : null
|
|
7389
7735
|
}
|
|
7390
7736
|
}
|
|
7391
7737
|
});
|
|
@@ -7510,7 +7856,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7510
7856
|
id: value.item_id,
|
|
7511
7857
|
delta: value.delta
|
|
7512
7858
|
});
|
|
7513
|
-
if (((
|
|
7859
|
+
if (((_t = (_s = options.providerOptions) == null ? void 0 : _s[providerOptionsName]) == null ? void 0 : _t.logprobs) && value.logprobs) {
|
|
7514
7860
|
logprobs.push(value.logprobs);
|
|
7515
7861
|
}
|
|
7516
7862
|
} else if (value.type === "response.reasoning_summary_part.added") {
|
|
@@ -7539,7 +7885,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7539
7885
|
providerMetadata: {
|
|
7540
7886
|
[providerOptionsName]: {
|
|
7541
7887
|
itemId: value.item_id,
|
|
7542
|
-
reasoningEncryptedContent: (
|
|
7888
|
+
reasoningEncryptedContent: (_v = (_u = activeReasoning[value.item_id]) == null ? void 0 : _u.encryptedContent) != null ? _v : null
|
|
7543
7889
|
}
|
|
7544
7890
|
}
|
|
7545
7891
|
});
|
|
@@ -7573,20 +7919,20 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7573
7919
|
} else if (isResponseFinishedChunk(value)) {
|
|
7574
7920
|
finishReason = {
|
|
7575
7921
|
unified: mapOpenAIResponseFinishReason({
|
|
7576
|
-
finishReason: (
|
|
7922
|
+
finishReason: (_w = value.response.incomplete_details) == null ? void 0 : _w.reason,
|
|
7577
7923
|
hasFunctionCall
|
|
7578
7924
|
}),
|
|
7579
|
-
raw: (
|
|
7925
|
+
raw: (_y = (_x = value.response.incomplete_details) == null ? void 0 : _x.reason) != null ? _y : void 0
|
|
7580
7926
|
};
|
|
7581
7927
|
usage = value.response.usage;
|
|
7582
7928
|
if (typeof value.response.service_tier === "string") {
|
|
7583
7929
|
serviceTier = value.response.service_tier;
|
|
7584
7930
|
}
|
|
7585
|
-
if (((
|
|
7931
|
+
if (((_z = value.response.reasoning) == null ? void 0 : _z.context) != null) {
|
|
7586
7932
|
reasoningContext = value.response.reasoning.context;
|
|
7587
7933
|
}
|
|
7588
7934
|
} else if (isResponseFailedChunk(value)) {
|
|
7589
|
-
const incompleteReason = (
|
|
7935
|
+
const incompleteReason = (_A = value.response.incomplete_details) == null ? void 0 : _A.reason;
|
|
7590
7936
|
finishReason = {
|
|
7591
7937
|
unified: incompleteReason ? mapOpenAIResponseFinishReason({
|
|
7592
7938
|
finishReason: incompleteReason,
|
|
@@ -7594,8 +7940,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7594
7940
|
}) : "error",
|
|
7595
7941
|
raw: incompleteReason != null ? incompleteReason : "error"
|
|
7596
7942
|
};
|
|
7597
|
-
usage = (
|
|
7598
|
-
if (((
|
|
7943
|
+
usage = (_B = value.response.usage) != null ? _B : void 0;
|
|
7944
|
+
if (((_C = value.response.reasoning) == null ? void 0 : _C.context) != null) {
|
|
7599
7945
|
reasoningContext = value.response.reasoning.context;
|
|
7600
7946
|
}
|
|
7601
7947
|
if (!encounteredStreamError && value.response.error != null) {
|
|
@@ -7619,7 +7965,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7619
7965
|
controller.enqueue({
|
|
7620
7966
|
type: "source",
|
|
7621
7967
|
sourceType: "url",
|
|
7622
|
-
id: (
|
|
7968
|
+
id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : generateId2(),
|
|
7623
7969
|
url: value.annotation.url,
|
|
7624
7970
|
title: value.annotation.title
|
|
7625
7971
|
});
|
|
@@ -7627,7 +7973,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7627
7973
|
controller.enqueue({
|
|
7628
7974
|
type: "source",
|
|
7629
7975
|
sourceType: "document",
|
|
7630
|
-
id: (
|
|
7976
|
+
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : generateId2(),
|
|
7631
7977
|
mediaType: "text/plain",
|
|
7632
7978
|
title: value.annotation.filename,
|
|
7633
7979
|
filename: value.annotation.filename,
|
|
@@ -7643,7 +7989,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7643
7989
|
controller.enqueue({
|
|
7644
7990
|
type: "source",
|
|
7645
7991
|
sourceType: "document",
|
|
7646
|
-
id: (
|
|
7992
|
+
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : generateId2(),
|
|
7647
7993
|
mediaType: "text/plain",
|
|
7648
7994
|
title: value.annotation.filename,
|
|
7649
7995
|
filename: value.annotation.filename,
|
|
@@ -7659,7 +8005,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7659
8005
|
controller.enqueue({
|
|
7660
8006
|
type: "source",
|
|
7661
8007
|
sourceType: "document",
|
|
7662
|
-
id: (
|
|
8008
|
+
id: (_O = (_N = (_M = self.config).generateId) == null ? void 0 : _N.call(_M)) != null ? _O : generateId2(),
|
|
7663
8009
|
mediaType: "application/octet-stream",
|
|
7664
8010
|
title: value.annotation.file_id,
|
|
7665
8011
|
filename: value.annotation.file_id,
|