@ai-sdk/openai 3.0.44 → 3.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +68 -4
- package/dist/index.d.ts +68 -4
- package/dist/index.js +1146 -858
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1100 -807
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +31 -3
- package/dist/internal/index.d.ts +31 -3
- package/dist/internal/index.js +1177 -900
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1159 -877
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +142 -0
- package/package.json +1 -1
- package/src/chat/openai-chat-options.ts +1 -0
- package/src/openai-language-model-capabilities.ts +1 -0
- package/src/openai-tools.ts +12 -0
- package/src/responses/convert-to-openai-responses-input.ts +85 -4
- package/src/responses/openai-responses-api.ts +87 -1
- package/src/responses/openai-responses-language-model.ts +139 -0
- package/src/responses/openai-responses-options.ts +4 -2
- package/src/responses/openai-responses-prepare-tools.ts +26 -1
- package/src/tool/tool-search.ts +98 -0
package/dist/internal/index.mjs
CHANGED
|
@@ -36,7 +36,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
36
36
|
const supportsFlexProcessing = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
|
|
37
37
|
const supportsPriorityProcessing = modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") && !modelId.startsWith("gpt-5-chat") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
|
|
38
38
|
const isReasoningModel = modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
|
|
39
|
-
const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.4");
|
|
39
|
+
const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.3") || modelId.startsWith("gpt-5.4");
|
|
40
40
|
const systemMessageMode = isReasoningModel ? "developer" : "system";
|
|
41
41
|
return {
|
|
42
42
|
supportsFlexProcessing,
|
|
@@ -2388,10 +2388,11 @@ import {
|
|
|
2388
2388
|
import {
|
|
2389
2389
|
convertToBase64 as convertToBase642,
|
|
2390
2390
|
isNonNullable,
|
|
2391
|
+
parseJSON,
|
|
2391
2392
|
parseProviderOptions as parseProviderOptions6,
|
|
2392
2393
|
validateTypes
|
|
2393
2394
|
} from "@ai-sdk/provider-utils";
|
|
2394
|
-
import { z as
|
|
2395
|
+
import { z as z16 } from "zod/v4";
|
|
2395
2396
|
|
|
2396
2397
|
// src/tool/apply-patch.ts
|
|
2397
2398
|
import {
|
|
@@ -2570,6 +2571,43 @@ var shell = createProviderToolFactoryWithOutputSchema3({
|
|
|
2570
2571
|
outputSchema: shellOutputSchema
|
|
2571
2572
|
});
|
|
2572
2573
|
|
|
2574
|
+
// src/tool/tool-search.ts
|
|
2575
|
+
import {
|
|
2576
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
2577
|
+
lazySchema as lazySchema14,
|
|
2578
|
+
zodSchema as zodSchema14
|
|
2579
|
+
} from "@ai-sdk/provider-utils";
|
|
2580
|
+
import { z as z15 } from "zod/v4";
|
|
2581
|
+
var toolSearchArgsSchema = lazySchema14(
|
|
2582
|
+
() => zodSchema14(
|
|
2583
|
+
z15.object({
|
|
2584
|
+
execution: z15.enum(["server", "client"]).optional(),
|
|
2585
|
+
description: z15.string().optional(),
|
|
2586
|
+
parameters: z15.record(z15.string(), z15.unknown()).optional()
|
|
2587
|
+
})
|
|
2588
|
+
)
|
|
2589
|
+
);
|
|
2590
|
+
var toolSearchInputSchema = lazySchema14(
|
|
2591
|
+
() => zodSchema14(
|
|
2592
|
+
z15.object({
|
|
2593
|
+
arguments: z15.unknown().optional(),
|
|
2594
|
+
call_id: z15.string().nullish()
|
|
2595
|
+
})
|
|
2596
|
+
)
|
|
2597
|
+
);
|
|
2598
|
+
var toolSearchOutputSchema = lazySchema14(
|
|
2599
|
+
() => zodSchema14(
|
|
2600
|
+
z15.object({
|
|
2601
|
+
tools: z15.array(z15.record(z15.string(), z15.unknown()))
|
|
2602
|
+
})
|
|
2603
|
+
)
|
|
2604
|
+
);
|
|
2605
|
+
var toolSearchToolFactory = createProviderToolFactoryWithOutputSchema4({
|
|
2606
|
+
id: "openai.tool_search",
|
|
2607
|
+
inputSchema: toolSearchInputSchema,
|
|
2608
|
+
outputSchema: toolSearchOutputSchema
|
|
2609
|
+
});
|
|
2610
|
+
|
|
2573
2611
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2574
2612
|
function isFileId(data, prefixes) {
|
|
2575
2613
|
if (!prefixes) return false;
|
|
@@ -2588,7 +2626,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2588
2626
|
hasApplyPatchTool = false,
|
|
2589
2627
|
customProviderToolNames
|
|
2590
2628
|
}) {
|
|
2591
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
2629
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
2592
2630
|
let input = [];
|
|
2593
2631
|
const warnings = [];
|
|
2594
2632
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -2692,6 +2730,32 @@ async function convertToOpenAIResponsesInput({
|
|
|
2692
2730
|
if (hasConversation && id != null) {
|
|
2693
2731
|
break;
|
|
2694
2732
|
}
|
|
2733
|
+
const resolvedToolName = toolNameMapping.toProviderToolName(
|
|
2734
|
+
part.toolName
|
|
2735
|
+
);
|
|
2736
|
+
if (resolvedToolName === "tool_search") {
|
|
2737
|
+
if (store && id != null) {
|
|
2738
|
+
input.push({ type: "item_reference", id });
|
|
2739
|
+
break;
|
|
2740
|
+
}
|
|
2741
|
+
const parsedInput = typeof part.input === "string" ? await parseJSON({
|
|
2742
|
+
text: part.input,
|
|
2743
|
+
schema: toolSearchInputSchema
|
|
2744
|
+
}) : await validateTypes({
|
|
2745
|
+
value: part.input,
|
|
2746
|
+
schema: toolSearchInputSchema
|
|
2747
|
+
});
|
|
2748
|
+
const execution = parsedInput.call_id != null ? "client" : "server";
|
|
2749
|
+
input.push({
|
|
2750
|
+
type: "tool_search_call",
|
|
2751
|
+
id: id != null ? id : part.toolCallId,
|
|
2752
|
+
execution,
|
|
2753
|
+
call_id: (_g = parsedInput.call_id) != null ? _g : null,
|
|
2754
|
+
status: "completed",
|
|
2755
|
+
arguments: parsedInput.arguments
|
|
2756
|
+
});
|
|
2757
|
+
break;
|
|
2758
|
+
}
|
|
2695
2759
|
if (part.providerExecuted) {
|
|
2696
2760
|
if (store && id != null) {
|
|
2697
2761
|
input.push({ type: "item_reference", id });
|
|
@@ -2702,9 +2766,6 @@ async function convertToOpenAIResponsesInput({
|
|
|
2702
2766
|
input.push({ type: "item_reference", id });
|
|
2703
2767
|
break;
|
|
2704
2768
|
}
|
|
2705
|
-
const resolvedToolName = toolNameMapping.toProviderToolName(
|
|
2706
|
-
part.toolName
|
|
2707
|
-
);
|
|
2708
2769
|
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
2709
2770
|
const parsedInput = await validateTypes({
|
|
2710
2771
|
value: part.input,
|
|
@@ -2787,6 +2848,26 @@ async function convertToOpenAIResponsesInput({
|
|
|
2787
2848
|
const resolvedResultToolName = toolNameMapping.toProviderToolName(
|
|
2788
2849
|
part.toolName
|
|
2789
2850
|
);
|
|
2851
|
+
if (resolvedResultToolName === "tool_search") {
|
|
2852
|
+
const itemId = (_j = (_i = (_h = part.providerOptions) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.itemId) != null ? _j : part.toolCallId;
|
|
2853
|
+
if (store) {
|
|
2854
|
+
input.push({ type: "item_reference", id: itemId });
|
|
2855
|
+
} else if (part.output.type === "json") {
|
|
2856
|
+
const parsedOutput = await validateTypes({
|
|
2857
|
+
value: part.output.value,
|
|
2858
|
+
schema: toolSearchOutputSchema
|
|
2859
|
+
});
|
|
2860
|
+
input.push({
|
|
2861
|
+
type: "tool_search_output",
|
|
2862
|
+
id: itemId,
|
|
2863
|
+
execution: "server",
|
|
2864
|
+
call_id: null,
|
|
2865
|
+
status: "completed",
|
|
2866
|
+
tools: parsedOutput.tools
|
|
2867
|
+
});
|
|
2868
|
+
}
|
|
2869
|
+
break;
|
|
2870
|
+
}
|
|
2790
2871
|
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
2791
2872
|
if (part.output.type === "json") {
|
|
2792
2873
|
const parsedOutput = await validateTypes({
|
|
@@ -2809,7 +2890,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2809
2890
|
break;
|
|
2810
2891
|
}
|
|
2811
2892
|
if (store) {
|
|
2812
|
-
const itemId = (
|
|
2893
|
+
const itemId = (_m = (_l = (_k = part.providerOptions) == null ? void 0 : _k[providerOptionsName]) == null ? void 0 : _l.itemId) != null ? _m : part.toolCallId;
|
|
2813
2894
|
input.push({ type: "item_reference", id: itemId });
|
|
2814
2895
|
} else {
|
|
2815
2896
|
warnings.push({
|
|
@@ -2919,7 +3000,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2919
3000
|
}
|
|
2920
3001
|
const output = part.output;
|
|
2921
3002
|
if (output.type === "execution-denied") {
|
|
2922
|
-
const approvalId = (
|
|
3003
|
+
const approvalId = (_o = (_n = output.providerOptions) == null ? void 0 : _n.openai) == null ? void 0 : _o.approvalId;
|
|
2923
3004
|
if (approvalId) {
|
|
2924
3005
|
continue;
|
|
2925
3006
|
}
|
|
@@ -2927,6 +3008,20 @@ async function convertToOpenAIResponsesInput({
|
|
|
2927
3008
|
const resolvedToolName = toolNameMapping.toProviderToolName(
|
|
2928
3009
|
part.toolName
|
|
2929
3010
|
);
|
|
3011
|
+
if (resolvedToolName === "tool_search" && output.type === "json") {
|
|
3012
|
+
const parsedOutput = await validateTypes({
|
|
3013
|
+
value: output.value,
|
|
3014
|
+
schema: toolSearchOutputSchema
|
|
3015
|
+
});
|
|
3016
|
+
input.push({
|
|
3017
|
+
type: "tool_search_output",
|
|
3018
|
+
execution: "client",
|
|
3019
|
+
call_id: part.toolCallId,
|
|
3020
|
+
status: "completed",
|
|
3021
|
+
tools: parsedOutput.tools
|
|
3022
|
+
});
|
|
3023
|
+
continue;
|
|
3024
|
+
}
|
|
2930
3025
|
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
2931
3026
|
const parsedOutput = await validateTypes({
|
|
2932
3027
|
value: output.value,
|
|
@@ -2979,7 +3074,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2979
3074
|
outputValue = output.value;
|
|
2980
3075
|
break;
|
|
2981
3076
|
case "execution-denied":
|
|
2982
|
-
outputValue = (
|
|
3077
|
+
outputValue = (_p = output.reason) != null ? _p : "Tool execution denied.";
|
|
2983
3078
|
break;
|
|
2984
3079
|
case "json":
|
|
2985
3080
|
case "error-json":
|
|
@@ -3033,7 +3128,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3033
3128
|
contentValue = output.value;
|
|
3034
3129
|
break;
|
|
3035
3130
|
case "execution-denied":
|
|
3036
|
-
contentValue = (
|
|
3131
|
+
contentValue = (_q = output.reason) != null ? _q : "Tool execution denied.";
|
|
3037
3132
|
break;
|
|
3038
3133
|
case "json":
|
|
3039
3134
|
case "error-json":
|
|
@@ -3103,9 +3198,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3103
3198
|
}
|
|
3104
3199
|
return { input, warnings };
|
|
3105
3200
|
}
|
|
3106
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
3107
|
-
itemId:
|
|
3108
|
-
reasoningEncryptedContent:
|
|
3201
|
+
var openaiResponsesReasoningProviderOptionsSchema = z16.object({
|
|
3202
|
+
itemId: z16.string().nullish(),
|
|
3203
|
+
reasoningEncryptedContent: z16.string().nullish()
|
|
3109
3204
|
});
|
|
3110
3205
|
|
|
3111
3206
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -3127,483 +3222,525 @@ function mapOpenAIResponseFinishReason({
|
|
|
3127
3222
|
}
|
|
3128
3223
|
|
|
3129
3224
|
// src/responses/openai-responses-api.ts
|
|
3130
|
-
import { lazySchema as
|
|
3131
|
-
import { z as
|
|
3132
|
-
var
|
|
3133
|
-
() =>
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3225
|
+
import { lazySchema as lazySchema15, zodSchema as zodSchema15 } from "@ai-sdk/provider-utils";
|
|
3226
|
+
import { z as z17 } from "zod/v4";
|
|
3227
|
+
var jsonValueSchema = z17.lazy(
|
|
3228
|
+
() => z17.union([
|
|
3229
|
+
z17.string(),
|
|
3230
|
+
z17.number(),
|
|
3231
|
+
z17.boolean(),
|
|
3232
|
+
z17.null(),
|
|
3233
|
+
z17.array(jsonValueSchema),
|
|
3234
|
+
z17.record(z17.string(), jsonValueSchema.optional())
|
|
3235
|
+
])
|
|
3236
|
+
);
|
|
3237
|
+
var openaiResponsesChunkSchema = lazySchema15(
|
|
3238
|
+
() => zodSchema15(
|
|
3239
|
+
z17.union([
|
|
3240
|
+
z17.object({
|
|
3241
|
+
type: z17.literal("response.output_text.delta"),
|
|
3242
|
+
item_id: z17.string(),
|
|
3243
|
+
delta: z17.string(),
|
|
3244
|
+
logprobs: z17.array(
|
|
3245
|
+
z17.object({
|
|
3246
|
+
token: z17.string(),
|
|
3247
|
+
logprob: z17.number(),
|
|
3248
|
+
top_logprobs: z17.array(
|
|
3249
|
+
z17.object({
|
|
3250
|
+
token: z17.string(),
|
|
3251
|
+
logprob: z17.number()
|
|
3147
3252
|
})
|
|
3148
3253
|
)
|
|
3149
3254
|
})
|
|
3150
3255
|
).nullish()
|
|
3151
3256
|
}),
|
|
3152
|
-
|
|
3153
|
-
type:
|
|
3154
|
-
response:
|
|
3155
|
-
incomplete_details:
|
|
3156
|
-
usage:
|
|
3157
|
-
input_tokens:
|
|
3158
|
-
input_tokens_details:
|
|
3159
|
-
output_tokens:
|
|
3160
|
-
output_tokens_details:
|
|
3257
|
+
z17.object({
|
|
3258
|
+
type: z17.enum(["response.completed", "response.incomplete"]),
|
|
3259
|
+
response: z17.object({
|
|
3260
|
+
incomplete_details: z17.object({ reason: z17.string() }).nullish(),
|
|
3261
|
+
usage: z17.object({
|
|
3262
|
+
input_tokens: z17.number(),
|
|
3263
|
+
input_tokens_details: z17.object({ cached_tokens: z17.number().nullish() }).nullish(),
|
|
3264
|
+
output_tokens: z17.number(),
|
|
3265
|
+
output_tokens_details: z17.object({ reasoning_tokens: z17.number().nullish() }).nullish()
|
|
3161
3266
|
}),
|
|
3162
|
-
service_tier:
|
|
3267
|
+
service_tier: z17.string().nullish()
|
|
3163
3268
|
})
|
|
3164
3269
|
}),
|
|
3165
|
-
|
|
3166
|
-
type:
|
|
3167
|
-
response:
|
|
3168
|
-
id:
|
|
3169
|
-
created_at:
|
|
3170
|
-
model:
|
|
3171
|
-
service_tier:
|
|
3270
|
+
z17.object({
|
|
3271
|
+
type: z17.literal("response.created"),
|
|
3272
|
+
response: z17.object({
|
|
3273
|
+
id: z17.string(),
|
|
3274
|
+
created_at: z17.number(),
|
|
3275
|
+
model: z17.string(),
|
|
3276
|
+
service_tier: z17.string().nullish()
|
|
3172
3277
|
})
|
|
3173
3278
|
}),
|
|
3174
|
-
|
|
3175
|
-
type:
|
|
3176
|
-
output_index:
|
|
3177
|
-
item:
|
|
3178
|
-
|
|
3179
|
-
type:
|
|
3180
|
-
id:
|
|
3181
|
-
phase:
|
|
3279
|
+
z17.object({
|
|
3280
|
+
type: z17.literal("response.output_item.added"),
|
|
3281
|
+
output_index: z17.number(),
|
|
3282
|
+
item: z17.discriminatedUnion("type", [
|
|
3283
|
+
z17.object({
|
|
3284
|
+
type: z17.literal("message"),
|
|
3285
|
+
id: z17.string(),
|
|
3286
|
+
phase: z17.enum(["commentary", "final_answer"]).nullish()
|
|
3182
3287
|
}),
|
|
3183
|
-
|
|
3184
|
-
type:
|
|
3185
|
-
id:
|
|
3186
|
-
encrypted_content:
|
|
3288
|
+
z17.object({
|
|
3289
|
+
type: z17.literal("reasoning"),
|
|
3290
|
+
id: z17.string(),
|
|
3291
|
+
encrypted_content: z17.string().nullish()
|
|
3187
3292
|
}),
|
|
3188
|
-
|
|
3189
|
-
type:
|
|
3190
|
-
id:
|
|
3191
|
-
call_id:
|
|
3192
|
-
name:
|
|
3193
|
-
arguments:
|
|
3293
|
+
z17.object({
|
|
3294
|
+
type: z17.literal("function_call"),
|
|
3295
|
+
id: z17.string(),
|
|
3296
|
+
call_id: z17.string(),
|
|
3297
|
+
name: z17.string(),
|
|
3298
|
+
arguments: z17.string()
|
|
3194
3299
|
}),
|
|
3195
|
-
|
|
3196
|
-
type:
|
|
3197
|
-
id:
|
|
3198
|
-
status:
|
|
3300
|
+
z17.object({
|
|
3301
|
+
type: z17.literal("web_search_call"),
|
|
3302
|
+
id: z17.string(),
|
|
3303
|
+
status: z17.string()
|
|
3199
3304
|
}),
|
|
3200
|
-
|
|
3201
|
-
type:
|
|
3202
|
-
id:
|
|
3203
|
-
status:
|
|
3305
|
+
z17.object({
|
|
3306
|
+
type: z17.literal("computer_call"),
|
|
3307
|
+
id: z17.string(),
|
|
3308
|
+
status: z17.string()
|
|
3204
3309
|
}),
|
|
3205
|
-
|
|
3206
|
-
type:
|
|
3207
|
-
id:
|
|
3310
|
+
z17.object({
|
|
3311
|
+
type: z17.literal("file_search_call"),
|
|
3312
|
+
id: z17.string()
|
|
3208
3313
|
}),
|
|
3209
|
-
|
|
3210
|
-
type:
|
|
3211
|
-
id:
|
|
3314
|
+
z17.object({
|
|
3315
|
+
type: z17.literal("image_generation_call"),
|
|
3316
|
+
id: z17.string()
|
|
3212
3317
|
}),
|
|
3213
|
-
|
|
3214
|
-
type:
|
|
3215
|
-
id:
|
|
3216
|
-
container_id:
|
|
3217
|
-
code:
|
|
3218
|
-
outputs:
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3318
|
+
z17.object({
|
|
3319
|
+
type: z17.literal("code_interpreter_call"),
|
|
3320
|
+
id: z17.string(),
|
|
3321
|
+
container_id: z17.string(),
|
|
3322
|
+
code: z17.string().nullable(),
|
|
3323
|
+
outputs: z17.array(
|
|
3324
|
+
z17.discriminatedUnion("type", [
|
|
3325
|
+
z17.object({ type: z17.literal("logs"), logs: z17.string() }),
|
|
3326
|
+
z17.object({ type: z17.literal("image"), url: z17.string() })
|
|
3222
3327
|
])
|
|
3223
3328
|
).nullable(),
|
|
3224
|
-
status:
|
|
3329
|
+
status: z17.string()
|
|
3225
3330
|
}),
|
|
3226
|
-
|
|
3227
|
-
type:
|
|
3228
|
-
id:
|
|
3229
|
-
status:
|
|
3230
|
-
approval_request_id:
|
|
3331
|
+
z17.object({
|
|
3332
|
+
type: z17.literal("mcp_call"),
|
|
3333
|
+
id: z17.string(),
|
|
3334
|
+
status: z17.string(),
|
|
3335
|
+
approval_request_id: z17.string().nullish()
|
|
3231
3336
|
}),
|
|
3232
|
-
|
|
3233
|
-
type:
|
|
3234
|
-
id:
|
|
3337
|
+
z17.object({
|
|
3338
|
+
type: z17.literal("mcp_list_tools"),
|
|
3339
|
+
id: z17.string()
|
|
3235
3340
|
}),
|
|
3236
|
-
|
|
3237
|
-
type:
|
|
3238
|
-
id:
|
|
3341
|
+
z17.object({
|
|
3342
|
+
type: z17.literal("mcp_approval_request"),
|
|
3343
|
+
id: z17.string()
|
|
3239
3344
|
}),
|
|
3240
|
-
|
|
3241
|
-
type:
|
|
3242
|
-
id:
|
|
3243
|
-
call_id:
|
|
3244
|
-
status:
|
|
3245
|
-
operation:
|
|
3246
|
-
|
|
3247
|
-
type:
|
|
3248
|
-
path:
|
|
3249
|
-
diff:
|
|
3345
|
+
z17.object({
|
|
3346
|
+
type: z17.literal("apply_patch_call"),
|
|
3347
|
+
id: z17.string(),
|
|
3348
|
+
call_id: z17.string(),
|
|
3349
|
+
status: z17.enum(["in_progress", "completed"]),
|
|
3350
|
+
operation: z17.discriminatedUnion("type", [
|
|
3351
|
+
z17.object({
|
|
3352
|
+
type: z17.literal("create_file"),
|
|
3353
|
+
path: z17.string(),
|
|
3354
|
+
diff: z17.string()
|
|
3250
3355
|
}),
|
|
3251
|
-
|
|
3252
|
-
type:
|
|
3253
|
-
path:
|
|
3356
|
+
z17.object({
|
|
3357
|
+
type: z17.literal("delete_file"),
|
|
3358
|
+
path: z17.string()
|
|
3254
3359
|
}),
|
|
3255
|
-
|
|
3256
|
-
type:
|
|
3257
|
-
path:
|
|
3258
|
-
diff:
|
|
3360
|
+
z17.object({
|
|
3361
|
+
type: z17.literal("update_file"),
|
|
3362
|
+
path: z17.string(),
|
|
3363
|
+
diff: z17.string()
|
|
3259
3364
|
})
|
|
3260
3365
|
])
|
|
3261
3366
|
}),
|
|
3262
|
-
|
|
3263
|
-
type:
|
|
3264
|
-
id:
|
|
3265
|
-
call_id:
|
|
3266
|
-
name:
|
|
3267
|
-
input:
|
|
3367
|
+
z17.object({
|
|
3368
|
+
type: z17.literal("custom_tool_call"),
|
|
3369
|
+
id: z17.string(),
|
|
3370
|
+
call_id: z17.string(),
|
|
3371
|
+
name: z17.string(),
|
|
3372
|
+
input: z17.string()
|
|
3268
3373
|
}),
|
|
3269
|
-
|
|
3270
|
-
type:
|
|
3271
|
-
id:
|
|
3272
|
-
call_id:
|
|
3273
|
-
status:
|
|
3274
|
-
action:
|
|
3275
|
-
commands:
|
|
3374
|
+
z17.object({
|
|
3375
|
+
type: z17.literal("shell_call"),
|
|
3376
|
+
id: z17.string(),
|
|
3377
|
+
call_id: z17.string(),
|
|
3378
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
3379
|
+
action: z17.object({
|
|
3380
|
+
commands: z17.array(z17.string())
|
|
3276
3381
|
})
|
|
3277
3382
|
}),
|
|
3278
|
-
|
|
3279
|
-
type:
|
|
3280
|
-
id:
|
|
3281
|
-
call_id:
|
|
3282
|
-
status:
|
|
3283
|
-
output:
|
|
3284
|
-
|
|
3285
|
-
stdout:
|
|
3286
|
-
stderr:
|
|
3287
|
-
outcome:
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
type:
|
|
3291
|
-
exit_code:
|
|
3383
|
+
z17.object({
|
|
3384
|
+
type: z17.literal("shell_call_output"),
|
|
3385
|
+
id: z17.string(),
|
|
3386
|
+
call_id: z17.string(),
|
|
3387
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
3388
|
+
output: z17.array(
|
|
3389
|
+
z17.object({
|
|
3390
|
+
stdout: z17.string(),
|
|
3391
|
+
stderr: z17.string(),
|
|
3392
|
+
outcome: z17.discriminatedUnion("type", [
|
|
3393
|
+
z17.object({ type: z17.literal("timeout") }),
|
|
3394
|
+
z17.object({
|
|
3395
|
+
type: z17.literal("exit"),
|
|
3396
|
+
exit_code: z17.number()
|
|
3292
3397
|
})
|
|
3293
3398
|
])
|
|
3294
3399
|
})
|
|
3295
3400
|
)
|
|
3401
|
+
}),
|
|
3402
|
+
z17.object({
|
|
3403
|
+
type: z17.literal("tool_search_call"),
|
|
3404
|
+
id: z17.string(),
|
|
3405
|
+
execution: z17.enum(["server", "client"]),
|
|
3406
|
+
call_id: z17.string().nullable(),
|
|
3407
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
3408
|
+
arguments: z17.unknown()
|
|
3409
|
+
}),
|
|
3410
|
+
z17.object({
|
|
3411
|
+
type: z17.literal("tool_search_output"),
|
|
3412
|
+
id: z17.string(),
|
|
3413
|
+
execution: z17.enum(["server", "client"]),
|
|
3414
|
+
call_id: z17.string().nullable(),
|
|
3415
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
3416
|
+
tools: z17.array(z17.record(z17.string(), jsonValueSchema.optional()))
|
|
3296
3417
|
})
|
|
3297
3418
|
])
|
|
3298
3419
|
}),
|
|
3299
|
-
|
|
3300
|
-
type:
|
|
3301
|
-
output_index:
|
|
3302
|
-
item:
|
|
3303
|
-
|
|
3304
|
-
type:
|
|
3305
|
-
id:
|
|
3306
|
-
phase:
|
|
3420
|
+
z17.object({
|
|
3421
|
+
type: z17.literal("response.output_item.done"),
|
|
3422
|
+
output_index: z17.number(),
|
|
3423
|
+
item: z17.discriminatedUnion("type", [
|
|
3424
|
+
z17.object({
|
|
3425
|
+
type: z17.literal("message"),
|
|
3426
|
+
id: z17.string(),
|
|
3427
|
+
phase: z17.enum(["commentary", "final_answer"]).nullish()
|
|
3307
3428
|
}),
|
|
3308
|
-
|
|
3309
|
-
type:
|
|
3310
|
-
id:
|
|
3311
|
-
encrypted_content:
|
|
3429
|
+
z17.object({
|
|
3430
|
+
type: z17.literal("reasoning"),
|
|
3431
|
+
id: z17.string(),
|
|
3432
|
+
encrypted_content: z17.string().nullish()
|
|
3312
3433
|
}),
|
|
3313
|
-
|
|
3314
|
-
type:
|
|
3315
|
-
id:
|
|
3316
|
-
call_id:
|
|
3317
|
-
name:
|
|
3318
|
-
arguments:
|
|
3319
|
-
status:
|
|
3434
|
+
z17.object({
|
|
3435
|
+
type: z17.literal("function_call"),
|
|
3436
|
+
id: z17.string(),
|
|
3437
|
+
call_id: z17.string(),
|
|
3438
|
+
name: z17.string(),
|
|
3439
|
+
arguments: z17.string(),
|
|
3440
|
+
status: z17.literal("completed")
|
|
3320
3441
|
}),
|
|
3321
|
-
|
|
3322
|
-
type:
|
|
3323
|
-
id:
|
|
3324
|
-
call_id:
|
|
3325
|
-
name:
|
|
3326
|
-
input:
|
|
3327
|
-
status:
|
|
3442
|
+
z17.object({
|
|
3443
|
+
type: z17.literal("custom_tool_call"),
|
|
3444
|
+
id: z17.string(),
|
|
3445
|
+
call_id: z17.string(),
|
|
3446
|
+
name: z17.string(),
|
|
3447
|
+
input: z17.string(),
|
|
3448
|
+
status: z17.literal("completed")
|
|
3328
3449
|
}),
|
|
3329
|
-
|
|
3330
|
-
type:
|
|
3331
|
-
id:
|
|
3332
|
-
code:
|
|
3333
|
-
container_id:
|
|
3334
|
-
outputs:
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3450
|
+
z17.object({
|
|
3451
|
+
type: z17.literal("code_interpreter_call"),
|
|
3452
|
+
id: z17.string(),
|
|
3453
|
+
code: z17.string().nullable(),
|
|
3454
|
+
container_id: z17.string(),
|
|
3455
|
+
outputs: z17.array(
|
|
3456
|
+
z17.discriminatedUnion("type", [
|
|
3457
|
+
z17.object({ type: z17.literal("logs"), logs: z17.string() }),
|
|
3458
|
+
z17.object({ type: z17.literal("image"), url: z17.string() })
|
|
3338
3459
|
])
|
|
3339
3460
|
).nullable()
|
|
3340
3461
|
}),
|
|
3341
|
-
|
|
3342
|
-
type:
|
|
3343
|
-
id:
|
|
3344
|
-
result:
|
|
3462
|
+
z17.object({
|
|
3463
|
+
type: z17.literal("image_generation_call"),
|
|
3464
|
+
id: z17.string(),
|
|
3465
|
+
result: z17.string()
|
|
3345
3466
|
}),
|
|
3346
|
-
|
|
3347
|
-
type:
|
|
3348
|
-
id:
|
|
3349
|
-
status:
|
|
3350
|
-
action:
|
|
3351
|
-
|
|
3352
|
-
type:
|
|
3353
|
-
query:
|
|
3354
|
-
sources:
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3467
|
+
z17.object({
|
|
3468
|
+
type: z17.literal("web_search_call"),
|
|
3469
|
+
id: z17.string(),
|
|
3470
|
+
status: z17.string(),
|
|
3471
|
+
action: z17.discriminatedUnion("type", [
|
|
3472
|
+
z17.object({
|
|
3473
|
+
type: z17.literal("search"),
|
|
3474
|
+
query: z17.string().nullish(),
|
|
3475
|
+
sources: z17.array(
|
|
3476
|
+
z17.discriminatedUnion("type", [
|
|
3477
|
+
z17.object({ type: z17.literal("url"), url: z17.string() }),
|
|
3478
|
+
z17.object({ type: z17.literal("api"), name: z17.string() })
|
|
3358
3479
|
])
|
|
3359
3480
|
).nullish()
|
|
3360
3481
|
}),
|
|
3361
|
-
|
|
3362
|
-
type:
|
|
3363
|
-
url:
|
|
3482
|
+
z17.object({
|
|
3483
|
+
type: z17.literal("open_page"),
|
|
3484
|
+
url: z17.string().nullish()
|
|
3364
3485
|
}),
|
|
3365
|
-
|
|
3366
|
-
type:
|
|
3367
|
-
url:
|
|
3368
|
-
pattern:
|
|
3486
|
+
z17.object({
|
|
3487
|
+
type: z17.literal("find_in_page"),
|
|
3488
|
+
url: z17.string().nullish(),
|
|
3489
|
+
pattern: z17.string().nullish()
|
|
3369
3490
|
})
|
|
3370
3491
|
]).nullish()
|
|
3371
3492
|
}),
|
|
3372
|
-
|
|
3373
|
-
type:
|
|
3374
|
-
id:
|
|
3375
|
-
queries:
|
|
3376
|
-
results:
|
|
3377
|
-
|
|
3378
|
-
attributes:
|
|
3379
|
-
|
|
3380
|
-
|
|
3493
|
+
z17.object({
|
|
3494
|
+
type: z17.literal("file_search_call"),
|
|
3495
|
+
id: z17.string(),
|
|
3496
|
+
queries: z17.array(z17.string()),
|
|
3497
|
+
results: z17.array(
|
|
3498
|
+
z17.object({
|
|
3499
|
+
attributes: z17.record(
|
|
3500
|
+
z17.string(),
|
|
3501
|
+
z17.union([z17.string(), z17.number(), z17.boolean()])
|
|
3381
3502
|
),
|
|
3382
|
-
file_id:
|
|
3383
|
-
filename:
|
|
3384
|
-
score:
|
|
3385
|
-
text:
|
|
3503
|
+
file_id: z17.string(),
|
|
3504
|
+
filename: z17.string(),
|
|
3505
|
+
score: z17.number(),
|
|
3506
|
+
text: z17.string()
|
|
3386
3507
|
})
|
|
3387
3508
|
).nullish()
|
|
3388
3509
|
}),
|
|
3389
|
-
|
|
3390
|
-
type:
|
|
3391
|
-
id:
|
|
3392
|
-
call_id:
|
|
3393
|
-
action:
|
|
3394
|
-
type:
|
|
3395
|
-
command:
|
|
3396
|
-
timeout_ms:
|
|
3397
|
-
user:
|
|
3398
|
-
working_directory:
|
|
3399
|
-
env:
|
|
3510
|
+
z17.object({
|
|
3511
|
+
type: z17.literal("local_shell_call"),
|
|
3512
|
+
id: z17.string(),
|
|
3513
|
+
call_id: z17.string(),
|
|
3514
|
+
action: z17.object({
|
|
3515
|
+
type: z17.literal("exec"),
|
|
3516
|
+
command: z17.array(z17.string()),
|
|
3517
|
+
timeout_ms: z17.number().optional(),
|
|
3518
|
+
user: z17.string().optional(),
|
|
3519
|
+
working_directory: z17.string().optional(),
|
|
3520
|
+
env: z17.record(z17.string(), z17.string()).optional()
|
|
3400
3521
|
})
|
|
3401
3522
|
}),
|
|
3402
|
-
|
|
3403
|
-
type:
|
|
3404
|
-
id:
|
|
3405
|
-
status:
|
|
3523
|
+
z17.object({
|
|
3524
|
+
type: z17.literal("computer_call"),
|
|
3525
|
+
id: z17.string(),
|
|
3526
|
+
status: z17.literal("completed")
|
|
3406
3527
|
}),
|
|
3407
|
-
|
|
3408
|
-
type:
|
|
3409
|
-
id:
|
|
3410
|
-
status:
|
|
3411
|
-
arguments:
|
|
3412
|
-
name:
|
|
3413
|
-
server_label:
|
|
3414
|
-
output:
|
|
3415
|
-
error:
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
type:
|
|
3419
|
-
code:
|
|
3420
|
-
message:
|
|
3528
|
+
z17.object({
|
|
3529
|
+
type: z17.literal("mcp_call"),
|
|
3530
|
+
id: z17.string(),
|
|
3531
|
+
status: z17.string(),
|
|
3532
|
+
arguments: z17.string(),
|
|
3533
|
+
name: z17.string(),
|
|
3534
|
+
server_label: z17.string(),
|
|
3535
|
+
output: z17.string().nullish(),
|
|
3536
|
+
error: z17.union([
|
|
3537
|
+
z17.string(),
|
|
3538
|
+
z17.object({
|
|
3539
|
+
type: z17.string().optional(),
|
|
3540
|
+
code: z17.union([z17.number(), z17.string()]).optional(),
|
|
3541
|
+
message: z17.string().optional()
|
|
3421
3542
|
}).loose()
|
|
3422
3543
|
]).nullish(),
|
|
3423
|
-
approval_request_id:
|
|
3544
|
+
approval_request_id: z17.string().nullish()
|
|
3424
3545
|
}),
|
|
3425
|
-
|
|
3426
|
-
type:
|
|
3427
|
-
id:
|
|
3428
|
-
server_label:
|
|
3429
|
-
tools:
|
|
3430
|
-
|
|
3431
|
-
name:
|
|
3432
|
-
description:
|
|
3433
|
-
input_schema:
|
|
3434
|
-
annotations:
|
|
3546
|
+
z17.object({
|
|
3547
|
+
type: z17.literal("mcp_list_tools"),
|
|
3548
|
+
id: z17.string(),
|
|
3549
|
+
server_label: z17.string(),
|
|
3550
|
+
tools: z17.array(
|
|
3551
|
+
z17.object({
|
|
3552
|
+
name: z17.string(),
|
|
3553
|
+
description: z17.string().optional(),
|
|
3554
|
+
input_schema: z17.any(),
|
|
3555
|
+
annotations: z17.record(z17.string(), z17.unknown()).optional()
|
|
3435
3556
|
})
|
|
3436
3557
|
),
|
|
3437
|
-
error:
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
type:
|
|
3441
|
-
code:
|
|
3442
|
-
message:
|
|
3558
|
+
error: z17.union([
|
|
3559
|
+
z17.string(),
|
|
3560
|
+
z17.object({
|
|
3561
|
+
type: z17.string().optional(),
|
|
3562
|
+
code: z17.union([z17.number(), z17.string()]).optional(),
|
|
3563
|
+
message: z17.string().optional()
|
|
3443
3564
|
}).loose()
|
|
3444
3565
|
]).optional()
|
|
3445
3566
|
}),
|
|
3446
|
-
|
|
3447
|
-
type:
|
|
3448
|
-
id:
|
|
3449
|
-
server_label:
|
|
3450
|
-
name:
|
|
3451
|
-
arguments:
|
|
3452
|
-
approval_request_id:
|
|
3567
|
+
z17.object({
|
|
3568
|
+
type: z17.literal("mcp_approval_request"),
|
|
3569
|
+
id: z17.string(),
|
|
3570
|
+
server_label: z17.string(),
|
|
3571
|
+
name: z17.string(),
|
|
3572
|
+
arguments: z17.string(),
|
|
3573
|
+
approval_request_id: z17.string().optional()
|
|
3453
3574
|
}),
|
|
3454
|
-
|
|
3455
|
-
type:
|
|
3456
|
-
id:
|
|
3457
|
-
call_id:
|
|
3458
|
-
status:
|
|
3459
|
-
operation:
|
|
3460
|
-
|
|
3461
|
-
type:
|
|
3462
|
-
path:
|
|
3463
|
-
diff:
|
|
3575
|
+
z17.object({
|
|
3576
|
+
type: z17.literal("apply_patch_call"),
|
|
3577
|
+
id: z17.string(),
|
|
3578
|
+
call_id: z17.string(),
|
|
3579
|
+
status: z17.enum(["in_progress", "completed"]),
|
|
3580
|
+
operation: z17.discriminatedUnion("type", [
|
|
3581
|
+
z17.object({
|
|
3582
|
+
type: z17.literal("create_file"),
|
|
3583
|
+
path: z17.string(),
|
|
3584
|
+
diff: z17.string()
|
|
3464
3585
|
}),
|
|
3465
|
-
|
|
3466
|
-
type:
|
|
3467
|
-
path:
|
|
3586
|
+
z17.object({
|
|
3587
|
+
type: z17.literal("delete_file"),
|
|
3588
|
+
path: z17.string()
|
|
3468
3589
|
}),
|
|
3469
|
-
|
|
3470
|
-
type:
|
|
3471
|
-
path:
|
|
3472
|
-
diff:
|
|
3590
|
+
z17.object({
|
|
3591
|
+
type: z17.literal("update_file"),
|
|
3592
|
+
path: z17.string(),
|
|
3593
|
+
diff: z17.string()
|
|
3473
3594
|
})
|
|
3474
3595
|
])
|
|
3475
3596
|
}),
|
|
3476
|
-
|
|
3477
|
-
type:
|
|
3478
|
-
id:
|
|
3479
|
-
call_id:
|
|
3480
|
-
status:
|
|
3481
|
-
action:
|
|
3482
|
-
commands:
|
|
3597
|
+
z17.object({
|
|
3598
|
+
type: z17.literal("shell_call"),
|
|
3599
|
+
id: z17.string(),
|
|
3600
|
+
call_id: z17.string(),
|
|
3601
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
3602
|
+
action: z17.object({
|
|
3603
|
+
commands: z17.array(z17.string())
|
|
3483
3604
|
})
|
|
3484
3605
|
}),
|
|
3485
|
-
|
|
3486
|
-
type:
|
|
3487
|
-
id:
|
|
3488
|
-
call_id:
|
|
3489
|
-
status:
|
|
3490
|
-
output:
|
|
3491
|
-
|
|
3492
|
-
stdout:
|
|
3493
|
-
stderr:
|
|
3494
|
-
outcome:
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
type:
|
|
3498
|
-
exit_code:
|
|
3606
|
+
z17.object({
|
|
3607
|
+
type: z17.literal("shell_call_output"),
|
|
3608
|
+
id: z17.string(),
|
|
3609
|
+
call_id: z17.string(),
|
|
3610
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
3611
|
+
output: z17.array(
|
|
3612
|
+
z17.object({
|
|
3613
|
+
stdout: z17.string(),
|
|
3614
|
+
stderr: z17.string(),
|
|
3615
|
+
outcome: z17.discriminatedUnion("type", [
|
|
3616
|
+
z17.object({ type: z17.literal("timeout") }),
|
|
3617
|
+
z17.object({
|
|
3618
|
+
type: z17.literal("exit"),
|
|
3619
|
+
exit_code: z17.number()
|
|
3499
3620
|
})
|
|
3500
3621
|
])
|
|
3501
3622
|
})
|
|
3502
3623
|
)
|
|
3624
|
+
}),
|
|
3625
|
+
z17.object({
|
|
3626
|
+
type: z17.literal("tool_search_call"),
|
|
3627
|
+
id: z17.string(),
|
|
3628
|
+
execution: z17.enum(["server", "client"]),
|
|
3629
|
+
call_id: z17.string().nullable(),
|
|
3630
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
3631
|
+
arguments: z17.unknown()
|
|
3632
|
+
}),
|
|
3633
|
+
z17.object({
|
|
3634
|
+
type: z17.literal("tool_search_output"),
|
|
3635
|
+
id: z17.string(),
|
|
3636
|
+
execution: z17.enum(["server", "client"]),
|
|
3637
|
+
call_id: z17.string().nullable(),
|
|
3638
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
3639
|
+
tools: z17.array(z17.record(z17.string(), jsonValueSchema.optional()))
|
|
3503
3640
|
})
|
|
3504
3641
|
])
|
|
3505
3642
|
}),
|
|
3506
|
-
|
|
3507
|
-
type:
|
|
3508
|
-
item_id:
|
|
3509
|
-
output_index:
|
|
3510
|
-
delta:
|
|
3643
|
+
z17.object({
|
|
3644
|
+
type: z17.literal("response.function_call_arguments.delta"),
|
|
3645
|
+
item_id: z17.string(),
|
|
3646
|
+
output_index: z17.number(),
|
|
3647
|
+
delta: z17.string()
|
|
3511
3648
|
}),
|
|
3512
|
-
|
|
3513
|
-
type:
|
|
3514
|
-
item_id:
|
|
3515
|
-
output_index:
|
|
3516
|
-
delta:
|
|
3649
|
+
z17.object({
|
|
3650
|
+
type: z17.literal("response.custom_tool_call_input.delta"),
|
|
3651
|
+
item_id: z17.string(),
|
|
3652
|
+
output_index: z17.number(),
|
|
3653
|
+
delta: z17.string()
|
|
3517
3654
|
}),
|
|
3518
|
-
|
|
3519
|
-
type:
|
|
3520
|
-
item_id:
|
|
3521
|
-
output_index:
|
|
3522
|
-
partial_image_b64:
|
|
3655
|
+
z17.object({
|
|
3656
|
+
type: z17.literal("response.image_generation_call.partial_image"),
|
|
3657
|
+
item_id: z17.string(),
|
|
3658
|
+
output_index: z17.number(),
|
|
3659
|
+
partial_image_b64: z17.string()
|
|
3523
3660
|
}),
|
|
3524
|
-
|
|
3525
|
-
type:
|
|
3526
|
-
item_id:
|
|
3527
|
-
output_index:
|
|
3528
|
-
delta:
|
|
3661
|
+
z17.object({
|
|
3662
|
+
type: z17.literal("response.code_interpreter_call_code.delta"),
|
|
3663
|
+
item_id: z17.string(),
|
|
3664
|
+
output_index: z17.number(),
|
|
3665
|
+
delta: z17.string()
|
|
3529
3666
|
}),
|
|
3530
|
-
|
|
3531
|
-
type:
|
|
3532
|
-
item_id:
|
|
3533
|
-
output_index:
|
|
3534
|
-
code:
|
|
3667
|
+
z17.object({
|
|
3668
|
+
type: z17.literal("response.code_interpreter_call_code.done"),
|
|
3669
|
+
item_id: z17.string(),
|
|
3670
|
+
output_index: z17.number(),
|
|
3671
|
+
code: z17.string()
|
|
3535
3672
|
}),
|
|
3536
|
-
|
|
3537
|
-
type:
|
|
3538
|
-
annotation:
|
|
3539
|
-
|
|
3540
|
-
type:
|
|
3541
|
-
start_index:
|
|
3542
|
-
end_index:
|
|
3543
|
-
url:
|
|
3544
|
-
title:
|
|
3673
|
+
z17.object({
|
|
3674
|
+
type: z17.literal("response.output_text.annotation.added"),
|
|
3675
|
+
annotation: z17.discriminatedUnion("type", [
|
|
3676
|
+
z17.object({
|
|
3677
|
+
type: z17.literal("url_citation"),
|
|
3678
|
+
start_index: z17.number(),
|
|
3679
|
+
end_index: z17.number(),
|
|
3680
|
+
url: z17.string(),
|
|
3681
|
+
title: z17.string()
|
|
3545
3682
|
}),
|
|
3546
|
-
|
|
3547
|
-
type:
|
|
3548
|
-
file_id:
|
|
3549
|
-
filename:
|
|
3550
|
-
index:
|
|
3683
|
+
z17.object({
|
|
3684
|
+
type: z17.literal("file_citation"),
|
|
3685
|
+
file_id: z17.string(),
|
|
3686
|
+
filename: z17.string(),
|
|
3687
|
+
index: z17.number()
|
|
3551
3688
|
}),
|
|
3552
|
-
|
|
3553
|
-
type:
|
|
3554
|
-
container_id:
|
|
3555
|
-
file_id:
|
|
3556
|
-
filename:
|
|
3557
|
-
start_index:
|
|
3558
|
-
end_index:
|
|
3689
|
+
z17.object({
|
|
3690
|
+
type: z17.literal("container_file_citation"),
|
|
3691
|
+
container_id: z17.string(),
|
|
3692
|
+
file_id: z17.string(),
|
|
3693
|
+
filename: z17.string(),
|
|
3694
|
+
start_index: z17.number(),
|
|
3695
|
+
end_index: z17.number()
|
|
3559
3696
|
}),
|
|
3560
|
-
|
|
3561
|
-
type:
|
|
3562
|
-
file_id:
|
|
3563
|
-
index:
|
|
3697
|
+
z17.object({
|
|
3698
|
+
type: z17.literal("file_path"),
|
|
3699
|
+
file_id: z17.string(),
|
|
3700
|
+
index: z17.number()
|
|
3564
3701
|
})
|
|
3565
3702
|
])
|
|
3566
3703
|
}),
|
|
3567
|
-
|
|
3568
|
-
type:
|
|
3569
|
-
item_id:
|
|
3570
|
-
summary_index:
|
|
3704
|
+
z17.object({
|
|
3705
|
+
type: z17.literal("response.reasoning_summary_part.added"),
|
|
3706
|
+
item_id: z17.string(),
|
|
3707
|
+
summary_index: z17.number()
|
|
3571
3708
|
}),
|
|
3572
|
-
|
|
3573
|
-
type:
|
|
3574
|
-
item_id:
|
|
3575
|
-
summary_index:
|
|
3576
|
-
delta:
|
|
3709
|
+
z17.object({
|
|
3710
|
+
type: z17.literal("response.reasoning_summary_text.delta"),
|
|
3711
|
+
item_id: z17.string(),
|
|
3712
|
+
summary_index: z17.number(),
|
|
3713
|
+
delta: z17.string()
|
|
3577
3714
|
}),
|
|
3578
|
-
|
|
3579
|
-
type:
|
|
3580
|
-
item_id:
|
|
3581
|
-
summary_index:
|
|
3715
|
+
z17.object({
|
|
3716
|
+
type: z17.literal("response.reasoning_summary_part.done"),
|
|
3717
|
+
item_id: z17.string(),
|
|
3718
|
+
summary_index: z17.number()
|
|
3582
3719
|
}),
|
|
3583
|
-
|
|
3584
|
-
type:
|
|
3585
|
-
item_id:
|
|
3586
|
-
output_index:
|
|
3587
|
-
delta:
|
|
3588
|
-
obfuscation:
|
|
3720
|
+
z17.object({
|
|
3721
|
+
type: z17.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3722
|
+
item_id: z17.string(),
|
|
3723
|
+
output_index: z17.number(),
|
|
3724
|
+
delta: z17.string(),
|
|
3725
|
+
obfuscation: z17.string().nullish()
|
|
3589
3726
|
}),
|
|
3590
|
-
|
|
3591
|
-
type:
|
|
3592
|
-
item_id:
|
|
3593
|
-
output_index:
|
|
3594
|
-
diff:
|
|
3727
|
+
z17.object({
|
|
3728
|
+
type: z17.literal("response.apply_patch_call_operation_diff.done"),
|
|
3729
|
+
item_id: z17.string(),
|
|
3730
|
+
output_index: z17.number(),
|
|
3731
|
+
diff: z17.string()
|
|
3595
3732
|
}),
|
|
3596
|
-
|
|
3597
|
-
type:
|
|
3598
|
-
sequence_number:
|
|
3599
|
-
error:
|
|
3600
|
-
type:
|
|
3601
|
-
code:
|
|
3602
|
-
message:
|
|
3603
|
-
param:
|
|
3733
|
+
z17.object({
|
|
3734
|
+
type: z17.literal("error"),
|
|
3735
|
+
sequence_number: z17.number(),
|
|
3736
|
+
error: z17.object({
|
|
3737
|
+
type: z17.string(),
|
|
3738
|
+
code: z17.string(),
|
|
3739
|
+
message: z17.string(),
|
|
3740
|
+
param: z17.string().nullish()
|
|
3604
3741
|
})
|
|
3605
3742
|
}),
|
|
3606
|
-
|
|
3743
|
+
z17.object({ type: z17.string() }).loose().transform((value) => ({
|
|
3607
3744
|
type: "unknown_chunk",
|
|
3608
3745
|
message: value.type
|
|
3609
3746
|
}))
|
|
@@ -3611,294 +3748,310 @@ var openaiResponsesChunkSchema = lazySchema14(
|
|
|
3611
3748
|
])
|
|
3612
3749
|
)
|
|
3613
3750
|
);
|
|
3614
|
-
var openaiResponsesResponseSchema =
|
|
3615
|
-
() =>
|
|
3616
|
-
|
|
3617
|
-
id:
|
|
3618
|
-
created_at:
|
|
3619
|
-
error:
|
|
3620
|
-
message:
|
|
3621
|
-
type:
|
|
3622
|
-
param:
|
|
3623
|
-
code:
|
|
3751
|
+
var openaiResponsesResponseSchema = lazySchema15(
|
|
3752
|
+
() => zodSchema15(
|
|
3753
|
+
z17.object({
|
|
3754
|
+
id: z17.string().optional(),
|
|
3755
|
+
created_at: z17.number().optional(),
|
|
3756
|
+
error: z17.object({
|
|
3757
|
+
message: z17.string(),
|
|
3758
|
+
type: z17.string(),
|
|
3759
|
+
param: z17.string().nullish(),
|
|
3760
|
+
code: z17.string()
|
|
3624
3761
|
}).nullish(),
|
|
3625
|
-
model:
|
|
3626
|
-
output:
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
type:
|
|
3630
|
-
role:
|
|
3631
|
-
id:
|
|
3632
|
-
phase:
|
|
3633
|
-
content:
|
|
3634
|
-
|
|
3635
|
-
type:
|
|
3636
|
-
text:
|
|
3637
|
-
logprobs:
|
|
3638
|
-
|
|
3639
|
-
token:
|
|
3640
|
-
logprob:
|
|
3641
|
-
top_logprobs:
|
|
3642
|
-
|
|
3643
|
-
token:
|
|
3644
|
-
logprob:
|
|
3762
|
+
model: z17.string().optional(),
|
|
3763
|
+
output: z17.array(
|
|
3764
|
+
z17.discriminatedUnion("type", [
|
|
3765
|
+
z17.object({
|
|
3766
|
+
type: z17.literal("message"),
|
|
3767
|
+
role: z17.literal("assistant"),
|
|
3768
|
+
id: z17.string(),
|
|
3769
|
+
phase: z17.enum(["commentary", "final_answer"]).nullish(),
|
|
3770
|
+
content: z17.array(
|
|
3771
|
+
z17.object({
|
|
3772
|
+
type: z17.literal("output_text"),
|
|
3773
|
+
text: z17.string(),
|
|
3774
|
+
logprobs: z17.array(
|
|
3775
|
+
z17.object({
|
|
3776
|
+
token: z17.string(),
|
|
3777
|
+
logprob: z17.number(),
|
|
3778
|
+
top_logprobs: z17.array(
|
|
3779
|
+
z17.object({
|
|
3780
|
+
token: z17.string(),
|
|
3781
|
+
logprob: z17.number()
|
|
3645
3782
|
})
|
|
3646
3783
|
)
|
|
3647
3784
|
})
|
|
3648
3785
|
).nullish(),
|
|
3649
|
-
annotations:
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
type:
|
|
3653
|
-
start_index:
|
|
3654
|
-
end_index:
|
|
3655
|
-
url:
|
|
3656
|
-
title:
|
|
3786
|
+
annotations: z17.array(
|
|
3787
|
+
z17.discriminatedUnion("type", [
|
|
3788
|
+
z17.object({
|
|
3789
|
+
type: z17.literal("url_citation"),
|
|
3790
|
+
start_index: z17.number(),
|
|
3791
|
+
end_index: z17.number(),
|
|
3792
|
+
url: z17.string(),
|
|
3793
|
+
title: z17.string()
|
|
3657
3794
|
}),
|
|
3658
|
-
|
|
3659
|
-
type:
|
|
3660
|
-
file_id:
|
|
3661
|
-
filename:
|
|
3662
|
-
index:
|
|
3795
|
+
z17.object({
|
|
3796
|
+
type: z17.literal("file_citation"),
|
|
3797
|
+
file_id: z17.string(),
|
|
3798
|
+
filename: z17.string(),
|
|
3799
|
+
index: z17.number()
|
|
3663
3800
|
}),
|
|
3664
|
-
|
|
3665
|
-
type:
|
|
3666
|
-
container_id:
|
|
3667
|
-
file_id:
|
|
3668
|
-
filename:
|
|
3669
|
-
start_index:
|
|
3670
|
-
end_index:
|
|
3801
|
+
z17.object({
|
|
3802
|
+
type: z17.literal("container_file_citation"),
|
|
3803
|
+
container_id: z17.string(),
|
|
3804
|
+
file_id: z17.string(),
|
|
3805
|
+
filename: z17.string(),
|
|
3806
|
+
start_index: z17.number(),
|
|
3807
|
+
end_index: z17.number()
|
|
3671
3808
|
}),
|
|
3672
|
-
|
|
3673
|
-
type:
|
|
3674
|
-
file_id:
|
|
3675
|
-
index:
|
|
3809
|
+
z17.object({
|
|
3810
|
+
type: z17.literal("file_path"),
|
|
3811
|
+
file_id: z17.string(),
|
|
3812
|
+
index: z17.number()
|
|
3676
3813
|
})
|
|
3677
3814
|
])
|
|
3678
3815
|
)
|
|
3679
3816
|
})
|
|
3680
3817
|
)
|
|
3681
3818
|
}),
|
|
3682
|
-
|
|
3683
|
-
type:
|
|
3684
|
-
id:
|
|
3685
|
-
status:
|
|
3686
|
-
action:
|
|
3687
|
-
|
|
3688
|
-
type:
|
|
3689
|
-
query:
|
|
3690
|
-
sources:
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
type:
|
|
3695
|
-
name:
|
|
3819
|
+
z17.object({
|
|
3820
|
+
type: z17.literal("web_search_call"),
|
|
3821
|
+
id: z17.string(),
|
|
3822
|
+
status: z17.string(),
|
|
3823
|
+
action: z17.discriminatedUnion("type", [
|
|
3824
|
+
z17.object({
|
|
3825
|
+
type: z17.literal("search"),
|
|
3826
|
+
query: z17.string().nullish(),
|
|
3827
|
+
sources: z17.array(
|
|
3828
|
+
z17.discriminatedUnion("type", [
|
|
3829
|
+
z17.object({ type: z17.literal("url"), url: z17.string() }),
|
|
3830
|
+
z17.object({
|
|
3831
|
+
type: z17.literal("api"),
|
|
3832
|
+
name: z17.string()
|
|
3696
3833
|
})
|
|
3697
3834
|
])
|
|
3698
3835
|
).nullish()
|
|
3699
3836
|
}),
|
|
3700
|
-
|
|
3701
|
-
type:
|
|
3702
|
-
url:
|
|
3837
|
+
z17.object({
|
|
3838
|
+
type: z17.literal("open_page"),
|
|
3839
|
+
url: z17.string().nullish()
|
|
3703
3840
|
}),
|
|
3704
|
-
|
|
3705
|
-
type:
|
|
3706
|
-
url:
|
|
3707
|
-
pattern:
|
|
3841
|
+
z17.object({
|
|
3842
|
+
type: z17.literal("find_in_page"),
|
|
3843
|
+
url: z17.string().nullish(),
|
|
3844
|
+
pattern: z17.string().nullish()
|
|
3708
3845
|
})
|
|
3709
3846
|
]).nullish()
|
|
3710
3847
|
}),
|
|
3711
|
-
|
|
3712
|
-
type:
|
|
3713
|
-
id:
|
|
3714
|
-
queries:
|
|
3715
|
-
results:
|
|
3716
|
-
|
|
3717
|
-
attributes:
|
|
3718
|
-
|
|
3719
|
-
|
|
3848
|
+
z17.object({
|
|
3849
|
+
type: z17.literal("file_search_call"),
|
|
3850
|
+
id: z17.string(),
|
|
3851
|
+
queries: z17.array(z17.string()),
|
|
3852
|
+
results: z17.array(
|
|
3853
|
+
z17.object({
|
|
3854
|
+
attributes: z17.record(
|
|
3855
|
+
z17.string(),
|
|
3856
|
+
z17.union([z17.string(), z17.number(), z17.boolean()])
|
|
3720
3857
|
),
|
|
3721
|
-
file_id:
|
|
3722
|
-
filename:
|
|
3723
|
-
score:
|
|
3724
|
-
text:
|
|
3858
|
+
file_id: z17.string(),
|
|
3859
|
+
filename: z17.string(),
|
|
3860
|
+
score: z17.number(),
|
|
3861
|
+
text: z17.string()
|
|
3725
3862
|
})
|
|
3726
3863
|
).nullish()
|
|
3727
3864
|
}),
|
|
3728
|
-
|
|
3729
|
-
type:
|
|
3730
|
-
id:
|
|
3731
|
-
code:
|
|
3732
|
-
container_id:
|
|
3733
|
-
outputs:
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3865
|
+
z17.object({
|
|
3866
|
+
type: z17.literal("code_interpreter_call"),
|
|
3867
|
+
id: z17.string(),
|
|
3868
|
+
code: z17.string().nullable(),
|
|
3869
|
+
container_id: z17.string(),
|
|
3870
|
+
outputs: z17.array(
|
|
3871
|
+
z17.discriminatedUnion("type", [
|
|
3872
|
+
z17.object({ type: z17.literal("logs"), logs: z17.string() }),
|
|
3873
|
+
z17.object({ type: z17.literal("image"), url: z17.string() })
|
|
3737
3874
|
])
|
|
3738
3875
|
).nullable()
|
|
3739
3876
|
}),
|
|
3740
|
-
|
|
3741
|
-
type:
|
|
3742
|
-
id:
|
|
3743
|
-
result:
|
|
3877
|
+
z17.object({
|
|
3878
|
+
type: z17.literal("image_generation_call"),
|
|
3879
|
+
id: z17.string(),
|
|
3880
|
+
result: z17.string()
|
|
3744
3881
|
}),
|
|
3745
|
-
|
|
3746
|
-
type:
|
|
3747
|
-
id:
|
|
3748
|
-
call_id:
|
|
3749
|
-
action:
|
|
3750
|
-
type:
|
|
3751
|
-
command:
|
|
3752
|
-
timeout_ms:
|
|
3753
|
-
user:
|
|
3754
|
-
working_directory:
|
|
3755
|
-
env:
|
|
3882
|
+
z17.object({
|
|
3883
|
+
type: z17.literal("local_shell_call"),
|
|
3884
|
+
id: z17.string(),
|
|
3885
|
+
call_id: z17.string(),
|
|
3886
|
+
action: z17.object({
|
|
3887
|
+
type: z17.literal("exec"),
|
|
3888
|
+
command: z17.array(z17.string()),
|
|
3889
|
+
timeout_ms: z17.number().optional(),
|
|
3890
|
+
user: z17.string().optional(),
|
|
3891
|
+
working_directory: z17.string().optional(),
|
|
3892
|
+
env: z17.record(z17.string(), z17.string()).optional()
|
|
3756
3893
|
})
|
|
3757
3894
|
}),
|
|
3758
|
-
|
|
3759
|
-
type:
|
|
3760
|
-
call_id:
|
|
3761
|
-
name:
|
|
3762
|
-
arguments:
|
|
3763
|
-
id:
|
|
3895
|
+
z17.object({
|
|
3896
|
+
type: z17.literal("function_call"),
|
|
3897
|
+
call_id: z17.string(),
|
|
3898
|
+
name: z17.string(),
|
|
3899
|
+
arguments: z17.string(),
|
|
3900
|
+
id: z17.string()
|
|
3764
3901
|
}),
|
|
3765
|
-
|
|
3766
|
-
type:
|
|
3767
|
-
call_id:
|
|
3768
|
-
name:
|
|
3769
|
-
input:
|
|
3770
|
-
id:
|
|
3902
|
+
z17.object({
|
|
3903
|
+
type: z17.literal("custom_tool_call"),
|
|
3904
|
+
call_id: z17.string(),
|
|
3905
|
+
name: z17.string(),
|
|
3906
|
+
input: z17.string(),
|
|
3907
|
+
id: z17.string()
|
|
3771
3908
|
}),
|
|
3772
|
-
|
|
3773
|
-
type:
|
|
3774
|
-
id:
|
|
3775
|
-
status:
|
|
3909
|
+
z17.object({
|
|
3910
|
+
type: z17.literal("computer_call"),
|
|
3911
|
+
id: z17.string(),
|
|
3912
|
+
status: z17.string().optional()
|
|
3776
3913
|
}),
|
|
3777
|
-
|
|
3778
|
-
type:
|
|
3779
|
-
id:
|
|
3780
|
-
encrypted_content:
|
|
3781
|
-
summary:
|
|
3782
|
-
|
|
3783
|
-
type:
|
|
3784
|
-
text:
|
|
3914
|
+
z17.object({
|
|
3915
|
+
type: z17.literal("reasoning"),
|
|
3916
|
+
id: z17.string(),
|
|
3917
|
+
encrypted_content: z17.string().nullish(),
|
|
3918
|
+
summary: z17.array(
|
|
3919
|
+
z17.object({
|
|
3920
|
+
type: z17.literal("summary_text"),
|
|
3921
|
+
text: z17.string()
|
|
3785
3922
|
})
|
|
3786
3923
|
)
|
|
3787
3924
|
}),
|
|
3788
|
-
|
|
3789
|
-
type:
|
|
3790
|
-
id:
|
|
3791
|
-
status:
|
|
3792
|
-
arguments:
|
|
3793
|
-
name:
|
|
3794
|
-
server_label:
|
|
3795
|
-
output:
|
|
3796
|
-
error:
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
type:
|
|
3800
|
-
code:
|
|
3801
|
-
message:
|
|
3925
|
+
z17.object({
|
|
3926
|
+
type: z17.literal("mcp_call"),
|
|
3927
|
+
id: z17.string(),
|
|
3928
|
+
status: z17.string(),
|
|
3929
|
+
arguments: z17.string(),
|
|
3930
|
+
name: z17.string(),
|
|
3931
|
+
server_label: z17.string(),
|
|
3932
|
+
output: z17.string().nullish(),
|
|
3933
|
+
error: z17.union([
|
|
3934
|
+
z17.string(),
|
|
3935
|
+
z17.object({
|
|
3936
|
+
type: z17.string().optional(),
|
|
3937
|
+
code: z17.union([z17.number(), z17.string()]).optional(),
|
|
3938
|
+
message: z17.string().optional()
|
|
3802
3939
|
}).loose()
|
|
3803
3940
|
]).nullish(),
|
|
3804
|
-
approval_request_id:
|
|
3941
|
+
approval_request_id: z17.string().nullish()
|
|
3805
3942
|
}),
|
|
3806
|
-
|
|
3807
|
-
type:
|
|
3808
|
-
id:
|
|
3809
|
-
server_label:
|
|
3810
|
-
tools:
|
|
3811
|
-
|
|
3812
|
-
name:
|
|
3813
|
-
description:
|
|
3814
|
-
input_schema:
|
|
3815
|
-
annotations:
|
|
3943
|
+
z17.object({
|
|
3944
|
+
type: z17.literal("mcp_list_tools"),
|
|
3945
|
+
id: z17.string(),
|
|
3946
|
+
server_label: z17.string(),
|
|
3947
|
+
tools: z17.array(
|
|
3948
|
+
z17.object({
|
|
3949
|
+
name: z17.string(),
|
|
3950
|
+
description: z17.string().optional(),
|
|
3951
|
+
input_schema: z17.any(),
|
|
3952
|
+
annotations: z17.record(z17.string(), z17.unknown()).optional()
|
|
3816
3953
|
})
|
|
3817
3954
|
),
|
|
3818
|
-
error:
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
type:
|
|
3822
|
-
code:
|
|
3823
|
-
message:
|
|
3955
|
+
error: z17.union([
|
|
3956
|
+
z17.string(),
|
|
3957
|
+
z17.object({
|
|
3958
|
+
type: z17.string().optional(),
|
|
3959
|
+
code: z17.union([z17.number(), z17.string()]).optional(),
|
|
3960
|
+
message: z17.string().optional()
|
|
3824
3961
|
}).loose()
|
|
3825
3962
|
]).optional()
|
|
3826
3963
|
}),
|
|
3827
|
-
|
|
3828
|
-
type:
|
|
3829
|
-
id:
|
|
3830
|
-
server_label:
|
|
3831
|
-
name:
|
|
3832
|
-
arguments:
|
|
3833
|
-
approval_request_id:
|
|
3964
|
+
z17.object({
|
|
3965
|
+
type: z17.literal("mcp_approval_request"),
|
|
3966
|
+
id: z17.string(),
|
|
3967
|
+
server_label: z17.string(),
|
|
3968
|
+
name: z17.string(),
|
|
3969
|
+
arguments: z17.string(),
|
|
3970
|
+
approval_request_id: z17.string().optional()
|
|
3834
3971
|
}),
|
|
3835
|
-
|
|
3836
|
-
type:
|
|
3837
|
-
id:
|
|
3838
|
-
call_id:
|
|
3839
|
-
status:
|
|
3840
|
-
operation:
|
|
3841
|
-
|
|
3842
|
-
type:
|
|
3843
|
-
path:
|
|
3844
|
-
diff:
|
|
3972
|
+
z17.object({
|
|
3973
|
+
type: z17.literal("apply_patch_call"),
|
|
3974
|
+
id: z17.string(),
|
|
3975
|
+
call_id: z17.string(),
|
|
3976
|
+
status: z17.enum(["in_progress", "completed"]),
|
|
3977
|
+
operation: z17.discriminatedUnion("type", [
|
|
3978
|
+
z17.object({
|
|
3979
|
+
type: z17.literal("create_file"),
|
|
3980
|
+
path: z17.string(),
|
|
3981
|
+
diff: z17.string()
|
|
3845
3982
|
}),
|
|
3846
|
-
|
|
3847
|
-
type:
|
|
3848
|
-
path:
|
|
3983
|
+
z17.object({
|
|
3984
|
+
type: z17.literal("delete_file"),
|
|
3985
|
+
path: z17.string()
|
|
3849
3986
|
}),
|
|
3850
|
-
|
|
3851
|
-
type:
|
|
3852
|
-
path:
|
|
3853
|
-
diff:
|
|
3987
|
+
z17.object({
|
|
3988
|
+
type: z17.literal("update_file"),
|
|
3989
|
+
path: z17.string(),
|
|
3990
|
+
diff: z17.string()
|
|
3854
3991
|
})
|
|
3855
3992
|
])
|
|
3856
3993
|
}),
|
|
3857
|
-
|
|
3858
|
-
type:
|
|
3859
|
-
id:
|
|
3860
|
-
call_id:
|
|
3861
|
-
status:
|
|
3862
|
-
action:
|
|
3863
|
-
commands:
|
|
3994
|
+
z17.object({
|
|
3995
|
+
type: z17.literal("shell_call"),
|
|
3996
|
+
id: z17.string(),
|
|
3997
|
+
call_id: z17.string(),
|
|
3998
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
3999
|
+
action: z17.object({
|
|
4000
|
+
commands: z17.array(z17.string())
|
|
3864
4001
|
})
|
|
3865
4002
|
}),
|
|
3866
|
-
|
|
3867
|
-
type:
|
|
3868
|
-
id:
|
|
3869
|
-
call_id:
|
|
3870
|
-
status:
|
|
3871
|
-
output:
|
|
3872
|
-
|
|
3873
|
-
stdout:
|
|
3874
|
-
stderr:
|
|
3875
|
-
outcome:
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
type:
|
|
3879
|
-
exit_code:
|
|
4003
|
+
z17.object({
|
|
4004
|
+
type: z17.literal("shell_call_output"),
|
|
4005
|
+
id: z17.string(),
|
|
4006
|
+
call_id: z17.string(),
|
|
4007
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
4008
|
+
output: z17.array(
|
|
4009
|
+
z17.object({
|
|
4010
|
+
stdout: z17.string(),
|
|
4011
|
+
stderr: z17.string(),
|
|
4012
|
+
outcome: z17.discriminatedUnion("type", [
|
|
4013
|
+
z17.object({ type: z17.literal("timeout") }),
|
|
4014
|
+
z17.object({
|
|
4015
|
+
type: z17.literal("exit"),
|
|
4016
|
+
exit_code: z17.number()
|
|
3880
4017
|
})
|
|
3881
4018
|
])
|
|
3882
4019
|
})
|
|
3883
4020
|
)
|
|
4021
|
+
}),
|
|
4022
|
+
z17.object({
|
|
4023
|
+
type: z17.literal("tool_search_call"),
|
|
4024
|
+
id: z17.string(),
|
|
4025
|
+
execution: z17.enum(["server", "client"]),
|
|
4026
|
+
call_id: z17.string().nullable(),
|
|
4027
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
4028
|
+
arguments: z17.unknown()
|
|
4029
|
+
}),
|
|
4030
|
+
z17.object({
|
|
4031
|
+
type: z17.literal("tool_search_output"),
|
|
4032
|
+
id: z17.string(),
|
|
4033
|
+
execution: z17.enum(["server", "client"]),
|
|
4034
|
+
call_id: z17.string().nullable(),
|
|
4035
|
+
status: z17.enum(["in_progress", "completed", "incomplete"]),
|
|
4036
|
+
tools: z17.array(z17.record(z17.string(), jsonValueSchema.optional()))
|
|
3884
4037
|
})
|
|
3885
4038
|
])
|
|
3886
4039
|
).optional(),
|
|
3887
|
-
service_tier:
|
|
3888
|
-
incomplete_details:
|
|
3889
|
-
usage:
|
|
3890
|
-
input_tokens:
|
|
3891
|
-
input_tokens_details:
|
|
3892
|
-
output_tokens:
|
|
3893
|
-
output_tokens_details:
|
|
4040
|
+
service_tier: z17.string().nullish(),
|
|
4041
|
+
incomplete_details: z17.object({ reason: z17.string() }).nullish(),
|
|
4042
|
+
usage: z17.object({
|
|
4043
|
+
input_tokens: z17.number(),
|
|
4044
|
+
input_tokens_details: z17.object({ cached_tokens: z17.number().nullish() }).nullish(),
|
|
4045
|
+
output_tokens: z17.number(),
|
|
4046
|
+
output_tokens_details: z17.object({ reasoning_tokens: z17.number().nullish() }).nullish()
|
|
3894
4047
|
}).optional()
|
|
3895
4048
|
})
|
|
3896
4049
|
)
|
|
3897
4050
|
);
|
|
3898
4051
|
|
|
3899
4052
|
// src/responses/openai-responses-options.ts
|
|
3900
|
-
import { lazySchema as
|
|
3901
|
-
import { z as
|
|
4053
|
+
import { lazySchema as lazySchema16, zodSchema as zodSchema16 } from "@ai-sdk/provider-utils";
|
|
4054
|
+
import { z as z18 } from "zod/v4";
|
|
3902
4055
|
var TOP_LOGPROBS_MAX = 20;
|
|
3903
4056
|
var openaiResponsesReasoningModelIds = [
|
|
3904
4057
|
"o1",
|
|
@@ -3927,11 +4080,12 @@ var openaiResponsesReasoningModelIds = [
|
|
|
3927
4080
|
"gpt-5.2-chat-latest",
|
|
3928
4081
|
"gpt-5.2-pro",
|
|
3929
4082
|
"gpt-5.2-codex",
|
|
4083
|
+
"gpt-5.3-chat-latest",
|
|
4084
|
+
"gpt-5.3-codex",
|
|
3930
4085
|
"gpt-5.4",
|
|
3931
4086
|
"gpt-5.4-2026-03-05",
|
|
3932
4087
|
"gpt-5.4-pro",
|
|
3933
|
-
"gpt-5.4-pro-2026-03-05"
|
|
3934
|
-
"gpt-5.3-codex"
|
|
4088
|
+
"gpt-5.4-pro-2026-03-05"
|
|
3935
4089
|
];
|
|
3936
4090
|
var openaiResponsesModelIds = [
|
|
3937
4091
|
"gpt-4.1",
|
|
@@ -3958,9 +4112,9 @@ var openaiResponsesModelIds = [
|
|
|
3958
4112
|
"gpt-5-chat-latest",
|
|
3959
4113
|
...openaiResponsesReasoningModelIds
|
|
3960
4114
|
];
|
|
3961
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
3962
|
-
() =>
|
|
3963
|
-
|
|
4115
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
4116
|
+
() => zodSchema16(
|
|
4117
|
+
z18.object({
|
|
3964
4118
|
/**
|
|
3965
4119
|
* The ID of the OpenAI Conversation to continue.
|
|
3966
4120
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -3968,13 +4122,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
3968
4122
|
* Defaults to `undefined`.
|
|
3969
4123
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
3970
4124
|
*/
|
|
3971
|
-
conversation:
|
|
4125
|
+
conversation: z18.string().nullish(),
|
|
3972
4126
|
/**
|
|
3973
4127
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
3974
4128
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
3975
4129
|
*/
|
|
3976
|
-
include:
|
|
3977
|
-
|
|
4130
|
+
include: z18.array(
|
|
4131
|
+
z18.enum([
|
|
3978
4132
|
"reasoning.encrypted_content",
|
|
3979
4133
|
// handled internally by default, only needed for unknown reasoning models
|
|
3980
4134
|
"file_search_call.results",
|
|
@@ -3986,7 +4140,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
3986
4140
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
3987
4141
|
* Defaults to `undefined`.
|
|
3988
4142
|
*/
|
|
3989
|
-
instructions:
|
|
4143
|
+
instructions: z18.string().nullish(),
|
|
3990
4144
|
/**
|
|
3991
4145
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
3992
4146
|
* the response size and can slow down response times. However, it can
|
|
@@ -4001,30 +4155,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4001
4155
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4002
4156
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4003
4157
|
*/
|
|
4004
|
-
logprobs:
|
|
4158
|
+
logprobs: z18.union([z18.boolean(), z18.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4005
4159
|
/**
|
|
4006
4160
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4007
4161
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4008
4162
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4009
4163
|
*/
|
|
4010
|
-
maxToolCalls:
|
|
4164
|
+
maxToolCalls: z18.number().nullish(),
|
|
4011
4165
|
/**
|
|
4012
4166
|
* Additional metadata to store with the generation.
|
|
4013
4167
|
*/
|
|
4014
|
-
metadata:
|
|
4168
|
+
metadata: z18.any().nullish(),
|
|
4015
4169
|
/**
|
|
4016
4170
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4017
4171
|
*/
|
|
4018
|
-
parallelToolCalls:
|
|
4172
|
+
parallelToolCalls: z18.boolean().nullish(),
|
|
4019
4173
|
/**
|
|
4020
4174
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4021
4175
|
* Defaults to `undefined`.
|
|
4022
4176
|
*/
|
|
4023
|
-
previousResponseId:
|
|
4177
|
+
previousResponseId: z18.string().nullish(),
|
|
4024
4178
|
/**
|
|
4025
4179
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4026
4180
|
*/
|
|
4027
|
-
promptCacheKey:
|
|
4181
|
+
promptCacheKey: z18.string().nullish(),
|
|
4028
4182
|
/**
|
|
4029
4183
|
* The retention policy for the prompt cache.
|
|
4030
4184
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4033,7 +4187,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4033
4187
|
*
|
|
4034
4188
|
* @default 'in_memory'
|
|
4035
4189
|
*/
|
|
4036
|
-
promptCacheRetention:
|
|
4190
|
+
promptCacheRetention: z18.enum(["in_memory", "24h"]).nullish(),
|
|
4037
4191
|
/**
|
|
4038
4192
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4039
4193
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4044,17 +4198,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4044
4198
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4045
4199
|
* an error.
|
|
4046
4200
|
*/
|
|
4047
|
-
reasoningEffort:
|
|
4201
|
+
reasoningEffort: z18.string().nullish(),
|
|
4048
4202
|
/**
|
|
4049
4203
|
* Controls reasoning summary output from the model.
|
|
4050
4204
|
* Set to "auto" to automatically receive the richest level available,
|
|
4051
4205
|
* or "detailed" for comprehensive summaries.
|
|
4052
4206
|
*/
|
|
4053
|
-
reasoningSummary:
|
|
4207
|
+
reasoningSummary: z18.string().nullish(),
|
|
4054
4208
|
/**
|
|
4055
4209
|
* The identifier for safety monitoring and tracking.
|
|
4056
4210
|
*/
|
|
4057
|
-
safetyIdentifier:
|
|
4211
|
+
safetyIdentifier: z18.string().nullish(),
|
|
4058
4212
|
/**
|
|
4059
4213
|
* Service tier for the request.
|
|
4060
4214
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4062,34 +4216,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4062
4216
|
*
|
|
4063
4217
|
* Defaults to 'auto'.
|
|
4064
4218
|
*/
|
|
4065
|
-
serviceTier:
|
|
4219
|
+
serviceTier: z18.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4066
4220
|
/**
|
|
4067
4221
|
* Whether to store the generation. Defaults to `true`.
|
|
4068
4222
|
*/
|
|
4069
|
-
store:
|
|
4223
|
+
store: z18.boolean().nullish(),
|
|
4070
4224
|
/**
|
|
4071
4225
|
* Whether to use strict JSON schema validation.
|
|
4072
4226
|
* Defaults to `true`.
|
|
4073
4227
|
*/
|
|
4074
|
-
strictJsonSchema:
|
|
4228
|
+
strictJsonSchema: z18.boolean().nullish(),
|
|
4075
4229
|
/**
|
|
4076
4230
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4077
4231
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4078
4232
|
* Valid values: 'low', 'medium', 'high'.
|
|
4079
4233
|
*/
|
|
4080
|
-
textVerbosity:
|
|
4234
|
+
textVerbosity: z18.enum(["low", "medium", "high"]).nullish(),
|
|
4081
4235
|
/**
|
|
4082
4236
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4083
4237
|
* 'disabled' turns truncation off.
|
|
4084
4238
|
*/
|
|
4085
|
-
truncation:
|
|
4239
|
+
truncation: z18.enum(["auto", "disabled"]).nullish(),
|
|
4086
4240
|
/**
|
|
4087
4241
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4088
4242
|
* monitor and detect abuse.
|
|
4089
4243
|
* Defaults to `undefined`.
|
|
4090
4244
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4091
4245
|
*/
|
|
4092
|
-
user:
|
|
4246
|
+
user: z18.string().nullish(),
|
|
4093
4247
|
/**
|
|
4094
4248
|
* Override the system message mode for this model.
|
|
4095
4249
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4098,7 +4252,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4098
4252
|
*
|
|
4099
4253
|
* If not specified, the mode is automatically determined based on the model.
|
|
4100
4254
|
*/
|
|
4101
|
-
systemMessageMode:
|
|
4255
|
+
systemMessageMode: z18.enum(["system", "developer", "remove"]).optional(),
|
|
4102
4256
|
/**
|
|
4103
4257
|
* Force treating this model as a reasoning model.
|
|
4104
4258
|
*
|
|
@@ -4108,7 +4262,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4108
4262
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4109
4263
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4110
4264
|
*/
|
|
4111
|
-
forceReasoning:
|
|
4265
|
+
forceReasoning: z18.boolean().optional()
|
|
4112
4266
|
})
|
|
4113
4267
|
)
|
|
4114
4268
|
);
|
|
@@ -4121,44 +4275,44 @@ import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
|
|
|
4121
4275
|
|
|
4122
4276
|
// src/tool/code-interpreter.ts
|
|
4123
4277
|
import {
|
|
4124
|
-
createProviderToolFactoryWithOutputSchema as
|
|
4125
|
-
lazySchema as
|
|
4126
|
-
zodSchema as
|
|
4278
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
4279
|
+
lazySchema as lazySchema17,
|
|
4280
|
+
zodSchema as zodSchema17
|
|
4127
4281
|
} from "@ai-sdk/provider-utils";
|
|
4128
|
-
import { z as
|
|
4129
|
-
var codeInterpreterInputSchema =
|
|
4130
|
-
() =>
|
|
4131
|
-
|
|
4132
|
-
code:
|
|
4133
|
-
containerId:
|
|
4282
|
+
import { z as z19 } from "zod/v4";
|
|
4283
|
+
var codeInterpreterInputSchema = lazySchema17(
|
|
4284
|
+
() => zodSchema17(
|
|
4285
|
+
z19.object({
|
|
4286
|
+
code: z19.string().nullish(),
|
|
4287
|
+
containerId: z19.string()
|
|
4134
4288
|
})
|
|
4135
4289
|
)
|
|
4136
4290
|
);
|
|
4137
|
-
var codeInterpreterOutputSchema =
|
|
4138
|
-
() =>
|
|
4139
|
-
|
|
4140
|
-
outputs:
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4291
|
+
var codeInterpreterOutputSchema = lazySchema17(
|
|
4292
|
+
() => zodSchema17(
|
|
4293
|
+
z19.object({
|
|
4294
|
+
outputs: z19.array(
|
|
4295
|
+
z19.discriminatedUnion("type", [
|
|
4296
|
+
z19.object({ type: z19.literal("logs"), logs: z19.string() }),
|
|
4297
|
+
z19.object({ type: z19.literal("image"), url: z19.string() })
|
|
4144
4298
|
])
|
|
4145
4299
|
).nullish()
|
|
4146
4300
|
})
|
|
4147
4301
|
)
|
|
4148
4302
|
);
|
|
4149
|
-
var codeInterpreterArgsSchema =
|
|
4150
|
-
() =>
|
|
4151
|
-
|
|
4152
|
-
container:
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
fileIds:
|
|
4303
|
+
var codeInterpreterArgsSchema = lazySchema17(
|
|
4304
|
+
() => zodSchema17(
|
|
4305
|
+
z19.object({
|
|
4306
|
+
container: z19.union([
|
|
4307
|
+
z19.string(),
|
|
4308
|
+
z19.object({
|
|
4309
|
+
fileIds: z19.array(z19.string()).optional()
|
|
4156
4310
|
})
|
|
4157
4311
|
]).optional()
|
|
4158
4312
|
})
|
|
4159
4313
|
)
|
|
4160
4314
|
);
|
|
4161
|
-
var codeInterpreterToolFactory =
|
|
4315
|
+
var codeInterpreterToolFactory = createProviderToolFactoryWithOutputSchema5({
|
|
4162
4316
|
id: "openai.code_interpreter",
|
|
4163
4317
|
inputSchema: codeInterpreterInputSchema,
|
|
4164
4318
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -4169,88 +4323,88 @@ var codeInterpreter = (args = {}) => {
|
|
|
4169
4323
|
|
|
4170
4324
|
// src/tool/file-search.ts
|
|
4171
4325
|
import {
|
|
4172
|
-
createProviderToolFactoryWithOutputSchema as
|
|
4173
|
-
lazySchema as
|
|
4174
|
-
zodSchema as
|
|
4326
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
4327
|
+
lazySchema as lazySchema18,
|
|
4328
|
+
zodSchema as zodSchema18
|
|
4175
4329
|
} from "@ai-sdk/provider-utils";
|
|
4176
|
-
import { z as
|
|
4177
|
-
var comparisonFilterSchema =
|
|
4178
|
-
key:
|
|
4179
|
-
type:
|
|
4180
|
-
value:
|
|
4330
|
+
import { z as z20 } from "zod/v4";
|
|
4331
|
+
var comparisonFilterSchema = z20.object({
|
|
4332
|
+
key: z20.string(),
|
|
4333
|
+
type: z20.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
4334
|
+
value: z20.union([z20.string(), z20.number(), z20.boolean(), z20.array(z20.string())])
|
|
4181
4335
|
});
|
|
4182
|
-
var compoundFilterSchema =
|
|
4183
|
-
type:
|
|
4184
|
-
filters:
|
|
4185
|
-
|
|
4336
|
+
var compoundFilterSchema = z20.object({
|
|
4337
|
+
type: z20.enum(["and", "or"]),
|
|
4338
|
+
filters: z20.array(
|
|
4339
|
+
z20.union([comparisonFilterSchema, z20.lazy(() => compoundFilterSchema)])
|
|
4186
4340
|
)
|
|
4187
4341
|
});
|
|
4188
|
-
var fileSearchArgsSchema =
|
|
4189
|
-
() =>
|
|
4190
|
-
|
|
4191
|
-
vectorStoreIds:
|
|
4192
|
-
maxNumResults:
|
|
4193
|
-
ranking:
|
|
4194
|
-
ranker:
|
|
4195
|
-
scoreThreshold:
|
|
4342
|
+
var fileSearchArgsSchema = lazySchema18(
|
|
4343
|
+
() => zodSchema18(
|
|
4344
|
+
z20.object({
|
|
4345
|
+
vectorStoreIds: z20.array(z20.string()),
|
|
4346
|
+
maxNumResults: z20.number().optional(),
|
|
4347
|
+
ranking: z20.object({
|
|
4348
|
+
ranker: z20.string().optional(),
|
|
4349
|
+
scoreThreshold: z20.number().optional()
|
|
4196
4350
|
}).optional(),
|
|
4197
|
-
filters:
|
|
4351
|
+
filters: z20.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
4198
4352
|
})
|
|
4199
4353
|
)
|
|
4200
4354
|
);
|
|
4201
|
-
var fileSearchOutputSchema =
|
|
4202
|
-
() =>
|
|
4203
|
-
|
|
4204
|
-
queries:
|
|
4205
|
-
results:
|
|
4206
|
-
|
|
4207
|
-
attributes:
|
|
4208
|
-
fileId:
|
|
4209
|
-
filename:
|
|
4210
|
-
score:
|
|
4211
|
-
text:
|
|
4355
|
+
var fileSearchOutputSchema = lazySchema18(
|
|
4356
|
+
() => zodSchema18(
|
|
4357
|
+
z20.object({
|
|
4358
|
+
queries: z20.array(z20.string()),
|
|
4359
|
+
results: z20.array(
|
|
4360
|
+
z20.object({
|
|
4361
|
+
attributes: z20.record(z20.string(), z20.unknown()),
|
|
4362
|
+
fileId: z20.string(),
|
|
4363
|
+
filename: z20.string(),
|
|
4364
|
+
score: z20.number(),
|
|
4365
|
+
text: z20.string()
|
|
4212
4366
|
})
|
|
4213
4367
|
).nullable()
|
|
4214
4368
|
})
|
|
4215
4369
|
)
|
|
4216
4370
|
);
|
|
4217
|
-
var fileSearch =
|
|
4371
|
+
var fileSearch = createProviderToolFactoryWithOutputSchema6({
|
|
4218
4372
|
id: "openai.file_search",
|
|
4219
|
-
inputSchema:
|
|
4373
|
+
inputSchema: z20.object({}),
|
|
4220
4374
|
outputSchema: fileSearchOutputSchema
|
|
4221
4375
|
});
|
|
4222
4376
|
|
|
4223
4377
|
// src/tool/image-generation.ts
|
|
4224
4378
|
import {
|
|
4225
|
-
createProviderToolFactoryWithOutputSchema as
|
|
4226
|
-
lazySchema as
|
|
4227
|
-
zodSchema as
|
|
4379
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
4380
|
+
lazySchema as lazySchema19,
|
|
4381
|
+
zodSchema as zodSchema19
|
|
4228
4382
|
} from "@ai-sdk/provider-utils";
|
|
4229
|
-
import { z as
|
|
4230
|
-
var imageGenerationArgsSchema =
|
|
4231
|
-
() =>
|
|
4232
|
-
|
|
4233
|
-
background:
|
|
4234
|
-
inputFidelity:
|
|
4235
|
-
inputImageMask:
|
|
4236
|
-
fileId:
|
|
4237
|
-
imageUrl:
|
|
4383
|
+
import { z as z21 } from "zod/v4";
|
|
4384
|
+
var imageGenerationArgsSchema = lazySchema19(
|
|
4385
|
+
() => zodSchema19(
|
|
4386
|
+
z21.object({
|
|
4387
|
+
background: z21.enum(["auto", "opaque", "transparent"]).optional(),
|
|
4388
|
+
inputFidelity: z21.enum(["low", "high"]).optional(),
|
|
4389
|
+
inputImageMask: z21.object({
|
|
4390
|
+
fileId: z21.string().optional(),
|
|
4391
|
+
imageUrl: z21.string().optional()
|
|
4238
4392
|
}).optional(),
|
|
4239
|
-
model:
|
|
4240
|
-
moderation:
|
|
4241
|
-
outputCompression:
|
|
4242
|
-
outputFormat:
|
|
4243
|
-
partialImages:
|
|
4244
|
-
quality:
|
|
4245
|
-
size:
|
|
4393
|
+
model: z21.string().optional(),
|
|
4394
|
+
moderation: z21.enum(["auto"]).optional(),
|
|
4395
|
+
outputCompression: z21.number().int().min(0).max(100).optional(),
|
|
4396
|
+
outputFormat: z21.enum(["png", "jpeg", "webp"]).optional(),
|
|
4397
|
+
partialImages: z21.number().int().min(0).max(3).optional(),
|
|
4398
|
+
quality: z21.enum(["auto", "low", "medium", "high"]).optional(),
|
|
4399
|
+
size: z21.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
4246
4400
|
}).strict()
|
|
4247
4401
|
)
|
|
4248
4402
|
);
|
|
4249
|
-
var imageGenerationInputSchema =
|
|
4250
|
-
var imageGenerationOutputSchema =
|
|
4251
|
-
() =>
|
|
4403
|
+
var imageGenerationInputSchema = lazySchema19(() => zodSchema19(z21.object({})));
|
|
4404
|
+
var imageGenerationOutputSchema = lazySchema19(
|
|
4405
|
+
() => zodSchema19(z21.object({ result: z21.string() }))
|
|
4252
4406
|
);
|
|
4253
|
-
var imageGenerationToolFactory =
|
|
4407
|
+
var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema7({
|
|
4254
4408
|
id: "openai.image_generation",
|
|
4255
4409
|
inputSchema: imageGenerationInputSchema,
|
|
4256
4410
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -4262,29 +4416,29 @@ var imageGeneration = (args = {}) => {
|
|
|
4262
4416
|
// src/tool/custom.ts
|
|
4263
4417
|
import {
|
|
4264
4418
|
createProviderToolFactory,
|
|
4265
|
-
lazySchema as
|
|
4266
|
-
zodSchema as
|
|
4419
|
+
lazySchema as lazySchema20,
|
|
4420
|
+
zodSchema as zodSchema20
|
|
4267
4421
|
} from "@ai-sdk/provider-utils";
|
|
4268
|
-
import { z as
|
|
4269
|
-
var customArgsSchema =
|
|
4270
|
-
() =>
|
|
4271
|
-
|
|
4272
|
-
name:
|
|
4273
|
-
description:
|
|
4274
|
-
format:
|
|
4275
|
-
|
|
4276
|
-
type:
|
|
4277
|
-
syntax:
|
|
4278
|
-
definition:
|
|
4422
|
+
import { z as z22 } from "zod/v4";
|
|
4423
|
+
var customArgsSchema = lazySchema20(
|
|
4424
|
+
() => zodSchema20(
|
|
4425
|
+
z22.object({
|
|
4426
|
+
name: z22.string(),
|
|
4427
|
+
description: z22.string().optional(),
|
|
4428
|
+
format: z22.union([
|
|
4429
|
+
z22.object({
|
|
4430
|
+
type: z22.literal("grammar"),
|
|
4431
|
+
syntax: z22.enum(["regex", "lark"]),
|
|
4432
|
+
definition: z22.string()
|
|
4279
4433
|
}),
|
|
4280
|
-
|
|
4281
|
-
type:
|
|
4434
|
+
z22.object({
|
|
4435
|
+
type: z22.literal("text")
|
|
4282
4436
|
})
|
|
4283
4437
|
]).optional()
|
|
4284
4438
|
})
|
|
4285
4439
|
)
|
|
4286
4440
|
);
|
|
4287
|
-
var customInputSchema =
|
|
4441
|
+
var customInputSchema = lazySchema20(() => zodSchema20(z22.string()));
|
|
4288
4442
|
var customToolFactory = createProviderToolFactory({
|
|
4289
4443
|
id: "openai.custom",
|
|
4290
4444
|
inputSchema: customInputSchema
|
|
@@ -4292,137 +4446,82 @@ var customToolFactory = createProviderToolFactory({
|
|
|
4292
4446
|
|
|
4293
4447
|
// src/tool/mcp.ts
|
|
4294
4448
|
import {
|
|
4295
|
-
createProviderToolFactoryWithOutputSchema as
|
|
4296
|
-
lazySchema as
|
|
4297
|
-
zodSchema as
|
|
4449
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
4450
|
+
lazySchema as lazySchema21,
|
|
4451
|
+
zodSchema as zodSchema21
|
|
4298
4452
|
} from "@ai-sdk/provider-utils";
|
|
4299
|
-
import { z as
|
|
4300
|
-
var
|
|
4301
|
-
() =>
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4453
|
+
import { z as z23 } from "zod/v4";
|
|
4454
|
+
var jsonValueSchema2 = z23.lazy(
|
|
4455
|
+
() => z23.union([
|
|
4456
|
+
z23.string(),
|
|
4457
|
+
z23.number(),
|
|
4458
|
+
z23.boolean(),
|
|
4459
|
+
z23.null(),
|
|
4460
|
+
z23.array(jsonValueSchema2),
|
|
4461
|
+
z23.record(z23.string(), jsonValueSchema2)
|
|
4308
4462
|
])
|
|
4309
4463
|
);
|
|
4310
|
-
var mcpArgsSchema =
|
|
4311
|
-
() =>
|
|
4312
|
-
|
|
4313
|
-
serverLabel:
|
|
4314
|
-
allowedTools:
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
readOnly:
|
|
4318
|
-
toolNames:
|
|
4464
|
+
var mcpArgsSchema = lazySchema21(
|
|
4465
|
+
() => zodSchema21(
|
|
4466
|
+
z23.object({
|
|
4467
|
+
serverLabel: z23.string(),
|
|
4468
|
+
allowedTools: z23.union([
|
|
4469
|
+
z23.array(z23.string()),
|
|
4470
|
+
z23.object({
|
|
4471
|
+
readOnly: z23.boolean().optional(),
|
|
4472
|
+
toolNames: z23.array(z23.string()).optional()
|
|
4319
4473
|
})
|
|
4320
4474
|
]).optional(),
|
|
4321
|
-
authorization:
|
|
4322
|
-
connectorId:
|
|
4323
|
-
headers:
|
|
4324
|
-
requireApproval:
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
never:
|
|
4328
|
-
toolNames:
|
|
4475
|
+
authorization: z23.string().optional(),
|
|
4476
|
+
connectorId: z23.string().optional(),
|
|
4477
|
+
headers: z23.record(z23.string(), z23.string()).optional(),
|
|
4478
|
+
requireApproval: z23.union([
|
|
4479
|
+
z23.enum(["always", "never"]),
|
|
4480
|
+
z23.object({
|
|
4481
|
+
never: z23.object({
|
|
4482
|
+
toolNames: z23.array(z23.string()).optional()
|
|
4329
4483
|
}).optional()
|
|
4330
4484
|
})
|
|
4331
4485
|
]).optional(),
|
|
4332
|
-
serverDescription:
|
|
4333
|
-
serverUrl:
|
|
4486
|
+
serverDescription: z23.string().optional(),
|
|
4487
|
+
serverUrl: z23.string().optional()
|
|
4334
4488
|
}).refine(
|
|
4335
4489
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
4336
4490
|
"One of serverUrl or connectorId must be provided."
|
|
4337
4491
|
)
|
|
4338
4492
|
)
|
|
4339
4493
|
);
|
|
4340
|
-
var mcpInputSchema =
|
|
4341
|
-
var mcpOutputSchema =
|
|
4342
|
-
() =>
|
|
4343
|
-
|
|
4344
|
-
type:
|
|
4345
|
-
serverLabel:
|
|
4346
|
-
name:
|
|
4347
|
-
arguments:
|
|
4348
|
-
output:
|
|
4349
|
-
error:
|
|
4494
|
+
var mcpInputSchema = lazySchema21(() => zodSchema21(z23.object({})));
|
|
4495
|
+
var mcpOutputSchema = lazySchema21(
|
|
4496
|
+
() => zodSchema21(
|
|
4497
|
+
z23.object({
|
|
4498
|
+
type: z23.literal("call"),
|
|
4499
|
+
serverLabel: z23.string(),
|
|
4500
|
+
name: z23.string(),
|
|
4501
|
+
arguments: z23.string(),
|
|
4502
|
+
output: z23.string().nullish(),
|
|
4503
|
+
error: z23.union([z23.string(), jsonValueSchema2]).optional()
|
|
4350
4504
|
})
|
|
4351
4505
|
)
|
|
4352
4506
|
);
|
|
4353
|
-
var mcpToolFactory =
|
|
4507
|
+
var mcpToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
4354
4508
|
id: "openai.mcp",
|
|
4355
4509
|
inputSchema: mcpInputSchema,
|
|
4356
4510
|
outputSchema: mcpOutputSchema
|
|
4357
4511
|
});
|
|
4358
4512
|
|
|
4359
4513
|
// src/tool/web-search.ts
|
|
4360
|
-
import {
|
|
4361
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
4362
|
-
lazySchema as lazySchema21,
|
|
4363
|
-
zodSchema as zodSchema21
|
|
4364
|
-
} from "@ai-sdk/provider-utils";
|
|
4365
|
-
import { z as z23 } from "zod/v4";
|
|
4366
|
-
var webSearchArgsSchema = lazySchema21(
|
|
4367
|
-
() => zodSchema21(
|
|
4368
|
-
z23.object({
|
|
4369
|
-
externalWebAccess: z23.boolean().optional(),
|
|
4370
|
-
filters: z23.object({ allowedDomains: z23.array(z23.string()).optional() }).optional(),
|
|
4371
|
-
searchContextSize: z23.enum(["low", "medium", "high"]).optional(),
|
|
4372
|
-
userLocation: z23.object({
|
|
4373
|
-
type: z23.literal("approximate"),
|
|
4374
|
-
country: z23.string().optional(),
|
|
4375
|
-
city: z23.string().optional(),
|
|
4376
|
-
region: z23.string().optional(),
|
|
4377
|
-
timezone: z23.string().optional()
|
|
4378
|
-
}).optional()
|
|
4379
|
-
})
|
|
4380
|
-
)
|
|
4381
|
-
);
|
|
4382
|
-
var webSearchInputSchema = lazySchema21(() => zodSchema21(z23.object({})));
|
|
4383
|
-
var webSearchOutputSchema = lazySchema21(
|
|
4384
|
-
() => zodSchema21(
|
|
4385
|
-
z23.object({
|
|
4386
|
-
action: z23.discriminatedUnion("type", [
|
|
4387
|
-
z23.object({
|
|
4388
|
-
type: z23.literal("search"),
|
|
4389
|
-
query: z23.string().optional()
|
|
4390
|
-
}),
|
|
4391
|
-
z23.object({
|
|
4392
|
-
type: z23.literal("openPage"),
|
|
4393
|
-
url: z23.string().nullish()
|
|
4394
|
-
}),
|
|
4395
|
-
z23.object({
|
|
4396
|
-
type: z23.literal("findInPage"),
|
|
4397
|
-
url: z23.string().nullish(),
|
|
4398
|
-
pattern: z23.string().nullish()
|
|
4399
|
-
})
|
|
4400
|
-
]).optional(),
|
|
4401
|
-
sources: z23.array(
|
|
4402
|
-
z23.discriminatedUnion("type", [
|
|
4403
|
-
z23.object({ type: z23.literal("url"), url: z23.string() }),
|
|
4404
|
-
z23.object({ type: z23.literal("api"), name: z23.string() })
|
|
4405
|
-
])
|
|
4406
|
-
).optional()
|
|
4407
|
-
})
|
|
4408
|
-
)
|
|
4409
|
-
);
|
|
4410
|
-
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
4411
|
-
id: "openai.web_search",
|
|
4412
|
-
inputSchema: webSearchInputSchema,
|
|
4413
|
-
outputSchema: webSearchOutputSchema
|
|
4414
|
-
});
|
|
4415
|
-
|
|
4416
|
-
// src/tool/web-search-preview.ts
|
|
4417
4514
|
import {
|
|
4418
4515
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
4419
4516
|
lazySchema as lazySchema22,
|
|
4420
4517
|
zodSchema as zodSchema22
|
|
4421
4518
|
} from "@ai-sdk/provider-utils";
|
|
4422
4519
|
import { z as z24 } from "zod/v4";
|
|
4423
|
-
var
|
|
4520
|
+
var webSearchArgsSchema = lazySchema22(
|
|
4424
4521
|
() => zodSchema22(
|
|
4425
4522
|
z24.object({
|
|
4523
|
+
externalWebAccess: z24.boolean().optional(),
|
|
4524
|
+
filters: z24.object({ allowedDomains: z24.array(z24.string()).optional() }).optional(),
|
|
4426
4525
|
searchContextSize: z24.enum(["low", "medium", "high"]).optional(),
|
|
4427
4526
|
userLocation: z24.object({
|
|
4428
4527
|
type: z24.literal("approximate"),
|
|
@@ -4434,10 +4533,8 @@ var webSearchPreviewArgsSchema = lazySchema22(
|
|
|
4434
4533
|
})
|
|
4435
4534
|
)
|
|
4436
4535
|
);
|
|
4437
|
-
var
|
|
4438
|
-
|
|
4439
|
-
);
|
|
4440
|
-
var webSearchPreviewOutputSchema = lazySchema22(
|
|
4536
|
+
var webSearchInputSchema = lazySchema22(() => zodSchema22(z24.object({})));
|
|
4537
|
+
var webSearchOutputSchema = lazySchema22(
|
|
4441
4538
|
() => zodSchema22(
|
|
4442
4539
|
z24.object({
|
|
4443
4540
|
action: z24.discriminatedUnion("type", [
|
|
@@ -4454,11 +4551,68 @@ var webSearchPreviewOutputSchema = lazySchema22(
|
|
|
4454
4551
|
url: z24.string().nullish(),
|
|
4455
4552
|
pattern: z24.string().nullish()
|
|
4456
4553
|
})
|
|
4554
|
+
]).optional(),
|
|
4555
|
+
sources: z24.array(
|
|
4556
|
+
z24.discriminatedUnion("type", [
|
|
4557
|
+
z24.object({ type: z24.literal("url"), url: z24.string() }),
|
|
4558
|
+
z24.object({ type: z24.literal("api"), name: z24.string() })
|
|
4559
|
+
])
|
|
4560
|
+
).optional()
|
|
4561
|
+
})
|
|
4562
|
+
)
|
|
4563
|
+
);
|
|
4564
|
+
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema9({
|
|
4565
|
+
id: "openai.web_search",
|
|
4566
|
+
inputSchema: webSearchInputSchema,
|
|
4567
|
+
outputSchema: webSearchOutputSchema
|
|
4568
|
+
});
|
|
4569
|
+
|
|
4570
|
+
// src/tool/web-search-preview.ts
|
|
4571
|
+
import {
|
|
4572
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
4573
|
+
lazySchema as lazySchema23,
|
|
4574
|
+
zodSchema as zodSchema23
|
|
4575
|
+
} from "@ai-sdk/provider-utils";
|
|
4576
|
+
import { z as z25 } from "zod/v4";
|
|
4577
|
+
var webSearchPreviewArgsSchema = lazySchema23(
|
|
4578
|
+
() => zodSchema23(
|
|
4579
|
+
z25.object({
|
|
4580
|
+
searchContextSize: z25.enum(["low", "medium", "high"]).optional(),
|
|
4581
|
+
userLocation: z25.object({
|
|
4582
|
+
type: z25.literal("approximate"),
|
|
4583
|
+
country: z25.string().optional(),
|
|
4584
|
+
city: z25.string().optional(),
|
|
4585
|
+
region: z25.string().optional(),
|
|
4586
|
+
timezone: z25.string().optional()
|
|
4587
|
+
}).optional()
|
|
4588
|
+
})
|
|
4589
|
+
)
|
|
4590
|
+
);
|
|
4591
|
+
var webSearchPreviewInputSchema = lazySchema23(
|
|
4592
|
+
() => zodSchema23(z25.object({}))
|
|
4593
|
+
);
|
|
4594
|
+
var webSearchPreviewOutputSchema = lazySchema23(
|
|
4595
|
+
() => zodSchema23(
|
|
4596
|
+
z25.object({
|
|
4597
|
+
action: z25.discriminatedUnion("type", [
|
|
4598
|
+
z25.object({
|
|
4599
|
+
type: z25.literal("search"),
|
|
4600
|
+
query: z25.string().optional()
|
|
4601
|
+
}),
|
|
4602
|
+
z25.object({
|
|
4603
|
+
type: z25.literal("openPage"),
|
|
4604
|
+
url: z25.string().nullish()
|
|
4605
|
+
}),
|
|
4606
|
+
z25.object({
|
|
4607
|
+
type: z25.literal("findInPage"),
|
|
4608
|
+
url: z25.string().nullish(),
|
|
4609
|
+
pattern: z25.string().nullish()
|
|
4610
|
+
})
|
|
4457
4611
|
]).optional()
|
|
4458
4612
|
})
|
|
4459
4613
|
)
|
|
4460
4614
|
);
|
|
4461
|
-
var webSearchPreview =
|
|
4615
|
+
var webSearchPreview = createProviderToolFactoryWithOutputSchema10({
|
|
4462
4616
|
id: "openai.web_search_preview",
|
|
4463
4617
|
inputSchema: webSearchPreviewInputSchema,
|
|
4464
4618
|
outputSchema: webSearchPreviewOutputSchema
|
|
@@ -4471,7 +4625,7 @@ async function prepareResponsesTools({
|
|
|
4471
4625
|
toolNameMapping,
|
|
4472
4626
|
customProviderToolNames
|
|
4473
4627
|
}) {
|
|
4474
|
-
var _a;
|
|
4628
|
+
var _a, _b;
|
|
4475
4629
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
4476
4630
|
const toolWarnings = [];
|
|
4477
4631
|
if (tools == null) {
|
|
@@ -4481,15 +4635,19 @@ async function prepareResponsesTools({
|
|
|
4481
4635
|
const resolvedCustomProviderToolNames = customProviderToolNames != null ? customProviderToolNames : /* @__PURE__ */ new Set();
|
|
4482
4636
|
for (const tool of tools) {
|
|
4483
4637
|
switch (tool.type) {
|
|
4484
|
-
case "function":
|
|
4638
|
+
case "function": {
|
|
4639
|
+
const openaiOptions = (_a = tool.providerOptions) == null ? void 0 : _a.openai;
|
|
4640
|
+
const deferLoading = openaiOptions == null ? void 0 : openaiOptions.deferLoading;
|
|
4485
4641
|
openaiTools.push({
|
|
4486
4642
|
type: "function",
|
|
4487
4643
|
name: tool.name,
|
|
4488
4644
|
description: tool.description,
|
|
4489
4645
|
parameters: tool.inputSchema,
|
|
4490
|
-
...tool.strict != null ? { strict: tool.strict } : {}
|
|
4646
|
+
...tool.strict != null ? { strict: tool.strict } : {},
|
|
4647
|
+
...deferLoading != null ? { defer_loading: deferLoading } : {}
|
|
4491
4648
|
});
|
|
4492
4649
|
break;
|
|
4650
|
+
}
|
|
4493
4651
|
case "provider": {
|
|
4494
4652
|
switch (tool.id) {
|
|
4495
4653
|
case "openai.file_search": {
|
|
@@ -4634,6 +4792,19 @@ async function prepareResponsesTools({
|
|
|
4634
4792
|
resolvedCustomProviderToolNames.add(args.name);
|
|
4635
4793
|
break;
|
|
4636
4794
|
}
|
|
4795
|
+
case "openai.tool_search": {
|
|
4796
|
+
const args = await validateTypes2({
|
|
4797
|
+
value: tool.args,
|
|
4798
|
+
schema: toolSearchArgsSchema
|
|
4799
|
+
});
|
|
4800
|
+
openaiTools.push({
|
|
4801
|
+
type: "tool_search",
|
|
4802
|
+
...args.execution != null ? { execution: args.execution } : {},
|
|
4803
|
+
...args.description != null ? { description: args.description } : {},
|
|
4804
|
+
...args.parameters != null ? { parameters: args.parameters } : {}
|
|
4805
|
+
});
|
|
4806
|
+
break;
|
|
4807
|
+
}
|
|
4637
4808
|
}
|
|
4638
4809
|
break;
|
|
4639
4810
|
}
|
|
@@ -4655,7 +4826,7 @@ async function prepareResponsesTools({
|
|
|
4655
4826
|
case "required":
|
|
4656
4827
|
return { tools: openaiTools, toolChoice: type, toolWarnings };
|
|
4657
4828
|
case "tool": {
|
|
4658
|
-
const resolvedToolName = (
|
|
4829
|
+
const resolvedToolName = (_b = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _b : toolChoice.toolName;
|
|
4659
4830
|
return {
|
|
4660
4831
|
tools: openaiTools,
|
|
4661
4832
|
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 },
|
|
@@ -4811,7 +4982,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4811
4982
|
"openai.web_search": "web_search",
|
|
4812
4983
|
"openai.web_search_preview": "web_search_preview",
|
|
4813
4984
|
"openai.mcp": "mcp",
|
|
4814
|
-
"openai.apply_patch": "apply_patch"
|
|
4985
|
+
"openai.apply_patch": "apply_patch",
|
|
4986
|
+
"openai.tool_search": "tool_search"
|
|
4815
4987
|
},
|
|
4816
4988
|
resolveProviderToolName: (tool) => tool.id === "openai.custom" ? tool.args.name : void 0
|
|
4817
4989
|
});
|
|
@@ -4989,7 +5161,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4989
5161
|
};
|
|
4990
5162
|
}
|
|
4991
5163
|
async doGenerate(options) {
|
|
4992
|
-
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;
|
|
5164
|
+
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;
|
|
4993
5165
|
const {
|
|
4994
5166
|
args: body,
|
|
4995
5167
|
warnings,
|
|
@@ -5032,6 +5204,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5032
5204
|
const content = [];
|
|
5033
5205
|
const logprobs = [];
|
|
5034
5206
|
let hasFunctionCall = false;
|
|
5207
|
+
const hostedToolSearchCallIds = [];
|
|
5035
5208
|
for (const part of response.output) {
|
|
5036
5209
|
switch (part.type) {
|
|
5037
5210
|
case "reasoning": {
|
|
@@ -5070,6 +5243,46 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5070
5243
|
});
|
|
5071
5244
|
break;
|
|
5072
5245
|
}
|
|
5246
|
+
case "tool_search_call": {
|
|
5247
|
+
const toolCallId = (_b = part.call_id) != null ? _b : part.id;
|
|
5248
|
+
const isHosted = part.execution === "server";
|
|
5249
|
+
if (isHosted) {
|
|
5250
|
+
hostedToolSearchCallIds.push(toolCallId);
|
|
5251
|
+
}
|
|
5252
|
+
content.push({
|
|
5253
|
+
type: "tool-call",
|
|
5254
|
+
toolCallId,
|
|
5255
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
5256
|
+
input: JSON.stringify({
|
|
5257
|
+
arguments: part.arguments,
|
|
5258
|
+
call_id: part.call_id
|
|
5259
|
+
}),
|
|
5260
|
+
...isHosted ? { providerExecuted: true } : {},
|
|
5261
|
+
providerMetadata: {
|
|
5262
|
+
[providerOptionsName]: {
|
|
5263
|
+
itemId: part.id
|
|
5264
|
+
}
|
|
5265
|
+
}
|
|
5266
|
+
});
|
|
5267
|
+
break;
|
|
5268
|
+
}
|
|
5269
|
+
case "tool_search_output": {
|
|
5270
|
+
const toolCallId = (_d = (_c = part.call_id) != null ? _c : hostedToolSearchCallIds.shift()) != null ? _d : part.id;
|
|
5271
|
+
content.push({
|
|
5272
|
+
type: "tool-result",
|
|
5273
|
+
toolCallId,
|
|
5274
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
5275
|
+
result: {
|
|
5276
|
+
tools: part.tools
|
|
5277
|
+
},
|
|
5278
|
+
providerMetadata: {
|
|
5279
|
+
[providerOptionsName]: {
|
|
5280
|
+
itemId: part.id
|
|
5281
|
+
}
|
|
5282
|
+
}
|
|
5283
|
+
});
|
|
5284
|
+
break;
|
|
5285
|
+
}
|
|
5073
5286
|
case "local_shell_call": {
|
|
5074
5287
|
content.push({
|
|
5075
5288
|
type: "tool-call",
|
|
@@ -5125,7 +5338,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5125
5338
|
}
|
|
5126
5339
|
case "message": {
|
|
5127
5340
|
for (const contentPart of part.content) {
|
|
5128
|
-
if (((
|
|
5341
|
+
if (((_f = (_e = options.providerOptions) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.logprobs) && contentPart.logprobs) {
|
|
5129
5342
|
logprobs.push(contentPart.logprobs);
|
|
5130
5343
|
}
|
|
5131
5344
|
const providerMetadata2 = {
|
|
@@ -5147,7 +5360,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5147
5360
|
content.push({
|
|
5148
5361
|
type: "source",
|
|
5149
5362
|
sourceType: "url",
|
|
5150
|
-
id: (
|
|
5363
|
+
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : generateId2(),
|
|
5151
5364
|
url: annotation.url,
|
|
5152
5365
|
title: annotation.title
|
|
5153
5366
|
});
|
|
@@ -5155,7 +5368,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5155
5368
|
content.push({
|
|
5156
5369
|
type: "source",
|
|
5157
5370
|
sourceType: "document",
|
|
5158
|
-
id: (
|
|
5371
|
+
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
|
|
5159
5372
|
mediaType: "text/plain",
|
|
5160
5373
|
title: annotation.filename,
|
|
5161
5374
|
filename: annotation.filename,
|
|
@@ -5171,7 +5384,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5171
5384
|
content.push({
|
|
5172
5385
|
type: "source",
|
|
5173
5386
|
sourceType: "document",
|
|
5174
|
-
id: (
|
|
5387
|
+
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
|
|
5175
5388
|
mediaType: "text/plain",
|
|
5176
5389
|
title: annotation.filename,
|
|
5177
5390
|
filename: annotation.filename,
|
|
@@ -5187,7 +5400,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5187
5400
|
content.push({
|
|
5188
5401
|
type: "source",
|
|
5189
5402
|
sourceType: "document",
|
|
5190
|
-
id: (
|
|
5403
|
+
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : generateId2(),
|
|
5191
5404
|
mediaType: "application/octet-stream",
|
|
5192
5405
|
title: annotation.file_id,
|
|
5193
5406
|
filename: annotation.file_id,
|
|
@@ -5256,7 +5469,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5256
5469
|
break;
|
|
5257
5470
|
}
|
|
5258
5471
|
case "mcp_call": {
|
|
5259
|
-
const toolCallId = part.approval_request_id != null ? (
|
|
5472
|
+
const toolCallId = part.approval_request_id != null ? (_s = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _s : part.id : part.id;
|
|
5260
5473
|
const toolName = `mcp.${part.name}`;
|
|
5261
5474
|
content.push({
|
|
5262
5475
|
type: "tool-call",
|
|
@@ -5290,8 +5503,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5290
5503
|
break;
|
|
5291
5504
|
}
|
|
5292
5505
|
case "mcp_approval_request": {
|
|
5293
|
-
const approvalRequestId = (
|
|
5294
|
-
const dummyToolCallId = (
|
|
5506
|
+
const approvalRequestId = (_t = part.approval_request_id) != null ? _t : part.id;
|
|
5507
|
+
const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : generateId2();
|
|
5295
5508
|
const toolName = `mcp.${part.name}`;
|
|
5296
5509
|
content.push({
|
|
5297
5510
|
type: "tool-call",
|
|
@@ -5341,13 +5554,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5341
5554
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
5342
5555
|
result: {
|
|
5343
5556
|
queries: part.queries,
|
|
5344
|
-
results: (
|
|
5557
|
+
results: (_y = (_x = part.results) == null ? void 0 : _x.map((result) => ({
|
|
5345
5558
|
attributes: result.attributes,
|
|
5346
5559
|
fileId: result.file_id,
|
|
5347
5560
|
filename: result.filename,
|
|
5348
5561
|
score: result.score,
|
|
5349
5562
|
text: result.text
|
|
5350
|
-
}))) != null ?
|
|
5563
|
+
}))) != null ? _y : null
|
|
5351
5564
|
}
|
|
5352
5565
|
});
|
|
5353
5566
|
break;
|
|
@@ -5404,10 +5617,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5404
5617
|
content,
|
|
5405
5618
|
finishReason: {
|
|
5406
5619
|
unified: mapOpenAIResponseFinishReason({
|
|
5407
|
-
finishReason: (
|
|
5620
|
+
finishReason: (_z = response.incomplete_details) == null ? void 0 : _z.reason,
|
|
5408
5621
|
hasFunctionCall
|
|
5409
5622
|
}),
|
|
5410
|
-
raw: (
|
|
5623
|
+
raw: (_B = (_A = response.incomplete_details) == null ? void 0 : _A.reason) != null ? _B : void 0
|
|
5411
5624
|
},
|
|
5412
5625
|
usage: convertOpenAIResponsesUsage(usage),
|
|
5413
5626
|
request: { body },
|
|
@@ -5465,6 +5678,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5465
5678
|
let hasFunctionCall = false;
|
|
5466
5679
|
const activeReasoning = {};
|
|
5467
5680
|
let serviceTier;
|
|
5681
|
+
const hostedToolSearchCallIds = [];
|
|
5468
5682
|
return {
|
|
5469
5683
|
stream: response.pipeThrough(
|
|
5470
5684
|
new TransformStream({
|
|
@@ -5472,7 +5686,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5472
5686
|
controller.enqueue({ type: "stream-start", warnings });
|
|
5473
5687
|
},
|
|
5474
5688
|
transform(chunk, controller) {
|
|
5475
|
-
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;
|
|
5689
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
|
|
5476
5690
|
if (options.includeRawChunks) {
|
|
5477
5691
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
5478
5692
|
}
|
|
@@ -5580,6 +5794,24 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5580
5794
|
input: "{}",
|
|
5581
5795
|
providerExecuted: true
|
|
5582
5796
|
});
|
|
5797
|
+
} else if (value.item.type === "tool_search_call") {
|
|
5798
|
+
const toolCallId = value.item.id;
|
|
5799
|
+
const toolName = toolNameMapping.toCustomToolName("tool_search");
|
|
5800
|
+
const isHosted = value.item.execution === "server";
|
|
5801
|
+
ongoingToolCalls[value.output_index] = {
|
|
5802
|
+
toolName,
|
|
5803
|
+
toolCallId,
|
|
5804
|
+
toolSearchExecution: (_a = value.item.execution) != null ? _a : "server"
|
|
5805
|
+
};
|
|
5806
|
+
if (isHosted) {
|
|
5807
|
+
controller.enqueue({
|
|
5808
|
+
type: "tool-input-start",
|
|
5809
|
+
id: toolCallId,
|
|
5810
|
+
toolName,
|
|
5811
|
+
providerExecuted: true
|
|
5812
|
+
});
|
|
5813
|
+
}
|
|
5814
|
+
} else if (value.item.type === "tool_search_output") {
|
|
5583
5815
|
} else if (value.item.type === "mcp_call" || value.item.type === "mcp_list_tools" || value.item.type === "mcp_approval_request") {
|
|
5584
5816
|
} else if (value.item.type === "apply_patch_call") {
|
|
5585
5817
|
const { call_id: callId, operation } = value.item;
|
|
@@ -5626,7 +5858,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5626
5858
|
} else if (value.item.type === "shell_call_output") {
|
|
5627
5859
|
} else if (value.item.type === "message") {
|
|
5628
5860
|
ongoingAnnotations.splice(0, ongoingAnnotations.length);
|
|
5629
|
-
activeMessagePhase = (
|
|
5861
|
+
activeMessagePhase = (_b = value.item.phase) != null ? _b : void 0;
|
|
5630
5862
|
controller.enqueue({
|
|
5631
5863
|
type: "text-start",
|
|
5632
5864
|
id: value.item.id,
|
|
@@ -5650,14 +5882,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5650
5882
|
providerMetadata: {
|
|
5651
5883
|
[providerOptionsName]: {
|
|
5652
5884
|
itemId: value.item.id,
|
|
5653
|
-
reasoningEncryptedContent: (
|
|
5885
|
+
reasoningEncryptedContent: (_c = value.item.encrypted_content) != null ? _c : null
|
|
5654
5886
|
}
|
|
5655
5887
|
}
|
|
5656
5888
|
});
|
|
5657
5889
|
}
|
|
5658
5890
|
} else if (isResponseOutputItemDoneChunk(value)) {
|
|
5659
5891
|
if (value.item.type === "message") {
|
|
5660
|
-
const phase = (
|
|
5892
|
+
const phase = (_d = value.item.phase) != null ? _d : activeMessagePhase;
|
|
5661
5893
|
activeMessagePhase = void 0;
|
|
5662
5894
|
controller.enqueue({
|
|
5663
5895
|
type: "text-end",
|
|
@@ -5751,13 +5983,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5751
5983
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
5752
5984
|
result: {
|
|
5753
5985
|
queries: value.item.queries,
|
|
5754
|
-
results: (
|
|
5986
|
+
results: (_f = (_e = value.item.results) == null ? void 0 : _e.map((result) => ({
|
|
5755
5987
|
attributes: result.attributes,
|
|
5756
5988
|
fileId: result.file_id,
|
|
5757
5989
|
filename: result.filename,
|
|
5758
5990
|
score: result.score,
|
|
5759
5991
|
text: result.text
|
|
5760
|
-
}))) != null ?
|
|
5992
|
+
}))) != null ? _f : null
|
|
5761
5993
|
}
|
|
5762
5994
|
});
|
|
5763
5995
|
} else if (value.item.type === "code_interpreter_call") {
|
|
@@ -5779,12 +6011,62 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5779
6011
|
result: value.item.result
|
|
5780
6012
|
}
|
|
5781
6013
|
});
|
|
6014
|
+
} else if (value.item.type === "tool_search_call") {
|
|
6015
|
+
const toolCall = ongoingToolCalls[value.output_index];
|
|
6016
|
+
const isHosted = value.item.execution === "server";
|
|
6017
|
+
if (toolCall != null) {
|
|
6018
|
+
const toolCallId = isHosted ? toolCall.toolCallId : (_g = value.item.call_id) != null ? _g : value.item.id;
|
|
6019
|
+
if (isHosted) {
|
|
6020
|
+
hostedToolSearchCallIds.push(toolCallId);
|
|
6021
|
+
} else {
|
|
6022
|
+
controller.enqueue({
|
|
6023
|
+
type: "tool-input-start",
|
|
6024
|
+
id: toolCallId,
|
|
6025
|
+
toolName: toolCall.toolName
|
|
6026
|
+
});
|
|
6027
|
+
}
|
|
6028
|
+
controller.enqueue({
|
|
6029
|
+
type: "tool-input-end",
|
|
6030
|
+
id: toolCallId
|
|
6031
|
+
});
|
|
6032
|
+
controller.enqueue({
|
|
6033
|
+
type: "tool-call",
|
|
6034
|
+
toolCallId,
|
|
6035
|
+
toolName: toolCall.toolName,
|
|
6036
|
+
input: JSON.stringify({
|
|
6037
|
+
arguments: value.item.arguments,
|
|
6038
|
+
call_id: isHosted ? null : toolCallId
|
|
6039
|
+
}),
|
|
6040
|
+
...isHosted ? { providerExecuted: true } : {},
|
|
6041
|
+
providerMetadata: {
|
|
6042
|
+
[providerOptionsName]: {
|
|
6043
|
+
itemId: value.item.id
|
|
6044
|
+
}
|
|
6045
|
+
}
|
|
6046
|
+
});
|
|
6047
|
+
}
|
|
6048
|
+
ongoingToolCalls[value.output_index] = void 0;
|
|
6049
|
+
} else if (value.item.type === "tool_search_output") {
|
|
6050
|
+
const toolCallId = (_i = (_h = value.item.call_id) != null ? _h : hostedToolSearchCallIds.shift()) != null ? _i : value.item.id;
|
|
6051
|
+
controller.enqueue({
|
|
6052
|
+
type: "tool-result",
|
|
6053
|
+
toolCallId,
|
|
6054
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
6055
|
+
result: {
|
|
6056
|
+
tools: value.item.tools
|
|
6057
|
+
},
|
|
6058
|
+
providerMetadata: {
|
|
6059
|
+
[providerOptionsName]: {
|
|
6060
|
+
itemId: value.item.id
|
|
6061
|
+
}
|
|
6062
|
+
}
|
|
6063
|
+
});
|
|
5782
6064
|
} else if (value.item.type === "mcp_call") {
|
|
5783
6065
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5784
|
-
const approvalRequestId = (
|
|
5785
|
-
const aliasedToolCallId = approvalRequestId != null ? (
|
|
6066
|
+
const approvalRequestId = (_j = value.item.approval_request_id) != null ? _j : void 0;
|
|
6067
|
+
const aliasedToolCallId = approvalRequestId != null ? (_l = (_k = approvalRequestIdToDummyToolCallIdFromStream.get(
|
|
5786
6068
|
approvalRequestId
|
|
5787
|
-
)) != null ?
|
|
6069
|
+
)) != null ? _k : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _l : value.item.id : value.item.id;
|
|
5788
6070
|
const toolName = `mcp.${value.item.name}`;
|
|
5789
6071
|
controller.enqueue({
|
|
5790
6072
|
type: "tool-call",
|
|
@@ -5854,8 +6136,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5854
6136
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5855
6137
|
} else if (value.item.type === "mcp_approval_request") {
|
|
5856
6138
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5857
|
-
const dummyToolCallId = (
|
|
5858
|
-
const approvalRequestId = (
|
|
6139
|
+
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2();
|
|
6140
|
+
const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
|
|
5859
6141
|
approvalRequestIdToDummyToolCallIdFromStream.set(
|
|
5860
6142
|
approvalRequestId,
|
|
5861
6143
|
dummyToolCallId
|
|
@@ -5944,7 +6226,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5944
6226
|
providerMetadata: {
|
|
5945
6227
|
[providerOptionsName]: {
|
|
5946
6228
|
itemId: value.item.id,
|
|
5947
|
-
reasoningEncryptedContent: (
|
|
6229
|
+
reasoningEncryptedContent: (_q = value.item.encrypted_content) != null ? _q : null
|
|
5948
6230
|
}
|
|
5949
6231
|
}
|
|
5950
6232
|
});
|
|
@@ -6057,7 +6339,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6057
6339
|
id: value.item_id,
|
|
6058
6340
|
delta: value.delta
|
|
6059
6341
|
});
|
|
6060
|
-
if (((
|
|
6342
|
+
if (((_s = (_r = options.providerOptions) == null ? void 0 : _r[providerOptionsName]) == null ? void 0 : _s.logprobs) && value.logprobs) {
|
|
6061
6343
|
logprobs.push(value.logprobs);
|
|
6062
6344
|
}
|
|
6063
6345
|
} else if (value.type === "response.reasoning_summary_part.added") {
|
|
@@ -6086,7 +6368,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6086
6368
|
providerMetadata: {
|
|
6087
6369
|
[providerOptionsName]: {
|
|
6088
6370
|
itemId: value.item_id,
|
|
6089
|
-
reasoningEncryptedContent: (
|
|
6371
|
+
reasoningEncryptedContent: (_u = (_t = activeReasoning[value.item_id]) == null ? void 0 : _t.encryptedContent) != null ? _u : null
|
|
6090
6372
|
}
|
|
6091
6373
|
}
|
|
6092
6374
|
});
|
|
@@ -6120,10 +6402,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6120
6402
|
} else if (isResponseFinishedChunk(value)) {
|
|
6121
6403
|
finishReason = {
|
|
6122
6404
|
unified: mapOpenAIResponseFinishReason({
|
|
6123
|
-
finishReason: (
|
|
6405
|
+
finishReason: (_v = value.response.incomplete_details) == null ? void 0 : _v.reason,
|
|
6124
6406
|
hasFunctionCall
|
|
6125
6407
|
}),
|
|
6126
|
-
raw: (
|
|
6408
|
+
raw: (_x = (_w = value.response.incomplete_details) == null ? void 0 : _w.reason) != null ? _x : void 0
|
|
6127
6409
|
};
|
|
6128
6410
|
usage = value.response.usage;
|
|
6129
6411
|
if (typeof value.response.service_tier === "string") {
|
|
@@ -6135,7 +6417,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6135
6417
|
controller.enqueue({
|
|
6136
6418
|
type: "source",
|
|
6137
6419
|
sourceType: "url",
|
|
6138
|
-
id: (
|
|
6420
|
+
id: (_A = (_z = (_y = self.config).generateId) == null ? void 0 : _z.call(_y)) != null ? _A : generateId2(),
|
|
6139
6421
|
url: value.annotation.url,
|
|
6140
6422
|
title: value.annotation.title
|
|
6141
6423
|
});
|
|
@@ -6143,7 +6425,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6143
6425
|
controller.enqueue({
|
|
6144
6426
|
type: "source",
|
|
6145
6427
|
sourceType: "document",
|
|
6146
|
-
id: (
|
|
6428
|
+
id: (_D = (_C = (_B = self.config).generateId) == null ? void 0 : _C.call(_B)) != null ? _D : generateId2(),
|
|
6147
6429
|
mediaType: "text/plain",
|
|
6148
6430
|
title: value.annotation.filename,
|
|
6149
6431
|
filename: value.annotation.filename,
|
|
@@ -6159,7 +6441,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6159
6441
|
controller.enqueue({
|
|
6160
6442
|
type: "source",
|
|
6161
6443
|
sourceType: "document",
|
|
6162
|
-
id: (
|
|
6444
|
+
id: (_G = (_F = (_E = self.config).generateId) == null ? void 0 : _F.call(_E)) != null ? _G : generateId2(),
|
|
6163
6445
|
mediaType: "text/plain",
|
|
6164
6446
|
title: value.annotation.filename,
|
|
6165
6447
|
filename: value.annotation.filename,
|
|
@@ -6175,7 +6457,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6175
6457
|
controller.enqueue({
|
|
6176
6458
|
type: "source",
|
|
6177
6459
|
sourceType: "document",
|
|
6178
|
-
id: (
|
|
6460
|
+
id: (_J = (_I = (_H = self.config).generateId) == null ? void 0 : _I.call(_H)) != null ? _J : generateId2(),
|
|
6179
6461
|
mediaType: "application/octet-stream",
|
|
6180
6462
|
title: value.annotation.file_id,
|
|
6181
6463
|
filename: value.annotation.file_id,
|