@ai-sdk/openai 4.0.0-beta.0 → 4.0.0-beta.10
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 +143 -0
- package/dist/index.d.mts +69 -22
- package/dist/index.d.ts +69 -22
- package/dist/index.js +1172 -872
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1126 -821
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +56 -28
- package/dist/internal/index.d.ts +56 -28
- package/dist/internal/index.js +1201 -911
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1183 -888
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +142 -3
- package/package.json +3 -3
- package/src/chat/convert-openai-chat-usage.ts +2 -2
- package/src/chat/convert-to-openai-chat-messages.ts +5 -5
- package/src/chat/map-openai-finish-reason.ts +2 -2
- package/src/chat/openai-chat-language-model.ts +22 -22
- package/src/chat/openai-chat-options.ts +5 -0
- package/src/chat/openai-chat-prepare-tools.ts +6 -6
- package/src/completion/convert-openai-completion-usage.ts +2 -2
- package/src/completion/convert-to-openai-completion-prompt.ts +2 -2
- package/src/completion/map-openai-finish-reason.ts +2 -2
- package/src/completion/openai-completion-language-model.ts +20 -20
- package/src/embedding/openai-embedding-model.ts +5 -5
- package/src/image/openai-image-model.ts +9 -9
- package/src/openai-language-model-capabilities.ts +5 -2
- package/src/openai-provider.ts +21 -21
- package/src/openai-tools.ts +12 -1
- package/src/responses/convert-openai-responses-usage.ts +2 -2
- package/src/responses/convert-to-openai-responses-input.ts +116 -12
- package/src/responses/map-openai-responses-finish-reason.ts +2 -2
- package/src/responses/openai-responses-api.ts +87 -1
- package/src/responses/openai-responses-language-model.ts +168 -33
- package/src/responses/openai-responses-options.ts +10 -0
- package/src/responses/openai-responses-prepare-tools.ts +34 -9
- package/src/speech/openai-speech-model.ts +7 -7
- package/src/tool/custom.ts +0 -6
- package/src/tool/tool-search.ts +98 -0
- package/src/transcription/openai-transcription-model.ts +8 -8
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");
|
|
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,
|
|
@@ -631,7 +631,7 @@ function prepareChatTools({
|
|
|
631
631
|
// src/chat/openai-chat-language-model.ts
|
|
632
632
|
var OpenAIChatLanguageModel = class {
|
|
633
633
|
constructor(modelId, config) {
|
|
634
|
-
this.specificationVersion = "
|
|
634
|
+
this.specificationVersion = "v4";
|
|
635
635
|
this.supportedUrls = {
|
|
636
636
|
"image/*": [/^https?:\/\/.*$/]
|
|
637
637
|
};
|
|
@@ -1375,7 +1375,7 @@ var openaiLanguageModelCompletionOptions = lazySchema4(
|
|
|
1375
1375
|
// src/completion/openai-completion-language-model.ts
|
|
1376
1376
|
var OpenAICompletionLanguageModel = class {
|
|
1377
1377
|
constructor(modelId, config) {
|
|
1378
|
-
this.specificationVersion = "
|
|
1378
|
+
this.specificationVersion = "v4";
|
|
1379
1379
|
this.supportedUrls = {
|
|
1380
1380
|
// No URLs are supported for completion models.
|
|
1381
1381
|
};
|
|
@@ -1647,7 +1647,7 @@ var openaiTextEmbeddingResponseSchema = lazySchema6(
|
|
|
1647
1647
|
// src/embedding/openai-embedding-model.ts
|
|
1648
1648
|
var OpenAIEmbeddingModel = class {
|
|
1649
1649
|
constructor(modelId, config) {
|
|
1650
|
-
this.specificationVersion = "
|
|
1650
|
+
this.specificationVersion = "v4";
|
|
1651
1651
|
this.maxEmbeddingsPerCall = 2048;
|
|
1652
1652
|
this.supportsParallelCalls = true;
|
|
1653
1653
|
this.modelId = modelId;
|
|
@@ -1776,7 +1776,7 @@ var OpenAIImageModel = class {
|
|
|
1776
1776
|
constructor(modelId, config) {
|
|
1777
1777
|
this.modelId = modelId;
|
|
1778
1778
|
this.config = config;
|
|
1779
|
-
this.specificationVersion = "
|
|
1779
|
+
this.specificationVersion = "v4";
|
|
1780
1780
|
}
|
|
1781
1781
|
get maxImagesPerCall() {
|
|
1782
1782
|
var _a;
|
|
@@ -2104,7 +2104,7 @@ var OpenAITranscriptionModel = class {
|
|
|
2104
2104
|
constructor(modelId, config) {
|
|
2105
2105
|
this.modelId = modelId;
|
|
2106
2106
|
this.config = config;
|
|
2107
|
-
this.specificationVersion = "
|
|
2107
|
+
this.specificationVersion = "v4";
|
|
2108
2108
|
}
|
|
2109
2109
|
get provider() {
|
|
2110
2110
|
return this.config.provider;
|
|
@@ -2232,7 +2232,7 @@ var OpenAISpeechModel = class {
|
|
|
2232
2232
|
constructor(modelId, config) {
|
|
2233
2233
|
this.modelId = modelId;
|
|
2234
2234
|
this.config = config;
|
|
2235
|
-
this.specificationVersion = "
|
|
2235
|
+
this.specificationVersion = "v4";
|
|
2236
2236
|
}
|
|
2237
2237
|
get provider() {
|
|
2238
2238
|
return this.config.provider;
|
|
@@ -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,8 +2626,8 @@ 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;
|
|
2592
|
-
|
|
2629
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
2630
|
+
let input = [];
|
|
2593
2631
|
const warnings = [];
|
|
2594
2632
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
2595
2633
|
for (const { role, content } of prompt) {
|
|
@@ -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":
|
|
@@ -3090,11 +3185,22 @@ async function convertToOpenAIResponsesInput({
|
|
|
3090
3185
|
}
|
|
3091
3186
|
}
|
|
3092
3187
|
}
|
|
3188
|
+
if (!store && input.some(
|
|
3189
|
+
(item) => "type" in item && item.type === "reasoning" && item.encrypted_content == null
|
|
3190
|
+
)) {
|
|
3191
|
+
warnings.push({
|
|
3192
|
+
type: "other",
|
|
3193
|
+
message: "Reasoning parts without encrypted content are not supported when store is false. Skipping reasoning parts."
|
|
3194
|
+
});
|
|
3195
|
+
input = input.filter(
|
|
3196
|
+
(item) => !("type" in item) || item.type !== "reasoning" || item.encrypted_content != null
|
|
3197
|
+
);
|
|
3198
|
+
}
|
|
3093
3199
|
return { input, warnings };
|
|
3094
3200
|
}
|
|
3095
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
3096
|
-
itemId:
|
|
3097
|
-
reasoningEncryptedContent:
|
|
3201
|
+
var openaiResponsesReasoningProviderOptionsSchema = z16.object({
|
|
3202
|
+
itemId: z16.string().nullish(),
|
|
3203
|
+
reasoningEncryptedContent: z16.string().nullish()
|
|
3098
3204
|
});
|
|
3099
3205
|
|
|
3100
3206
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -3116,483 +3222,525 @@ function mapOpenAIResponseFinishReason({
|
|
|
3116
3222
|
}
|
|
3117
3223
|
|
|
3118
3224
|
// src/responses/openai-responses-api.ts
|
|
3119
|
-
import { lazySchema as
|
|
3120
|
-
import { z as
|
|
3121
|
-
var
|
|
3122
|
-
() =>
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
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()
|
|
3136
3252
|
})
|
|
3137
3253
|
)
|
|
3138
3254
|
})
|
|
3139
3255
|
).nullish()
|
|
3140
3256
|
}),
|
|
3141
|
-
|
|
3142
|
-
type:
|
|
3143
|
-
response:
|
|
3144
|
-
incomplete_details:
|
|
3145
|
-
usage:
|
|
3146
|
-
input_tokens:
|
|
3147
|
-
input_tokens_details:
|
|
3148
|
-
output_tokens:
|
|
3149
|
-
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()
|
|
3150
3266
|
}),
|
|
3151
|
-
service_tier:
|
|
3267
|
+
service_tier: z17.string().nullish()
|
|
3152
3268
|
})
|
|
3153
3269
|
}),
|
|
3154
|
-
|
|
3155
|
-
type:
|
|
3156
|
-
response:
|
|
3157
|
-
id:
|
|
3158
|
-
created_at:
|
|
3159
|
-
model:
|
|
3160
|
-
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()
|
|
3161
3277
|
})
|
|
3162
3278
|
}),
|
|
3163
|
-
|
|
3164
|
-
type:
|
|
3165
|
-
output_index:
|
|
3166
|
-
item:
|
|
3167
|
-
|
|
3168
|
-
type:
|
|
3169
|
-
id:
|
|
3170
|
-
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()
|
|
3171
3287
|
}),
|
|
3172
|
-
|
|
3173
|
-
type:
|
|
3174
|
-
id:
|
|
3175
|
-
encrypted_content:
|
|
3288
|
+
z17.object({
|
|
3289
|
+
type: z17.literal("reasoning"),
|
|
3290
|
+
id: z17.string(),
|
|
3291
|
+
encrypted_content: z17.string().nullish()
|
|
3176
3292
|
}),
|
|
3177
|
-
|
|
3178
|
-
type:
|
|
3179
|
-
id:
|
|
3180
|
-
call_id:
|
|
3181
|
-
name:
|
|
3182
|
-
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()
|
|
3183
3299
|
}),
|
|
3184
|
-
|
|
3185
|
-
type:
|
|
3186
|
-
id:
|
|
3187
|
-
status:
|
|
3300
|
+
z17.object({
|
|
3301
|
+
type: z17.literal("web_search_call"),
|
|
3302
|
+
id: z17.string(),
|
|
3303
|
+
status: z17.string()
|
|
3188
3304
|
}),
|
|
3189
|
-
|
|
3190
|
-
type:
|
|
3191
|
-
id:
|
|
3192
|
-
status:
|
|
3305
|
+
z17.object({
|
|
3306
|
+
type: z17.literal("computer_call"),
|
|
3307
|
+
id: z17.string(),
|
|
3308
|
+
status: z17.string()
|
|
3193
3309
|
}),
|
|
3194
|
-
|
|
3195
|
-
type:
|
|
3196
|
-
id:
|
|
3310
|
+
z17.object({
|
|
3311
|
+
type: z17.literal("file_search_call"),
|
|
3312
|
+
id: z17.string()
|
|
3197
3313
|
}),
|
|
3198
|
-
|
|
3199
|
-
type:
|
|
3200
|
-
id:
|
|
3314
|
+
z17.object({
|
|
3315
|
+
type: z17.literal("image_generation_call"),
|
|
3316
|
+
id: z17.string()
|
|
3201
3317
|
}),
|
|
3202
|
-
|
|
3203
|
-
type:
|
|
3204
|
-
id:
|
|
3205
|
-
container_id:
|
|
3206
|
-
code:
|
|
3207
|
-
outputs:
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
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() })
|
|
3211
3327
|
])
|
|
3212
3328
|
).nullable(),
|
|
3213
|
-
status:
|
|
3329
|
+
status: z17.string()
|
|
3214
3330
|
}),
|
|
3215
|
-
|
|
3216
|
-
type:
|
|
3217
|
-
id:
|
|
3218
|
-
status:
|
|
3219
|
-
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()
|
|
3220
3336
|
}),
|
|
3221
|
-
|
|
3222
|
-
type:
|
|
3223
|
-
id:
|
|
3337
|
+
z17.object({
|
|
3338
|
+
type: z17.literal("mcp_list_tools"),
|
|
3339
|
+
id: z17.string()
|
|
3224
3340
|
}),
|
|
3225
|
-
|
|
3226
|
-
type:
|
|
3227
|
-
id:
|
|
3341
|
+
z17.object({
|
|
3342
|
+
type: z17.literal("mcp_approval_request"),
|
|
3343
|
+
id: z17.string()
|
|
3228
3344
|
}),
|
|
3229
|
-
|
|
3230
|
-
type:
|
|
3231
|
-
id:
|
|
3232
|
-
call_id:
|
|
3233
|
-
status:
|
|
3234
|
-
operation:
|
|
3235
|
-
|
|
3236
|
-
type:
|
|
3237
|
-
path:
|
|
3238
|
-
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()
|
|
3239
3355
|
}),
|
|
3240
|
-
|
|
3241
|
-
type:
|
|
3242
|
-
path:
|
|
3356
|
+
z17.object({
|
|
3357
|
+
type: z17.literal("delete_file"),
|
|
3358
|
+
path: z17.string()
|
|
3243
3359
|
}),
|
|
3244
|
-
|
|
3245
|
-
type:
|
|
3246
|
-
path:
|
|
3247
|
-
diff:
|
|
3360
|
+
z17.object({
|
|
3361
|
+
type: z17.literal("update_file"),
|
|
3362
|
+
path: z17.string(),
|
|
3363
|
+
diff: z17.string()
|
|
3248
3364
|
})
|
|
3249
3365
|
])
|
|
3250
3366
|
}),
|
|
3251
|
-
|
|
3252
|
-
type:
|
|
3253
|
-
id:
|
|
3254
|
-
call_id:
|
|
3255
|
-
name:
|
|
3256
|
-
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()
|
|
3257
3373
|
}),
|
|
3258
|
-
|
|
3259
|
-
type:
|
|
3260
|
-
id:
|
|
3261
|
-
call_id:
|
|
3262
|
-
status:
|
|
3263
|
-
action:
|
|
3264
|
-
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())
|
|
3265
3381
|
})
|
|
3266
3382
|
}),
|
|
3267
|
-
|
|
3268
|
-
type:
|
|
3269
|
-
id:
|
|
3270
|
-
call_id:
|
|
3271
|
-
status:
|
|
3272
|
-
output:
|
|
3273
|
-
|
|
3274
|
-
stdout:
|
|
3275
|
-
stderr:
|
|
3276
|
-
outcome:
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
type:
|
|
3280
|
-
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()
|
|
3281
3397
|
})
|
|
3282
3398
|
])
|
|
3283
3399
|
})
|
|
3284
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()))
|
|
3285
3417
|
})
|
|
3286
3418
|
])
|
|
3287
3419
|
}),
|
|
3288
|
-
|
|
3289
|
-
type:
|
|
3290
|
-
output_index:
|
|
3291
|
-
item:
|
|
3292
|
-
|
|
3293
|
-
type:
|
|
3294
|
-
id:
|
|
3295
|
-
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()
|
|
3296
3428
|
}),
|
|
3297
|
-
|
|
3298
|
-
type:
|
|
3299
|
-
id:
|
|
3300
|
-
encrypted_content:
|
|
3429
|
+
z17.object({
|
|
3430
|
+
type: z17.literal("reasoning"),
|
|
3431
|
+
id: z17.string(),
|
|
3432
|
+
encrypted_content: z17.string().nullish()
|
|
3301
3433
|
}),
|
|
3302
|
-
|
|
3303
|
-
type:
|
|
3304
|
-
id:
|
|
3305
|
-
call_id:
|
|
3306
|
-
name:
|
|
3307
|
-
arguments:
|
|
3308
|
-
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")
|
|
3309
3441
|
}),
|
|
3310
|
-
|
|
3311
|
-
type:
|
|
3312
|
-
id:
|
|
3313
|
-
call_id:
|
|
3314
|
-
name:
|
|
3315
|
-
input:
|
|
3316
|
-
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")
|
|
3317
3449
|
}),
|
|
3318
|
-
|
|
3319
|
-
type:
|
|
3320
|
-
id:
|
|
3321
|
-
code:
|
|
3322
|
-
container_id:
|
|
3323
|
-
outputs:
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
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() })
|
|
3327
3459
|
])
|
|
3328
3460
|
).nullable()
|
|
3329
3461
|
}),
|
|
3330
|
-
|
|
3331
|
-
type:
|
|
3332
|
-
id:
|
|
3333
|
-
result:
|
|
3462
|
+
z17.object({
|
|
3463
|
+
type: z17.literal("image_generation_call"),
|
|
3464
|
+
id: z17.string(),
|
|
3465
|
+
result: z17.string()
|
|
3334
3466
|
}),
|
|
3335
|
-
|
|
3336
|
-
type:
|
|
3337
|
-
id:
|
|
3338
|
-
status:
|
|
3339
|
-
action:
|
|
3340
|
-
|
|
3341
|
-
type:
|
|
3342
|
-
query:
|
|
3343
|
-
sources:
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
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() })
|
|
3347
3479
|
])
|
|
3348
3480
|
).nullish()
|
|
3349
3481
|
}),
|
|
3350
|
-
|
|
3351
|
-
type:
|
|
3352
|
-
url:
|
|
3482
|
+
z17.object({
|
|
3483
|
+
type: z17.literal("open_page"),
|
|
3484
|
+
url: z17.string().nullish()
|
|
3353
3485
|
}),
|
|
3354
|
-
|
|
3355
|
-
type:
|
|
3356
|
-
url:
|
|
3357
|
-
pattern:
|
|
3486
|
+
z17.object({
|
|
3487
|
+
type: z17.literal("find_in_page"),
|
|
3488
|
+
url: z17.string().nullish(),
|
|
3489
|
+
pattern: z17.string().nullish()
|
|
3358
3490
|
})
|
|
3359
3491
|
]).nullish()
|
|
3360
3492
|
}),
|
|
3361
|
-
|
|
3362
|
-
type:
|
|
3363
|
-
id:
|
|
3364
|
-
queries:
|
|
3365
|
-
results:
|
|
3366
|
-
|
|
3367
|
-
attributes:
|
|
3368
|
-
|
|
3369
|
-
|
|
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()])
|
|
3370
3502
|
),
|
|
3371
|
-
file_id:
|
|
3372
|
-
filename:
|
|
3373
|
-
score:
|
|
3374
|
-
text:
|
|
3503
|
+
file_id: z17.string(),
|
|
3504
|
+
filename: z17.string(),
|
|
3505
|
+
score: z17.number(),
|
|
3506
|
+
text: z17.string()
|
|
3375
3507
|
})
|
|
3376
3508
|
).nullish()
|
|
3377
3509
|
}),
|
|
3378
|
-
|
|
3379
|
-
type:
|
|
3380
|
-
id:
|
|
3381
|
-
call_id:
|
|
3382
|
-
action:
|
|
3383
|
-
type:
|
|
3384
|
-
command:
|
|
3385
|
-
timeout_ms:
|
|
3386
|
-
user:
|
|
3387
|
-
working_directory:
|
|
3388
|
-
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()
|
|
3389
3521
|
})
|
|
3390
3522
|
}),
|
|
3391
|
-
|
|
3392
|
-
type:
|
|
3393
|
-
id:
|
|
3394
|
-
status:
|
|
3523
|
+
z17.object({
|
|
3524
|
+
type: z17.literal("computer_call"),
|
|
3525
|
+
id: z17.string(),
|
|
3526
|
+
status: z17.literal("completed")
|
|
3395
3527
|
}),
|
|
3396
|
-
|
|
3397
|
-
type:
|
|
3398
|
-
id:
|
|
3399
|
-
status:
|
|
3400
|
-
arguments:
|
|
3401
|
-
name:
|
|
3402
|
-
server_label:
|
|
3403
|
-
output:
|
|
3404
|
-
error:
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
type:
|
|
3408
|
-
code:
|
|
3409
|
-
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()
|
|
3410
3542
|
}).loose()
|
|
3411
3543
|
]).nullish(),
|
|
3412
|
-
approval_request_id:
|
|
3544
|
+
approval_request_id: z17.string().nullish()
|
|
3413
3545
|
}),
|
|
3414
|
-
|
|
3415
|
-
type:
|
|
3416
|
-
id:
|
|
3417
|
-
server_label:
|
|
3418
|
-
tools:
|
|
3419
|
-
|
|
3420
|
-
name:
|
|
3421
|
-
description:
|
|
3422
|
-
input_schema:
|
|
3423
|
-
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()
|
|
3424
3556
|
})
|
|
3425
3557
|
),
|
|
3426
|
-
error:
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
type:
|
|
3430
|
-
code:
|
|
3431
|
-
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()
|
|
3432
3564
|
}).loose()
|
|
3433
3565
|
]).optional()
|
|
3434
3566
|
}),
|
|
3435
|
-
|
|
3436
|
-
type:
|
|
3437
|
-
id:
|
|
3438
|
-
server_label:
|
|
3439
|
-
name:
|
|
3440
|
-
arguments:
|
|
3441
|
-
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()
|
|
3442
3574
|
}),
|
|
3443
|
-
|
|
3444
|
-
type:
|
|
3445
|
-
id:
|
|
3446
|
-
call_id:
|
|
3447
|
-
status:
|
|
3448
|
-
operation:
|
|
3449
|
-
|
|
3450
|
-
type:
|
|
3451
|
-
path:
|
|
3452
|
-
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()
|
|
3453
3585
|
}),
|
|
3454
|
-
|
|
3455
|
-
type:
|
|
3456
|
-
path:
|
|
3586
|
+
z17.object({
|
|
3587
|
+
type: z17.literal("delete_file"),
|
|
3588
|
+
path: z17.string()
|
|
3457
3589
|
}),
|
|
3458
|
-
|
|
3459
|
-
type:
|
|
3460
|
-
path:
|
|
3461
|
-
diff:
|
|
3590
|
+
z17.object({
|
|
3591
|
+
type: z17.literal("update_file"),
|
|
3592
|
+
path: z17.string(),
|
|
3593
|
+
diff: z17.string()
|
|
3462
3594
|
})
|
|
3463
3595
|
])
|
|
3464
3596
|
}),
|
|
3465
|
-
|
|
3466
|
-
type:
|
|
3467
|
-
id:
|
|
3468
|
-
call_id:
|
|
3469
|
-
status:
|
|
3470
|
-
action:
|
|
3471
|
-
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())
|
|
3472
3604
|
})
|
|
3473
3605
|
}),
|
|
3474
|
-
|
|
3475
|
-
type:
|
|
3476
|
-
id:
|
|
3477
|
-
call_id:
|
|
3478
|
-
status:
|
|
3479
|
-
output:
|
|
3480
|
-
|
|
3481
|
-
stdout:
|
|
3482
|
-
stderr:
|
|
3483
|
-
outcome:
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
type:
|
|
3487
|
-
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()
|
|
3488
3620
|
})
|
|
3489
3621
|
])
|
|
3490
3622
|
})
|
|
3491
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()))
|
|
3492
3640
|
})
|
|
3493
3641
|
])
|
|
3494
3642
|
}),
|
|
3495
|
-
|
|
3496
|
-
type:
|
|
3497
|
-
item_id:
|
|
3498
|
-
output_index:
|
|
3499
|
-
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()
|
|
3500
3648
|
}),
|
|
3501
|
-
|
|
3502
|
-
type:
|
|
3503
|
-
item_id:
|
|
3504
|
-
output_index:
|
|
3505
|
-
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()
|
|
3506
3654
|
}),
|
|
3507
|
-
|
|
3508
|
-
type:
|
|
3509
|
-
item_id:
|
|
3510
|
-
output_index:
|
|
3511
|
-
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()
|
|
3512
3660
|
}),
|
|
3513
|
-
|
|
3514
|
-
type:
|
|
3515
|
-
item_id:
|
|
3516
|
-
output_index:
|
|
3517
|
-
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()
|
|
3518
3666
|
}),
|
|
3519
|
-
|
|
3520
|
-
type:
|
|
3521
|
-
item_id:
|
|
3522
|
-
output_index:
|
|
3523
|
-
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()
|
|
3524
3672
|
}),
|
|
3525
|
-
|
|
3526
|
-
type:
|
|
3527
|
-
annotation:
|
|
3528
|
-
|
|
3529
|
-
type:
|
|
3530
|
-
start_index:
|
|
3531
|
-
end_index:
|
|
3532
|
-
url:
|
|
3533
|
-
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()
|
|
3534
3682
|
}),
|
|
3535
|
-
|
|
3536
|
-
type:
|
|
3537
|
-
file_id:
|
|
3538
|
-
filename:
|
|
3539
|
-
index:
|
|
3683
|
+
z17.object({
|
|
3684
|
+
type: z17.literal("file_citation"),
|
|
3685
|
+
file_id: z17.string(),
|
|
3686
|
+
filename: z17.string(),
|
|
3687
|
+
index: z17.number()
|
|
3540
3688
|
}),
|
|
3541
|
-
|
|
3542
|
-
type:
|
|
3543
|
-
container_id:
|
|
3544
|
-
file_id:
|
|
3545
|
-
filename:
|
|
3546
|
-
start_index:
|
|
3547
|
-
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()
|
|
3548
3696
|
}),
|
|
3549
|
-
|
|
3550
|
-
type:
|
|
3551
|
-
file_id:
|
|
3552
|
-
index:
|
|
3697
|
+
z17.object({
|
|
3698
|
+
type: z17.literal("file_path"),
|
|
3699
|
+
file_id: z17.string(),
|
|
3700
|
+
index: z17.number()
|
|
3553
3701
|
})
|
|
3554
3702
|
])
|
|
3555
3703
|
}),
|
|
3556
|
-
|
|
3557
|
-
type:
|
|
3558
|
-
item_id:
|
|
3559
|
-
summary_index:
|
|
3704
|
+
z17.object({
|
|
3705
|
+
type: z17.literal("response.reasoning_summary_part.added"),
|
|
3706
|
+
item_id: z17.string(),
|
|
3707
|
+
summary_index: z17.number()
|
|
3560
3708
|
}),
|
|
3561
|
-
|
|
3562
|
-
type:
|
|
3563
|
-
item_id:
|
|
3564
|
-
summary_index:
|
|
3565
|
-
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()
|
|
3566
3714
|
}),
|
|
3567
|
-
|
|
3568
|
-
type:
|
|
3569
|
-
item_id:
|
|
3570
|
-
summary_index:
|
|
3715
|
+
z17.object({
|
|
3716
|
+
type: z17.literal("response.reasoning_summary_part.done"),
|
|
3717
|
+
item_id: z17.string(),
|
|
3718
|
+
summary_index: z17.number()
|
|
3571
3719
|
}),
|
|
3572
|
-
|
|
3573
|
-
type:
|
|
3574
|
-
item_id:
|
|
3575
|
-
output_index:
|
|
3576
|
-
delta:
|
|
3577
|
-
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()
|
|
3578
3726
|
}),
|
|
3579
|
-
|
|
3580
|
-
type:
|
|
3581
|
-
item_id:
|
|
3582
|
-
output_index:
|
|
3583
|
-
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()
|
|
3584
3732
|
}),
|
|
3585
|
-
|
|
3586
|
-
type:
|
|
3587
|
-
sequence_number:
|
|
3588
|
-
error:
|
|
3589
|
-
type:
|
|
3590
|
-
code:
|
|
3591
|
-
message:
|
|
3592
|
-
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()
|
|
3593
3741
|
})
|
|
3594
3742
|
}),
|
|
3595
|
-
|
|
3743
|
+
z17.object({ type: z17.string() }).loose().transform((value) => ({
|
|
3596
3744
|
type: "unknown_chunk",
|
|
3597
3745
|
message: value.type
|
|
3598
3746
|
}))
|
|
@@ -3600,294 +3748,310 @@ var openaiResponsesChunkSchema = lazySchema14(
|
|
|
3600
3748
|
])
|
|
3601
3749
|
)
|
|
3602
3750
|
);
|
|
3603
|
-
var openaiResponsesResponseSchema =
|
|
3604
|
-
() =>
|
|
3605
|
-
|
|
3606
|
-
id:
|
|
3607
|
-
created_at:
|
|
3608
|
-
error:
|
|
3609
|
-
message:
|
|
3610
|
-
type:
|
|
3611
|
-
param:
|
|
3612
|
-
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()
|
|
3613
3761
|
}).nullish(),
|
|
3614
|
-
model:
|
|
3615
|
-
output:
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
type:
|
|
3619
|
-
role:
|
|
3620
|
-
id:
|
|
3621
|
-
phase:
|
|
3622
|
-
content:
|
|
3623
|
-
|
|
3624
|
-
type:
|
|
3625
|
-
text:
|
|
3626
|
-
logprobs:
|
|
3627
|
-
|
|
3628
|
-
token:
|
|
3629
|
-
logprob:
|
|
3630
|
-
top_logprobs:
|
|
3631
|
-
|
|
3632
|
-
token:
|
|
3633
|
-
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()
|
|
3634
3782
|
})
|
|
3635
3783
|
)
|
|
3636
3784
|
})
|
|
3637
3785
|
).nullish(),
|
|
3638
|
-
annotations:
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
type:
|
|
3642
|
-
start_index:
|
|
3643
|
-
end_index:
|
|
3644
|
-
url:
|
|
3645
|
-
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()
|
|
3646
3794
|
}),
|
|
3647
|
-
|
|
3648
|
-
type:
|
|
3649
|
-
file_id:
|
|
3650
|
-
filename:
|
|
3651
|
-
index:
|
|
3795
|
+
z17.object({
|
|
3796
|
+
type: z17.literal("file_citation"),
|
|
3797
|
+
file_id: z17.string(),
|
|
3798
|
+
filename: z17.string(),
|
|
3799
|
+
index: z17.number()
|
|
3652
3800
|
}),
|
|
3653
|
-
|
|
3654
|
-
type:
|
|
3655
|
-
container_id:
|
|
3656
|
-
file_id:
|
|
3657
|
-
filename:
|
|
3658
|
-
start_index:
|
|
3659
|
-
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()
|
|
3660
3808
|
}),
|
|
3661
|
-
|
|
3662
|
-
type:
|
|
3663
|
-
file_id:
|
|
3664
|
-
index:
|
|
3809
|
+
z17.object({
|
|
3810
|
+
type: z17.literal("file_path"),
|
|
3811
|
+
file_id: z17.string(),
|
|
3812
|
+
index: z17.number()
|
|
3665
3813
|
})
|
|
3666
3814
|
])
|
|
3667
3815
|
)
|
|
3668
3816
|
})
|
|
3669
3817
|
)
|
|
3670
3818
|
}),
|
|
3671
|
-
|
|
3672
|
-
type:
|
|
3673
|
-
id:
|
|
3674
|
-
status:
|
|
3675
|
-
action:
|
|
3676
|
-
|
|
3677
|
-
type:
|
|
3678
|
-
query:
|
|
3679
|
-
sources:
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
type:
|
|
3684
|
-
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()
|
|
3685
3833
|
})
|
|
3686
3834
|
])
|
|
3687
3835
|
).nullish()
|
|
3688
3836
|
}),
|
|
3689
|
-
|
|
3690
|
-
type:
|
|
3691
|
-
url:
|
|
3837
|
+
z17.object({
|
|
3838
|
+
type: z17.literal("open_page"),
|
|
3839
|
+
url: z17.string().nullish()
|
|
3692
3840
|
}),
|
|
3693
|
-
|
|
3694
|
-
type:
|
|
3695
|
-
url:
|
|
3696
|
-
pattern:
|
|
3841
|
+
z17.object({
|
|
3842
|
+
type: z17.literal("find_in_page"),
|
|
3843
|
+
url: z17.string().nullish(),
|
|
3844
|
+
pattern: z17.string().nullish()
|
|
3697
3845
|
})
|
|
3698
3846
|
]).nullish()
|
|
3699
3847
|
}),
|
|
3700
|
-
|
|
3701
|
-
type:
|
|
3702
|
-
id:
|
|
3703
|
-
queries:
|
|
3704
|
-
results:
|
|
3705
|
-
|
|
3706
|
-
attributes:
|
|
3707
|
-
|
|
3708
|
-
|
|
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()])
|
|
3709
3857
|
),
|
|
3710
|
-
file_id:
|
|
3711
|
-
filename:
|
|
3712
|
-
score:
|
|
3713
|
-
text:
|
|
3858
|
+
file_id: z17.string(),
|
|
3859
|
+
filename: z17.string(),
|
|
3860
|
+
score: z17.number(),
|
|
3861
|
+
text: z17.string()
|
|
3714
3862
|
})
|
|
3715
3863
|
).nullish()
|
|
3716
3864
|
}),
|
|
3717
|
-
|
|
3718
|
-
type:
|
|
3719
|
-
id:
|
|
3720
|
-
code:
|
|
3721
|
-
container_id:
|
|
3722
|
-
outputs:
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
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() })
|
|
3726
3874
|
])
|
|
3727
3875
|
).nullable()
|
|
3728
3876
|
}),
|
|
3729
|
-
|
|
3730
|
-
type:
|
|
3731
|
-
id:
|
|
3732
|
-
result:
|
|
3877
|
+
z17.object({
|
|
3878
|
+
type: z17.literal("image_generation_call"),
|
|
3879
|
+
id: z17.string(),
|
|
3880
|
+
result: z17.string()
|
|
3733
3881
|
}),
|
|
3734
|
-
|
|
3735
|
-
type:
|
|
3736
|
-
id:
|
|
3737
|
-
call_id:
|
|
3738
|
-
action:
|
|
3739
|
-
type:
|
|
3740
|
-
command:
|
|
3741
|
-
timeout_ms:
|
|
3742
|
-
user:
|
|
3743
|
-
working_directory:
|
|
3744
|
-
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()
|
|
3745
3893
|
})
|
|
3746
3894
|
}),
|
|
3747
|
-
|
|
3748
|
-
type:
|
|
3749
|
-
call_id:
|
|
3750
|
-
name:
|
|
3751
|
-
arguments:
|
|
3752
|
-
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()
|
|
3753
3901
|
}),
|
|
3754
|
-
|
|
3755
|
-
type:
|
|
3756
|
-
call_id:
|
|
3757
|
-
name:
|
|
3758
|
-
input:
|
|
3759
|
-
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()
|
|
3760
3908
|
}),
|
|
3761
|
-
|
|
3762
|
-
type:
|
|
3763
|
-
id:
|
|
3764
|
-
status:
|
|
3909
|
+
z17.object({
|
|
3910
|
+
type: z17.literal("computer_call"),
|
|
3911
|
+
id: z17.string(),
|
|
3912
|
+
status: z17.string().optional()
|
|
3765
3913
|
}),
|
|
3766
|
-
|
|
3767
|
-
type:
|
|
3768
|
-
id:
|
|
3769
|
-
encrypted_content:
|
|
3770
|
-
summary:
|
|
3771
|
-
|
|
3772
|
-
type:
|
|
3773
|
-
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()
|
|
3774
3922
|
})
|
|
3775
3923
|
)
|
|
3776
3924
|
}),
|
|
3777
|
-
|
|
3778
|
-
type:
|
|
3779
|
-
id:
|
|
3780
|
-
status:
|
|
3781
|
-
arguments:
|
|
3782
|
-
name:
|
|
3783
|
-
server_label:
|
|
3784
|
-
output:
|
|
3785
|
-
error:
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
type:
|
|
3789
|
-
code:
|
|
3790
|
-
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()
|
|
3791
3939
|
}).loose()
|
|
3792
3940
|
]).nullish(),
|
|
3793
|
-
approval_request_id:
|
|
3941
|
+
approval_request_id: z17.string().nullish()
|
|
3794
3942
|
}),
|
|
3795
|
-
|
|
3796
|
-
type:
|
|
3797
|
-
id:
|
|
3798
|
-
server_label:
|
|
3799
|
-
tools:
|
|
3800
|
-
|
|
3801
|
-
name:
|
|
3802
|
-
description:
|
|
3803
|
-
input_schema:
|
|
3804
|
-
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()
|
|
3805
3953
|
})
|
|
3806
3954
|
),
|
|
3807
|
-
error:
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
type:
|
|
3811
|
-
code:
|
|
3812
|
-
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()
|
|
3813
3961
|
}).loose()
|
|
3814
3962
|
]).optional()
|
|
3815
3963
|
}),
|
|
3816
|
-
|
|
3817
|
-
type:
|
|
3818
|
-
id:
|
|
3819
|
-
server_label:
|
|
3820
|
-
name:
|
|
3821
|
-
arguments:
|
|
3822
|
-
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()
|
|
3823
3971
|
}),
|
|
3824
|
-
|
|
3825
|
-
type:
|
|
3826
|
-
id:
|
|
3827
|
-
call_id:
|
|
3828
|
-
status:
|
|
3829
|
-
operation:
|
|
3830
|
-
|
|
3831
|
-
type:
|
|
3832
|
-
path:
|
|
3833
|
-
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()
|
|
3834
3982
|
}),
|
|
3835
|
-
|
|
3836
|
-
type:
|
|
3837
|
-
path:
|
|
3983
|
+
z17.object({
|
|
3984
|
+
type: z17.literal("delete_file"),
|
|
3985
|
+
path: z17.string()
|
|
3838
3986
|
}),
|
|
3839
|
-
|
|
3840
|
-
type:
|
|
3841
|
-
path:
|
|
3842
|
-
diff:
|
|
3987
|
+
z17.object({
|
|
3988
|
+
type: z17.literal("update_file"),
|
|
3989
|
+
path: z17.string(),
|
|
3990
|
+
diff: z17.string()
|
|
3843
3991
|
})
|
|
3844
3992
|
])
|
|
3845
3993
|
}),
|
|
3846
|
-
|
|
3847
|
-
type:
|
|
3848
|
-
id:
|
|
3849
|
-
call_id:
|
|
3850
|
-
status:
|
|
3851
|
-
action:
|
|
3852
|
-
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())
|
|
3853
4001
|
})
|
|
3854
4002
|
}),
|
|
3855
|
-
|
|
3856
|
-
type:
|
|
3857
|
-
id:
|
|
3858
|
-
call_id:
|
|
3859
|
-
status:
|
|
3860
|
-
output:
|
|
3861
|
-
|
|
3862
|
-
stdout:
|
|
3863
|
-
stderr:
|
|
3864
|
-
outcome:
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
type:
|
|
3868
|
-
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()
|
|
3869
4017
|
})
|
|
3870
4018
|
])
|
|
3871
4019
|
})
|
|
3872
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()))
|
|
3873
4037
|
})
|
|
3874
4038
|
])
|
|
3875
4039
|
).optional(),
|
|
3876
|
-
service_tier:
|
|
3877
|
-
incomplete_details:
|
|
3878
|
-
usage:
|
|
3879
|
-
input_tokens:
|
|
3880
|
-
input_tokens_details:
|
|
3881
|
-
output_tokens:
|
|
3882
|
-
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()
|
|
3883
4047
|
}).optional()
|
|
3884
4048
|
})
|
|
3885
4049
|
)
|
|
3886
4050
|
);
|
|
3887
4051
|
|
|
3888
4052
|
// src/responses/openai-responses-options.ts
|
|
3889
|
-
import { lazySchema as
|
|
3890
|
-
import { z as
|
|
4053
|
+
import { lazySchema as lazySchema16, zodSchema as zodSchema16 } from "@ai-sdk/provider-utils";
|
|
4054
|
+
import { z as z18 } from "zod/v4";
|
|
3891
4055
|
var TOP_LOGPROBS_MAX = 20;
|
|
3892
4056
|
var openaiResponsesReasoningModelIds = [
|
|
3893
4057
|
"o1",
|
|
@@ -3916,7 +4080,12 @@ var openaiResponsesReasoningModelIds = [
|
|
|
3916
4080
|
"gpt-5.2-chat-latest",
|
|
3917
4081
|
"gpt-5.2-pro",
|
|
3918
4082
|
"gpt-5.2-codex",
|
|
3919
|
-
"gpt-5.3-
|
|
4083
|
+
"gpt-5.3-chat-latest",
|
|
4084
|
+
"gpt-5.3-codex",
|
|
4085
|
+
"gpt-5.4",
|
|
4086
|
+
"gpt-5.4-2026-03-05",
|
|
4087
|
+
"gpt-5.4-pro",
|
|
4088
|
+
"gpt-5.4-pro-2026-03-05"
|
|
3920
4089
|
];
|
|
3921
4090
|
var openaiResponsesModelIds = [
|
|
3922
4091
|
"gpt-4.1",
|
|
@@ -3943,9 +4112,9 @@ var openaiResponsesModelIds = [
|
|
|
3943
4112
|
"gpt-5-chat-latest",
|
|
3944
4113
|
...openaiResponsesReasoningModelIds
|
|
3945
4114
|
];
|
|
3946
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
3947
|
-
() =>
|
|
3948
|
-
|
|
4115
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
4116
|
+
() => zodSchema16(
|
|
4117
|
+
z18.object({
|
|
3949
4118
|
/**
|
|
3950
4119
|
* The ID of the OpenAI Conversation to continue.
|
|
3951
4120
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -3953,13 +4122,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
3953
4122
|
* Defaults to `undefined`.
|
|
3954
4123
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
3955
4124
|
*/
|
|
3956
|
-
conversation:
|
|
4125
|
+
conversation: z18.string().nullish(),
|
|
3957
4126
|
/**
|
|
3958
4127
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
3959
4128
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
3960
4129
|
*/
|
|
3961
|
-
include:
|
|
3962
|
-
|
|
4130
|
+
include: z18.array(
|
|
4131
|
+
z18.enum([
|
|
3963
4132
|
"reasoning.encrypted_content",
|
|
3964
4133
|
// handled internally by default, only needed for unknown reasoning models
|
|
3965
4134
|
"file_search_call.results",
|
|
@@ -3971,7 +4140,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
3971
4140
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
3972
4141
|
* Defaults to `undefined`.
|
|
3973
4142
|
*/
|
|
3974
|
-
instructions:
|
|
4143
|
+
instructions: z18.string().nullish(),
|
|
3975
4144
|
/**
|
|
3976
4145
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
3977
4146
|
* the response size and can slow down response times. However, it can
|
|
@@ -3986,30 +4155,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
3986
4155
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
3987
4156
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
3988
4157
|
*/
|
|
3989
|
-
logprobs:
|
|
4158
|
+
logprobs: z18.union([z18.boolean(), z18.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
3990
4159
|
/**
|
|
3991
4160
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
3992
4161
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
3993
4162
|
* Any further attempts to call a tool by the model will be ignored.
|
|
3994
4163
|
*/
|
|
3995
|
-
maxToolCalls:
|
|
4164
|
+
maxToolCalls: z18.number().nullish(),
|
|
3996
4165
|
/**
|
|
3997
4166
|
* Additional metadata to store with the generation.
|
|
3998
4167
|
*/
|
|
3999
|
-
metadata:
|
|
4168
|
+
metadata: z18.any().nullish(),
|
|
4000
4169
|
/**
|
|
4001
4170
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4002
4171
|
*/
|
|
4003
|
-
parallelToolCalls:
|
|
4172
|
+
parallelToolCalls: z18.boolean().nullish(),
|
|
4004
4173
|
/**
|
|
4005
4174
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4006
4175
|
* Defaults to `undefined`.
|
|
4007
4176
|
*/
|
|
4008
|
-
previousResponseId:
|
|
4177
|
+
previousResponseId: z18.string().nullish(),
|
|
4009
4178
|
/**
|
|
4010
4179
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4011
4180
|
*/
|
|
4012
|
-
promptCacheKey:
|
|
4181
|
+
promptCacheKey: z18.string().nullish(),
|
|
4013
4182
|
/**
|
|
4014
4183
|
* The retention policy for the prompt cache.
|
|
4015
4184
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4018,7 +4187,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4018
4187
|
*
|
|
4019
4188
|
* @default 'in_memory'
|
|
4020
4189
|
*/
|
|
4021
|
-
promptCacheRetention:
|
|
4190
|
+
promptCacheRetention: z18.enum(["in_memory", "24h"]).nullish(),
|
|
4022
4191
|
/**
|
|
4023
4192
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4024
4193
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4029,17 +4198,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4029
4198
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4030
4199
|
* an error.
|
|
4031
4200
|
*/
|
|
4032
|
-
reasoningEffort:
|
|
4201
|
+
reasoningEffort: z18.string().nullish(),
|
|
4033
4202
|
/**
|
|
4034
4203
|
* Controls reasoning summary output from the model.
|
|
4035
4204
|
* Set to "auto" to automatically receive the richest level available,
|
|
4036
4205
|
* or "detailed" for comprehensive summaries.
|
|
4037
4206
|
*/
|
|
4038
|
-
reasoningSummary:
|
|
4207
|
+
reasoningSummary: z18.string().nullish(),
|
|
4039
4208
|
/**
|
|
4040
4209
|
* The identifier for safety monitoring and tracking.
|
|
4041
4210
|
*/
|
|
4042
|
-
safetyIdentifier:
|
|
4211
|
+
safetyIdentifier: z18.string().nullish(),
|
|
4043
4212
|
/**
|
|
4044
4213
|
* Service tier for the request.
|
|
4045
4214
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4047,34 +4216,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4047
4216
|
*
|
|
4048
4217
|
* Defaults to 'auto'.
|
|
4049
4218
|
*/
|
|
4050
|
-
serviceTier:
|
|
4219
|
+
serviceTier: z18.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4051
4220
|
/**
|
|
4052
4221
|
* Whether to store the generation. Defaults to `true`.
|
|
4053
4222
|
*/
|
|
4054
|
-
store:
|
|
4223
|
+
store: z18.boolean().nullish(),
|
|
4055
4224
|
/**
|
|
4056
4225
|
* Whether to use strict JSON schema validation.
|
|
4057
4226
|
* Defaults to `true`.
|
|
4058
4227
|
*/
|
|
4059
|
-
strictJsonSchema:
|
|
4228
|
+
strictJsonSchema: z18.boolean().nullish(),
|
|
4060
4229
|
/**
|
|
4061
4230
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4062
4231
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4063
4232
|
* Valid values: 'low', 'medium', 'high'.
|
|
4064
4233
|
*/
|
|
4065
|
-
textVerbosity:
|
|
4234
|
+
textVerbosity: z18.enum(["low", "medium", "high"]).nullish(),
|
|
4066
4235
|
/**
|
|
4067
4236
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4068
4237
|
* 'disabled' turns truncation off.
|
|
4069
4238
|
*/
|
|
4070
|
-
truncation:
|
|
4239
|
+
truncation: z18.enum(["auto", "disabled"]).nullish(),
|
|
4071
4240
|
/**
|
|
4072
4241
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4073
4242
|
* monitor and detect abuse.
|
|
4074
4243
|
* Defaults to `undefined`.
|
|
4075
4244
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4076
4245
|
*/
|
|
4077
|
-
user:
|
|
4246
|
+
user: z18.string().nullish(),
|
|
4078
4247
|
/**
|
|
4079
4248
|
* Override the system message mode for this model.
|
|
4080
4249
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4083,7 +4252,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4083
4252
|
*
|
|
4084
4253
|
* If not specified, the mode is automatically determined based on the model.
|
|
4085
4254
|
*/
|
|
4086
|
-
systemMessageMode:
|
|
4255
|
+
systemMessageMode: z18.enum(["system", "developer", "remove"]).optional(),
|
|
4087
4256
|
/**
|
|
4088
4257
|
* Force treating this model as a reasoning model.
|
|
4089
4258
|
*
|
|
@@ -4093,7 +4262,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
|
|
|
4093
4262
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4094
4263
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4095
4264
|
*/
|
|
4096
|
-
forceReasoning:
|
|
4265
|
+
forceReasoning: z18.boolean().optional()
|
|
4097
4266
|
})
|
|
4098
4267
|
)
|
|
4099
4268
|
);
|
|
@@ -4106,44 +4275,44 @@ import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
|
|
|
4106
4275
|
|
|
4107
4276
|
// src/tool/code-interpreter.ts
|
|
4108
4277
|
import {
|
|
4109
|
-
createProviderToolFactoryWithOutputSchema as
|
|
4110
|
-
lazySchema as
|
|
4111
|
-
zodSchema as
|
|
4278
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
4279
|
+
lazySchema as lazySchema17,
|
|
4280
|
+
zodSchema as zodSchema17
|
|
4112
4281
|
} from "@ai-sdk/provider-utils";
|
|
4113
|
-
import { z as
|
|
4114
|
-
var codeInterpreterInputSchema =
|
|
4115
|
-
() =>
|
|
4116
|
-
|
|
4117
|
-
code:
|
|
4118
|
-
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()
|
|
4119
4288
|
})
|
|
4120
4289
|
)
|
|
4121
4290
|
);
|
|
4122
|
-
var codeInterpreterOutputSchema =
|
|
4123
|
-
() =>
|
|
4124
|
-
|
|
4125
|
-
outputs:
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
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() })
|
|
4129
4298
|
])
|
|
4130
4299
|
).nullish()
|
|
4131
4300
|
})
|
|
4132
4301
|
)
|
|
4133
4302
|
);
|
|
4134
|
-
var codeInterpreterArgsSchema =
|
|
4135
|
-
() =>
|
|
4136
|
-
|
|
4137
|
-
container:
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
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()
|
|
4141
4310
|
})
|
|
4142
4311
|
]).optional()
|
|
4143
4312
|
})
|
|
4144
4313
|
)
|
|
4145
4314
|
);
|
|
4146
|
-
var codeInterpreterToolFactory =
|
|
4315
|
+
var codeInterpreterToolFactory = createProviderToolFactoryWithOutputSchema5({
|
|
4147
4316
|
id: "openai.code_interpreter",
|
|
4148
4317
|
inputSchema: codeInterpreterInputSchema,
|
|
4149
4318
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -4154,88 +4323,88 @@ var codeInterpreter = (args = {}) => {
|
|
|
4154
4323
|
|
|
4155
4324
|
// src/tool/file-search.ts
|
|
4156
4325
|
import {
|
|
4157
|
-
createProviderToolFactoryWithOutputSchema as
|
|
4158
|
-
lazySchema as
|
|
4159
|
-
zodSchema as
|
|
4326
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
4327
|
+
lazySchema as lazySchema18,
|
|
4328
|
+
zodSchema as zodSchema18
|
|
4160
4329
|
} from "@ai-sdk/provider-utils";
|
|
4161
|
-
import { z as
|
|
4162
|
-
var comparisonFilterSchema =
|
|
4163
|
-
key:
|
|
4164
|
-
type:
|
|
4165
|
-
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())])
|
|
4166
4335
|
});
|
|
4167
|
-
var compoundFilterSchema =
|
|
4168
|
-
type:
|
|
4169
|
-
filters:
|
|
4170
|
-
|
|
4336
|
+
var compoundFilterSchema = z20.object({
|
|
4337
|
+
type: z20.enum(["and", "or"]),
|
|
4338
|
+
filters: z20.array(
|
|
4339
|
+
z20.union([comparisonFilterSchema, z20.lazy(() => compoundFilterSchema)])
|
|
4171
4340
|
)
|
|
4172
4341
|
});
|
|
4173
|
-
var fileSearchArgsSchema =
|
|
4174
|
-
() =>
|
|
4175
|
-
|
|
4176
|
-
vectorStoreIds:
|
|
4177
|
-
maxNumResults:
|
|
4178
|
-
ranking:
|
|
4179
|
-
ranker:
|
|
4180
|
-
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()
|
|
4181
4350
|
}).optional(),
|
|
4182
|
-
filters:
|
|
4351
|
+
filters: z20.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
4183
4352
|
})
|
|
4184
4353
|
)
|
|
4185
4354
|
);
|
|
4186
|
-
var fileSearchOutputSchema =
|
|
4187
|
-
() =>
|
|
4188
|
-
|
|
4189
|
-
queries:
|
|
4190
|
-
results:
|
|
4191
|
-
|
|
4192
|
-
attributes:
|
|
4193
|
-
fileId:
|
|
4194
|
-
filename:
|
|
4195
|
-
score:
|
|
4196
|
-
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()
|
|
4197
4366
|
})
|
|
4198
4367
|
).nullable()
|
|
4199
4368
|
})
|
|
4200
4369
|
)
|
|
4201
4370
|
);
|
|
4202
|
-
var fileSearch =
|
|
4371
|
+
var fileSearch = createProviderToolFactoryWithOutputSchema6({
|
|
4203
4372
|
id: "openai.file_search",
|
|
4204
|
-
inputSchema:
|
|
4373
|
+
inputSchema: z20.object({}),
|
|
4205
4374
|
outputSchema: fileSearchOutputSchema
|
|
4206
4375
|
});
|
|
4207
4376
|
|
|
4208
4377
|
// src/tool/image-generation.ts
|
|
4209
4378
|
import {
|
|
4210
|
-
createProviderToolFactoryWithOutputSchema as
|
|
4211
|
-
lazySchema as
|
|
4212
|
-
zodSchema as
|
|
4379
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
4380
|
+
lazySchema as lazySchema19,
|
|
4381
|
+
zodSchema as zodSchema19
|
|
4213
4382
|
} from "@ai-sdk/provider-utils";
|
|
4214
|
-
import { z as
|
|
4215
|
-
var imageGenerationArgsSchema =
|
|
4216
|
-
() =>
|
|
4217
|
-
|
|
4218
|
-
background:
|
|
4219
|
-
inputFidelity:
|
|
4220
|
-
inputImageMask:
|
|
4221
|
-
fileId:
|
|
4222
|
-
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()
|
|
4223
4392
|
}).optional(),
|
|
4224
|
-
model:
|
|
4225
|
-
moderation:
|
|
4226
|
-
outputCompression:
|
|
4227
|
-
outputFormat:
|
|
4228
|
-
partialImages:
|
|
4229
|
-
quality:
|
|
4230
|
-
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()
|
|
4231
4400
|
}).strict()
|
|
4232
4401
|
)
|
|
4233
4402
|
);
|
|
4234
|
-
var imageGenerationInputSchema =
|
|
4235
|
-
var imageGenerationOutputSchema =
|
|
4236
|
-
() =>
|
|
4403
|
+
var imageGenerationInputSchema = lazySchema19(() => zodSchema19(z21.object({})));
|
|
4404
|
+
var imageGenerationOutputSchema = lazySchema19(
|
|
4405
|
+
() => zodSchema19(z21.object({ result: z21.string() }))
|
|
4237
4406
|
);
|
|
4238
|
-
var imageGenerationToolFactory =
|
|
4407
|
+
var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema7({
|
|
4239
4408
|
id: "openai.image_generation",
|
|
4240
4409
|
inputSchema: imageGenerationInputSchema,
|
|
4241
4410
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -4247,29 +4416,28 @@ var imageGeneration = (args = {}) => {
|
|
|
4247
4416
|
// src/tool/custom.ts
|
|
4248
4417
|
import {
|
|
4249
4418
|
createProviderToolFactory,
|
|
4250
|
-
lazySchema as
|
|
4251
|
-
zodSchema as
|
|
4419
|
+
lazySchema as lazySchema20,
|
|
4420
|
+
zodSchema as zodSchema20
|
|
4252
4421
|
} from "@ai-sdk/provider-utils";
|
|
4253
|
-
import { z as
|
|
4254
|
-
var customArgsSchema =
|
|
4255
|
-
() =>
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
definition: z21.string()
|
|
4422
|
+
import { z as z22 } from "zod/v4";
|
|
4423
|
+
var customArgsSchema = lazySchema20(
|
|
4424
|
+
() => zodSchema20(
|
|
4425
|
+
z22.object({
|
|
4426
|
+
description: z22.string().optional(),
|
|
4427
|
+
format: z22.union([
|
|
4428
|
+
z22.object({
|
|
4429
|
+
type: z22.literal("grammar"),
|
|
4430
|
+
syntax: z22.enum(["regex", "lark"]),
|
|
4431
|
+
definition: z22.string()
|
|
4264
4432
|
}),
|
|
4265
|
-
|
|
4266
|
-
type:
|
|
4433
|
+
z22.object({
|
|
4434
|
+
type: z22.literal("text")
|
|
4267
4435
|
})
|
|
4268
4436
|
]).optional()
|
|
4269
4437
|
})
|
|
4270
4438
|
)
|
|
4271
4439
|
);
|
|
4272
|
-
var customInputSchema =
|
|
4440
|
+
var customInputSchema = lazySchema20(() => zodSchema20(z22.string()));
|
|
4273
4441
|
var customToolFactory = createProviderToolFactory({
|
|
4274
4442
|
id: "openai.custom",
|
|
4275
4443
|
inputSchema: customInputSchema
|
|
@@ -4277,137 +4445,82 @@ var customToolFactory = createProviderToolFactory({
|
|
|
4277
4445
|
|
|
4278
4446
|
// src/tool/mcp.ts
|
|
4279
4447
|
import {
|
|
4280
|
-
createProviderToolFactoryWithOutputSchema as
|
|
4281
|
-
lazySchema as
|
|
4282
|
-
zodSchema as
|
|
4448
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
4449
|
+
lazySchema as lazySchema21,
|
|
4450
|
+
zodSchema as zodSchema21
|
|
4283
4451
|
} from "@ai-sdk/provider-utils";
|
|
4284
|
-
import { z as
|
|
4285
|
-
var
|
|
4286
|
-
() =>
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4452
|
+
import { z as z23 } from "zod/v4";
|
|
4453
|
+
var jsonValueSchema2 = z23.lazy(
|
|
4454
|
+
() => z23.union([
|
|
4455
|
+
z23.string(),
|
|
4456
|
+
z23.number(),
|
|
4457
|
+
z23.boolean(),
|
|
4458
|
+
z23.null(),
|
|
4459
|
+
z23.array(jsonValueSchema2),
|
|
4460
|
+
z23.record(z23.string(), jsonValueSchema2)
|
|
4293
4461
|
])
|
|
4294
4462
|
);
|
|
4295
|
-
var mcpArgsSchema =
|
|
4296
|
-
() =>
|
|
4297
|
-
|
|
4298
|
-
serverLabel:
|
|
4299
|
-
allowedTools:
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
readOnly:
|
|
4303
|
-
toolNames:
|
|
4463
|
+
var mcpArgsSchema = lazySchema21(
|
|
4464
|
+
() => zodSchema21(
|
|
4465
|
+
z23.object({
|
|
4466
|
+
serverLabel: z23.string(),
|
|
4467
|
+
allowedTools: z23.union([
|
|
4468
|
+
z23.array(z23.string()),
|
|
4469
|
+
z23.object({
|
|
4470
|
+
readOnly: z23.boolean().optional(),
|
|
4471
|
+
toolNames: z23.array(z23.string()).optional()
|
|
4304
4472
|
})
|
|
4305
4473
|
]).optional(),
|
|
4306
|
-
authorization:
|
|
4307
|
-
connectorId:
|
|
4308
|
-
headers:
|
|
4309
|
-
requireApproval:
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
never:
|
|
4313
|
-
toolNames:
|
|
4474
|
+
authorization: z23.string().optional(),
|
|
4475
|
+
connectorId: z23.string().optional(),
|
|
4476
|
+
headers: z23.record(z23.string(), z23.string()).optional(),
|
|
4477
|
+
requireApproval: z23.union([
|
|
4478
|
+
z23.enum(["always", "never"]),
|
|
4479
|
+
z23.object({
|
|
4480
|
+
never: z23.object({
|
|
4481
|
+
toolNames: z23.array(z23.string()).optional()
|
|
4314
4482
|
}).optional()
|
|
4315
4483
|
})
|
|
4316
4484
|
]).optional(),
|
|
4317
|
-
serverDescription:
|
|
4318
|
-
serverUrl:
|
|
4485
|
+
serverDescription: z23.string().optional(),
|
|
4486
|
+
serverUrl: z23.string().optional()
|
|
4319
4487
|
}).refine(
|
|
4320
4488
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
4321
4489
|
"One of serverUrl or connectorId must be provided."
|
|
4322
4490
|
)
|
|
4323
4491
|
)
|
|
4324
4492
|
);
|
|
4325
|
-
var mcpInputSchema =
|
|
4326
|
-
var mcpOutputSchema =
|
|
4327
|
-
() =>
|
|
4328
|
-
|
|
4329
|
-
type:
|
|
4330
|
-
serverLabel:
|
|
4331
|
-
name:
|
|
4332
|
-
arguments:
|
|
4333
|
-
output:
|
|
4334
|
-
error:
|
|
4493
|
+
var mcpInputSchema = lazySchema21(() => zodSchema21(z23.object({})));
|
|
4494
|
+
var mcpOutputSchema = lazySchema21(
|
|
4495
|
+
() => zodSchema21(
|
|
4496
|
+
z23.object({
|
|
4497
|
+
type: z23.literal("call"),
|
|
4498
|
+
serverLabel: z23.string(),
|
|
4499
|
+
name: z23.string(),
|
|
4500
|
+
arguments: z23.string(),
|
|
4501
|
+
output: z23.string().nullish(),
|
|
4502
|
+
error: z23.union([z23.string(), jsonValueSchema2]).optional()
|
|
4335
4503
|
})
|
|
4336
4504
|
)
|
|
4337
4505
|
);
|
|
4338
|
-
var mcpToolFactory =
|
|
4506
|
+
var mcpToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
4339
4507
|
id: "openai.mcp",
|
|
4340
4508
|
inputSchema: mcpInputSchema,
|
|
4341
4509
|
outputSchema: mcpOutputSchema
|
|
4342
4510
|
});
|
|
4343
4511
|
|
|
4344
4512
|
// src/tool/web-search.ts
|
|
4345
|
-
import {
|
|
4346
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
4347
|
-
lazySchema as lazySchema21,
|
|
4348
|
-
zodSchema as zodSchema21
|
|
4349
|
-
} from "@ai-sdk/provider-utils";
|
|
4350
|
-
import { z as z23 } from "zod/v4";
|
|
4351
|
-
var webSearchArgsSchema = lazySchema21(
|
|
4352
|
-
() => zodSchema21(
|
|
4353
|
-
z23.object({
|
|
4354
|
-
externalWebAccess: z23.boolean().optional(),
|
|
4355
|
-
filters: z23.object({ allowedDomains: z23.array(z23.string()).optional() }).optional(),
|
|
4356
|
-
searchContextSize: z23.enum(["low", "medium", "high"]).optional(),
|
|
4357
|
-
userLocation: z23.object({
|
|
4358
|
-
type: z23.literal("approximate"),
|
|
4359
|
-
country: z23.string().optional(),
|
|
4360
|
-
city: z23.string().optional(),
|
|
4361
|
-
region: z23.string().optional(),
|
|
4362
|
-
timezone: z23.string().optional()
|
|
4363
|
-
}).optional()
|
|
4364
|
-
})
|
|
4365
|
-
)
|
|
4366
|
-
);
|
|
4367
|
-
var webSearchInputSchema = lazySchema21(() => zodSchema21(z23.object({})));
|
|
4368
|
-
var webSearchOutputSchema = lazySchema21(
|
|
4369
|
-
() => zodSchema21(
|
|
4370
|
-
z23.object({
|
|
4371
|
-
action: z23.discriminatedUnion("type", [
|
|
4372
|
-
z23.object({
|
|
4373
|
-
type: z23.literal("search"),
|
|
4374
|
-
query: z23.string().optional()
|
|
4375
|
-
}),
|
|
4376
|
-
z23.object({
|
|
4377
|
-
type: z23.literal("openPage"),
|
|
4378
|
-
url: z23.string().nullish()
|
|
4379
|
-
}),
|
|
4380
|
-
z23.object({
|
|
4381
|
-
type: z23.literal("findInPage"),
|
|
4382
|
-
url: z23.string().nullish(),
|
|
4383
|
-
pattern: z23.string().nullish()
|
|
4384
|
-
})
|
|
4385
|
-
]).optional(),
|
|
4386
|
-
sources: z23.array(
|
|
4387
|
-
z23.discriminatedUnion("type", [
|
|
4388
|
-
z23.object({ type: z23.literal("url"), url: z23.string() }),
|
|
4389
|
-
z23.object({ type: z23.literal("api"), name: z23.string() })
|
|
4390
|
-
])
|
|
4391
|
-
).optional()
|
|
4392
|
-
})
|
|
4393
|
-
)
|
|
4394
|
-
);
|
|
4395
|
-
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
4396
|
-
id: "openai.web_search",
|
|
4397
|
-
inputSchema: webSearchInputSchema,
|
|
4398
|
-
outputSchema: webSearchOutputSchema
|
|
4399
|
-
});
|
|
4400
|
-
|
|
4401
|
-
// src/tool/web-search-preview.ts
|
|
4402
4513
|
import {
|
|
4403
4514
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
4404
4515
|
lazySchema as lazySchema22,
|
|
4405
4516
|
zodSchema as zodSchema22
|
|
4406
4517
|
} from "@ai-sdk/provider-utils";
|
|
4407
4518
|
import { z as z24 } from "zod/v4";
|
|
4408
|
-
var
|
|
4519
|
+
var webSearchArgsSchema = lazySchema22(
|
|
4409
4520
|
() => zodSchema22(
|
|
4410
4521
|
z24.object({
|
|
4522
|
+
externalWebAccess: z24.boolean().optional(),
|
|
4523
|
+
filters: z24.object({ allowedDomains: z24.array(z24.string()).optional() }).optional(),
|
|
4411
4524
|
searchContextSize: z24.enum(["low", "medium", "high"]).optional(),
|
|
4412
4525
|
userLocation: z24.object({
|
|
4413
4526
|
type: z24.literal("approximate"),
|
|
@@ -4419,10 +4532,8 @@ var webSearchPreviewArgsSchema = lazySchema22(
|
|
|
4419
4532
|
})
|
|
4420
4533
|
)
|
|
4421
4534
|
);
|
|
4422
|
-
var
|
|
4423
|
-
|
|
4424
|
-
);
|
|
4425
|
-
var webSearchPreviewOutputSchema = lazySchema22(
|
|
4535
|
+
var webSearchInputSchema = lazySchema22(() => zodSchema22(z24.object({})));
|
|
4536
|
+
var webSearchOutputSchema = lazySchema22(
|
|
4426
4537
|
() => zodSchema22(
|
|
4427
4538
|
z24.object({
|
|
4428
4539
|
action: z24.discriminatedUnion("type", [
|
|
@@ -4439,11 +4550,68 @@ var webSearchPreviewOutputSchema = lazySchema22(
|
|
|
4439
4550
|
url: z24.string().nullish(),
|
|
4440
4551
|
pattern: z24.string().nullish()
|
|
4441
4552
|
})
|
|
4553
|
+
]).optional(),
|
|
4554
|
+
sources: z24.array(
|
|
4555
|
+
z24.discriminatedUnion("type", [
|
|
4556
|
+
z24.object({ type: z24.literal("url"), url: z24.string() }),
|
|
4557
|
+
z24.object({ type: z24.literal("api"), name: z24.string() })
|
|
4558
|
+
])
|
|
4559
|
+
).optional()
|
|
4560
|
+
})
|
|
4561
|
+
)
|
|
4562
|
+
);
|
|
4563
|
+
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema9({
|
|
4564
|
+
id: "openai.web_search",
|
|
4565
|
+
inputSchema: webSearchInputSchema,
|
|
4566
|
+
outputSchema: webSearchOutputSchema
|
|
4567
|
+
});
|
|
4568
|
+
|
|
4569
|
+
// src/tool/web-search-preview.ts
|
|
4570
|
+
import {
|
|
4571
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
4572
|
+
lazySchema as lazySchema23,
|
|
4573
|
+
zodSchema as zodSchema23
|
|
4574
|
+
} from "@ai-sdk/provider-utils";
|
|
4575
|
+
import { z as z25 } from "zod/v4";
|
|
4576
|
+
var webSearchPreviewArgsSchema = lazySchema23(
|
|
4577
|
+
() => zodSchema23(
|
|
4578
|
+
z25.object({
|
|
4579
|
+
searchContextSize: z25.enum(["low", "medium", "high"]).optional(),
|
|
4580
|
+
userLocation: z25.object({
|
|
4581
|
+
type: z25.literal("approximate"),
|
|
4582
|
+
country: z25.string().optional(),
|
|
4583
|
+
city: z25.string().optional(),
|
|
4584
|
+
region: z25.string().optional(),
|
|
4585
|
+
timezone: z25.string().optional()
|
|
4586
|
+
}).optional()
|
|
4587
|
+
})
|
|
4588
|
+
)
|
|
4589
|
+
);
|
|
4590
|
+
var webSearchPreviewInputSchema = lazySchema23(
|
|
4591
|
+
() => zodSchema23(z25.object({}))
|
|
4592
|
+
);
|
|
4593
|
+
var webSearchPreviewOutputSchema = lazySchema23(
|
|
4594
|
+
() => zodSchema23(
|
|
4595
|
+
z25.object({
|
|
4596
|
+
action: z25.discriminatedUnion("type", [
|
|
4597
|
+
z25.object({
|
|
4598
|
+
type: z25.literal("search"),
|
|
4599
|
+
query: z25.string().optional()
|
|
4600
|
+
}),
|
|
4601
|
+
z25.object({
|
|
4602
|
+
type: z25.literal("openPage"),
|
|
4603
|
+
url: z25.string().nullish()
|
|
4604
|
+
}),
|
|
4605
|
+
z25.object({
|
|
4606
|
+
type: z25.literal("findInPage"),
|
|
4607
|
+
url: z25.string().nullish(),
|
|
4608
|
+
pattern: z25.string().nullish()
|
|
4609
|
+
})
|
|
4442
4610
|
]).optional()
|
|
4443
4611
|
})
|
|
4444
4612
|
)
|
|
4445
4613
|
);
|
|
4446
|
-
var webSearchPreview =
|
|
4614
|
+
var webSearchPreview = createProviderToolFactoryWithOutputSchema10({
|
|
4447
4615
|
id: "openai.web_search_preview",
|
|
4448
4616
|
inputSchema: webSearchPreviewInputSchema,
|
|
4449
4617
|
outputSchema: webSearchPreviewOutputSchema
|
|
@@ -4456,7 +4624,7 @@ async function prepareResponsesTools({
|
|
|
4456
4624
|
toolNameMapping,
|
|
4457
4625
|
customProviderToolNames
|
|
4458
4626
|
}) {
|
|
4459
|
-
var _a;
|
|
4627
|
+
var _a, _b;
|
|
4460
4628
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
4461
4629
|
const toolWarnings = [];
|
|
4462
4630
|
if (tools == null) {
|
|
@@ -4466,15 +4634,19 @@ async function prepareResponsesTools({
|
|
|
4466
4634
|
const resolvedCustomProviderToolNames = customProviderToolNames != null ? customProviderToolNames : /* @__PURE__ */ new Set();
|
|
4467
4635
|
for (const tool of tools) {
|
|
4468
4636
|
switch (tool.type) {
|
|
4469
|
-
case "function":
|
|
4637
|
+
case "function": {
|
|
4638
|
+
const openaiOptions = (_a = tool.providerOptions) == null ? void 0 : _a.openai;
|
|
4639
|
+
const deferLoading = openaiOptions == null ? void 0 : openaiOptions.deferLoading;
|
|
4470
4640
|
openaiTools.push({
|
|
4471
4641
|
type: "function",
|
|
4472
4642
|
name: tool.name,
|
|
4473
4643
|
description: tool.description,
|
|
4474
4644
|
parameters: tool.inputSchema,
|
|
4475
|
-
...tool.strict != null ? { strict: tool.strict } : {}
|
|
4645
|
+
...tool.strict != null ? { strict: tool.strict } : {},
|
|
4646
|
+
...deferLoading != null ? { defer_loading: deferLoading } : {}
|
|
4476
4647
|
});
|
|
4477
4648
|
break;
|
|
4649
|
+
}
|
|
4478
4650
|
case "provider": {
|
|
4479
4651
|
switch (tool.id) {
|
|
4480
4652
|
case "openai.file_search": {
|
|
@@ -4612,11 +4784,24 @@ async function prepareResponsesTools({
|
|
|
4612
4784
|
});
|
|
4613
4785
|
openaiTools.push({
|
|
4614
4786
|
type: "custom",
|
|
4615
|
-
name:
|
|
4787
|
+
name: tool.name,
|
|
4616
4788
|
description: args.description,
|
|
4617
4789
|
format: args.format
|
|
4618
4790
|
});
|
|
4619
|
-
resolvedCustomProviderToolNames.add(
|
|
4791
|
+
resolvedCustomProviderToolNames.add(tool.name);
|
|
4792
|
+
break;
|
|
4793
|
+
}
|
|
4794
|
+
case "openai.tool_search": {
|
|
4795
|
+
const args = await validateTypes2({
|
|
4796
|
+
value: tool.args,
|
|
4797
|
+
schema: toolSearchArgsSchema
|
|
4798
|
+
});
|
|
4799
|
+
openaiTools.push({
|
|
4800
|
+
type: "tool_search",
|
|
4801
|
+
...args.execution != null ? { execution: args.execution } : {},
|
|
4802
|
+
...args.description != null ? { description: args.description } : {},
|
|
4803
|
+
...args.parameters != null ? { parameters: args.parameters } : {}
|
|
4804
|
+
});
|
|
4620
4805
|
break;
|
|
4621
4806
|
}
|
|
4622
4807
|
}
|
|
@@ -4640,7 +4825,7 @@ async function prepareResponsesTools({
|
|
|
4640
4825
|
case "required":
|
|
4641
4826
|
return { tools: openaiTools, toolChoice: type, toolWarnings };
|
|
4642
4827
|
case "tool": {
|
|
4643
|
-
const resolvedToolName = (
|
|
4828
|
+
const resolvedToolName = (_b = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _b : toolChoice.toolName;
|
|
4644
4829
|
return {
|
|
4645
4830
|
tools: openaiTools,
|
|
4646
4831
|
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 },
|
|
@@ -4720,7 +4905,7 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
|
|
|
4720
4905
|
}
|
|
4721
4906
|
var OpenAIResponsesLanguageModel = class {
|
|
4722
4907
|
constructor(modelId, config) {
|
|
4723
|
-
this.specificationVersion = "
|
|
4908
|
+
this.specificationVersion = "v4";
|
|
4724
4909
|
this.supportedUrls = {
|
|
4725
4910
|
"image/*": [/^https?:\/\/.*$/],
|
|
4726
4911
|
"application/pdf": [/^https?:\/\/.*$/]
|
|
@@ -4796,9 +4981,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4796
4981
|
"openai.web_search": "web_search",
|
|
4797
4982
|
"openai.web_search_preview": "web_search_preview",
|
|
4798
4983
|
"openai.mcp": "mcp",
|
|
4799
|
-
"openai.apply_patch": "apply_patch"
|
|
4800
|
-
|
|
4801
|
-
|
|
4984
|
+
"openai.apply_patch": "apply_patch",
|
|
4985
|
+
"openai.tool_search": "tool_search"
|
|
4986
|
+
}
|
|
4802
4987
|
});
|
|
4803
4988
|
const customProviderToolNames = /* @__PURE__ */ new Set();
|
|
4804
4989
|
const {
|
|
@@ -4974,7 +5159,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4974
5159
|
};
|
|
4975
5160
|
}
|
|
4976
5161
|
async doGenerate(options) {
|
|
4977
|
-
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;
|
|
5162
|
+
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;
|
|
4978
5163
|
const {
|
|
4979
5164
|
args: body,
|
|
4980
5165
|
warnings,
|
|
@@ -5017,6 +5202,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5017
5202
|
const content = [];
|
|
5018
5203
|
const logprobs = [];
|
|
5019
5204
|
let hasFunctionCall = false;
|
|
5205
|
+
const hostedToolSearchCallIds = [];
|
|
5020
5206
|
for (const part of response.output) {
|
|
5021
5207
|
switch (part.type) {
|
|
5022
5208
|
case "reasoning": {
|
|
@@ -5055,6 +5241,46 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5055
5241
|
});
|
|
5056
5242
|
break;
|
|
5057
5243
|
}
|
|
5244
|
+
case "tool_search_call": {
|
|
5245
|
+
const toolCallId = (_b = part.call_id) != null ? _b : part.id;
|
|
5246
|
+
const isHosted = part.execution === "server";
|
|
5247
|
+
if (isHosted) {
|
|
5248
|
+
hostedToolSearchCallIds.push(toolCallId);
|
|
5249
|
+
}
|
|
5250
|
+
content.push({
|
|
5251
|
+
type: "tool-call",
|
|
5252
|
+
toolCallId,
|
|
5253
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
5254
|
+
input: JSON.stringify({
|
|
5255
|
+
arguments: part.arguments,
|
|
5256
|
+
call_id: part.call_id
|
|
5257
|
+
}),
|
|
5258
|
+
...isHosted ? { providerExecuted: true } : {},
|
|
5259
|
+
providerMetadata: {
|
|
5260
|
+
[providerOptionsName]: {
|
|
5261
|
+
itemId: part.id
|
|
5262
|
+
}
|
|
5263
|
+
}
|
|
5264
|
+
});
|
|
5265
|
+
break;
|
|
5266
|
+
}
|
|
5267
|
+
case "tool_search_output": {
|
|
5268
|
+
const toolCallId = (_d = (_c = part.call_id) != null ? _c : hostedToolSearchCallIds.shift()) != null ? _d : part.id;
|
|
5269
|
+
content.push({
|
|
5270
|
+
type: "tool-result",
|
|
5271
|
+
toolCallId,
|
|
5272
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
5273
|
+
result: {
|
|
5274
|
+
tools: part.tools
|
|
5275
|
+
},
|
|
5276
|
+
providerMetadata: {
|
|
5277
|
+
[providerOptionsName]: {
|
|
5278
|
+
itemId: part.id
|
|
5279
|
+
}
|
|
5280
|
+
}
|
|
5281
|
+
});
|
|
5282
|
+
break;
|
|
5283
|
+
}
|
|
5058
5284
|
case "local_shell_call": {
|
|
5059
5285
|
content.push({
|
|
5060
5286
|
type: "tool-call",
|
|
@@ -5110,7 +5336,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5110
5336
|
}
|
|
5111
5337
|
case "message": {
|
|
5112
5338
|
for (const contentPart of part.content) {
|
|
5113
|
-
if (((
|
|
5339
|
+
if (((_f = (_e = options.providerOptions) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.logprobs) && contentPart.logprobs) {
|
|
5114
5340
|
logprobs.push(contentPart.logprobs);
|
|
5115
5341
|
}
|
|
5116
5342
|
const providerMetadata2 = {
|
|
@@ -5132,7 +5358,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5132
5358
|
content.push({
|
|
5133
5359
|
type: "source",
|
|
5134
5360
|
sourceType: "url",
|
|
5135
|
-
id: (
|
|
5361
|
+
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : generateId2(),
|
|
5136
5362
|
url: annotation.url,
|
|
5137
5363
|
title: annotation.title
|
|
5138
5364
|
});
|
|
@@ -5140,7 +5366,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5140
5366
|
content.push({
|
|
5141
5367
|
type: "source",
|
|
5142
5368
|
sourceType: "document",
|
|
5143
|
-
id: (
|
|
5369
|
+
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
|
|
5144
5370
|
mediaType: "text/plain",
|
|
5145
5371
|
title: annotation.filename,
|
|
5146
5372
|
filename: annotation.filename,
|
|
@@ -5156,7 +5382,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5156
5382
|
content.push({
|
|
5157
5383
|
type: "source",
|
|
5158
5384
|
sourceType: "document",
|
|
5159
|
-
id: (
|
|
5385
|
+
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
|
|
5160
5386
|
mediaType: "text/plain",
|
|
5161
5387
|
title: annotation.filename,
|
|
5162
5388
|
filename: annotation.filename,
|
|
@@ -5172,7 +5398,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5172
5398
|
content.push({
|
|
5173
5399
|
type: "source",
|
|
5174
5400
|
sourceType: "document",
|
|
5175
|
-
id: (
|
|
5401
|
+
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : generateId2(),
|
|
5176
5402
|
mediaType: "application/octet-stream",
|
|
5177
5403
|
title: annotation.file_id,
|
|
5178
5404
|
filename: annotation.file_id,
|
|
@@ -5241,7 +5467,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5241
5467
|
break;
|
|
5242
5468
|
}
|
|
5243
5469
|
case "mcp_call": {
|
|
5244
|
-
const toolCallId = part.approval_request_id != null ? (
|
|
5470
|
+
const toolCallId = part.approval_request_id != null ? (_s = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _s : part.id : part.id;
|
|
5245
5471
|
const toolName = `mcp.${part.name}`;
|
|
5246
5472
|
content.push({
|
|
5247
5473
|
type: "tool-call",
|
|
@@ -5275,8 +5501,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5275
5501
|
break;
|
|
5276
5502
|
}
|
|
5277
5503
|
case "mcp_approval_request": {
|
|
5278
|
-
const approvalRequestId = (
|
|
5279
|
-
const dummyToolCallId = (
|
|
5504
|
+
const approvalRequestId = (_t = part.approval_request_id) != null ? _t : part.id;
|
|
5505
|
+
const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : generateId2();
|
|
5280
5506
|
const toolName = `mcp.${part.name}`;
|
|
5281
5507
|
content.push({
|
|
5282
5508
|
type: "tool-call",
|
|
@@ -5326,13 +5552,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5326
5552
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
5327
5553
|
result: {
|
|
5328
5554
|
queries: part.queries,
|
|
5329
|
-
results: (
|
|
5555
|
+
results: (_y = (_x = part.results) == null ? void 0 : _x.map((result) => ({
|
|
5330
5556
|
attributes: result.attributes,
|
|
5331
5557
|
fileId: result.file_id,
|
|
5332
5558
|
filename: result.filename,
|
|
5333
5559
|
score: result.score,
|
|
5334
5560
|
text: result.text
|
|
5335
|
-
}))) != null ?
|
|
5561
|
+
}))) != null ? _y : null
|
|
5336
5562
|
}
|
|
5337
5563
|
});
|
|
5338
5564
|
break;
|
|
@@ -5389,10 +5615,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5389
5615
|
content,
|
|
5390
5616
|
finishReason: {
|
|
5391
5617
|
unified: mapOpenAIResponseFinishReason({
|
|
5392
|
-
finishReason: (
|
|
5618
|
+
finishReason: (_z = response.incomplete_details) == null ? void 0 : _z.reason,
|
|
5393
5619
|
hasFunctionCall
|
|
5394
5620
|
}),
|
|
5395
|
-
raw: (
|
|
5621
|
+
raw: (_B = (_A = response.incomplete_details) == null ? void 0 : _A.reason) != null ? _B : void 0
|
|
5396
5622
|
},
|
|
5397
5623
|
usage: convertOpenAIResponsesUsage(usage),
|
|
5398
5624
|
request: { body },
|
|
@@ -5450,6 +5676,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5450
5676
|
let hasFunctionCall = false;
|
|
5451
5677
|
const activeReasoning = {};
|
|
5452
5678
|
let serviceTier;
|
|
5679
|
+
const hostedToolSearchCallIds = [];
|
|
5453
5680
|
return {
|
|
5454
5681
|
stream: response.pipeThrough(
|
|
5455
5682
|
new TransformStream({
|
|
@@ -5457,7 +5684,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5457
5684
|
controller.enqueue({ type: "stream-start", warnings });
|
|
5458
5685
|
},
|
|
5459
5686
|
transform(chunk, controller) {
|
|
5460
|
-
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;
|
|
5687
|
+
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;
|
|
5461
5688
|
if (options.includeRawChunks) {
|
|
5462
5689
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
5463
5690
|
}
|
|
@@ -5565,6 +5792,24 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5565
5792
|
input: "{}",
|
|
5566
5793
|
providerExecuted: true
|
|
5567
5794
|
});
|
|
5795
|
+
} else if (value.item.type === "tool_search_call") {
|
|
5796
|
+
const toolCallId = value.item.id;
|
|
5797
|
+
const toolName = toolNameMapping.toCustomToolName("tool_search");
|
|
5798
|
+
const isHosted = value.item.execution === "server";
|
|
5799
|
+
ongoingToolCalls[value.output_index] = {
|
|
5800
|
+
toolName,
|
|
5801
|
+
toolCallId,
|
|
5802
|
+
toolSearchExecution: (_a = value.item.execution) != null ? _a : "server"
|
|
5803
|
+
};
|
|
5804
|
+
if (isHosted) {
|
|
5805
|
+
controller.enqueue({
|
|
5806
|
+
type: "tool-input-start",
|
|
5807
|
+
id: toolCallId,
|
|
5808
|
+
toolName,
|
|
5809
|
+
providerExecuted: true
|
|
5810
|
+
});
|
|
5811
|
+
}
|
|
5812
|
+
} else if (value.item.type === "tool_search_output") {
|
|
5568
5813
|
} else if (value.item.type === "mcp_call" || value.item.type === "mcp_list_tools" || value.item.type === "mcp_approval_request") {
|
|
5569
5814
|
} else if (value.item.type === "apply_patch_call") {
|
|
5570
5815
|
const { call_id: callId, operation } = value.item;
|
|
@@ -5611,7 +5856,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5611
5856
|
} else if (value.item.type === "shell_call_output") {
|
|
5612
5857
|
} else if (value.item.type === "message") {
|
|
5613
5858
|
ongoingAnnotations.splice(0, ongoingAnnotations.length);
|
|
5614
|
-
activeMessagePhase = (
|
|
5859
|
+
activeMessagePhase = (_b = value.item.phase) != null ? _b : void 0;
|
|
5615
5860
|
controller.enqueue({
|
|
5616
5861
|
type: "text-start",
|
|
5617
5862
|
id: value.item.id,
|
|
@@ -5635,14 +5880,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5635
5880
|
providerMetadata: {
|
|
5636
5881
|
[providerOptionsName]: {
|
|
5637
5882
|
itemId: value.item.id,
|
|
5638
|
-
reasoningEncryptedContent: (
|
|
5883
|
+
reasoningEncryptedContent: (_c = value.item.encrypted_content) != null ? _c : null
|
|
5639
5884
|
}
|
|
5640
5885
|
}
|
|
5641
5886
|
});
|
|
5642
5887
|
}
|
|
5643
5888
|
} else if (isResponseOutputItemDoneChunk(value)) {
|
|
5644
5889
|
if (value.item.type === "message") {
|
|
5645
|
-
const phase = (
|
|
5890
|
+
const phase = (_d = value.item.phase) != null ? _d : activeMessagePhase;
|
|
5646
5891
|
activeMessagePhase = void 0;
|
|
5647
5892
|
controller.enqueue({
|
|
5648
5893
|
type: "text-end",
|
|
@@ -5736,13 +5981,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5736
5981
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
5737
5982
|
result: {
|
|
5738
5983
|
queries: value.item.queries,
|
|
5739
|
-
results: (
|
|
5984
|
+
results: (_f = (_e = value.item.results) == null ? void 0 : _e.map((result) => ({
|
|
5740
5985
|
attributes: result.attributes,
|
|
5741
5986
|
fileId: result.file_id,
|
|
5742
5987
|
filename: result.filename,
|
|
5743
5988
|
score: result.score,
|
|
5744
5989
|
text: result.text
|
|
5745
|
-
}))) != null ?
|
|
5990
|
+
}))) != null ? _f : null
|
|
5746
5991
|
}
|
|
5747
5992
|
});
|
|
5748
5993
|
} else if (value.item.type === "code_interpreter_call") {
|
|
@@ -5764,12 +6009,62 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5764
6009
|
result: value.item.result
|
|
5765
6010
|
}
|
|
5766
6011
|
});
|
|
6012
|
+
} else if (value.item.type === "tool_search_call") {
|
|
6013
|
+
const toolCall = ongoingToolCalls[value.output_index];
|
|
6014
|
+
const isHosted = value.item.execution === "server";
|
|
6015
|
+
if (toolCall != null) {
|
|
6016
|
+
const toolCallId = isHosted ? toolCall.toolCallId : (_g = value.item.call_id) != null ? _g : value.item.id;
|
|
6017
|
+
if (isHosted) {
|
|
6018
|
+
hostedToolSearchCallIds.push(toolCallId);
|
|
6019
|
+
} else {
|
|
6020
|
+
controller.enqueue({
|
|
6021
|
+
type: "tool-input-start",
|
|
6022
|
+
id: toolCallId,
|
|
6023
|
+
toolName: toolCall.toolName
|
|
6024
|
+
});
|
|
6025
|
+
}
|
|
6026
|
+
controller.enqueue({
|
|
6027
|
+
type: "tool-input-end",
|
|
6028
|
+
id: toolCallId
|
|
6029
|
+
});
|
|
6030
|
+
controller.enqueue({
|
|
6031
|
+
type: "tool-call",
|
|
6032
|
+
toolCallId,
|
|
6033
|
+
toolName: toolCall.toolName,
|
|
6034
|
+
input: JSON.stringify({
|
|
6035
|
+
arguments: value.item.arguments,
|
|
6036
|
+
call_id: isHosted ? null : toolCallId
|
|
6037
|
+
}),
|
|
6038
|
+
...isHosted ? { providerExecuted: true } : {},
|
|
6039
|
+
providerMetadata: {
|
|
6040
|
+
[providerOptionsName]: {
|
|
6041
|
+
itemId: value.item.id
|
|
6042
|
+
}
|
|
6043
|
+
}
|
|
6044
|
+
});
|
|
6045
|
+
}
|
|
6046
|
+
ongoingToolCalls[value.output_index] = void 0;
|
|
6047
|
+
} else if (value.item.type === "tool_search_output") {
|
|
6048
|
+
const toolCallId = (_i = (_h = value.item.call_id) != null ? _h : hostedToolSearchCallIds.shift()) != null ? _i : value.item.id;
|
|
6049
|
+
controller.enqueue({
|
|
6050
|
+
type: "tool-result",
|
|
6051
|
+
toolCallId,
|
|
6052
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
6053
|
+
result: {
|
|
6054
|
+
tools: value.item.tools
|
|
6055
|
+
},
|
|
6056
|
+
providerMetadata: {
|
|
6057
|
+
[providerOptionsName]: {
|
|
6058
|
+
itemId: value.item.id
|
|
6059
|
+
}
|
|
6060
|
+
}
|
|
6061
|
+
});
|
|
5767
6062
|
} else if (value.item.type === "mcp_call") {
|
|
5768
6063
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5769
|
-
const approvalRequestId = (
|
|
5770
|
-
const aliasedToolCallId = approvalRequestId != null ? (
|
|
6064
|
+
const approvalRequestId = (_j = value.item.approval_request_id) != null ? _j : void 0;
|
|
6065
|
+
const aliasedToolCallId = approvalRequestId != null ? (_l = (_k = approvalRequestIdToDummyToolCallIdFromStream.get(
|
|
5771
6066
|
approvalRequestId
|
|
5772
|
-
)) != null ?
|
|
6067
|
+
)) != null ? _k : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _l : value.item.id : value.item.id;
|
|
5773
6068
|
const toolName = `mcp.${value.item.name}`;
|
|
5774
6069
|
controller.enqueue({
|
|
5775
6070
|
type: "tool-call",
|
|
@@ -5839,8 +6134,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5839
6134
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5840
6135
|
} else if (value.item.type === "mcp_approval_request") {
|
|
5841
6136
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5842
|
-
const dummyToolCallId = (
|
|
5843
|
-
const approvalRequestId = (
|
|
6137
|
+
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2();
|
|
6138
|
+
const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
|
|
5844
6139
|
approvalRequestIdToDummyToolCallIdFromStream.set(
|
|
5845
6140
|
approvalRequestId,
|
|
5846
6141
|
dummyToolCallId
|
|
@@ -5929,7 +6224,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5929
6224
|
providerMetadata: {
|
|
5930
6225
|
[providerOptionsName]: {
|
|
5931
6226
|
itemId: value.item.id,
|
|
5932
|
-
reasoningEncryptedContent: (
|
|
6227
|
+
reasoningEncryptedContent: (_q = value.item.encrypted_content) != null ? _q : null
|
|
5933
6228
|
}
|
|
5934
6229
|
}
|
|
5935
6230
|
});
|
|
@@ -6042,7 +6337,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6042
6337
|
id: value.item_id,
|
|
6043
6338
|
delta: value.delta
|
|
6044
6339
|
});
|
|
6045
|
-
if (((
|
|
6340
|
+
if (((_s = (_r = options.providerOptions) == null ? void 0 : _r[providerOptionsName]) == null ? void 0 : _s.logprobs) && value.logprobs) {
|
|
6046
6341
|
logprobs.push(value.logprobs);
|
|
6047
6342
|
}
|
|
6048
6343
|
} else if (value.type === "response.reasoning_summary_part.added") {
|
|
@@ -6071,7 +6366,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6071
6366
|
providerMetadata: {
|
|
6072
6367
|
[providerOptionsName]: {
|
|
6073
6368
|
itemId: value.item_id,
|
|
6074
|
-
reasoningEncryptedContent: (
|
|
6369
|
+
reasoningEncryptedContent: (_u = (_t = activeReasoning[value.item_id]) == null ? void 0 : _t.encryptedContent) != null ? _u : null
|
|
6075
6370
|
}
|
|
6076
6371
|
}
|
|
6077
6372
|
});
|
|
@@ -6105,10 +6400,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6105
6400
|
} else if (isResponseFinishedChunk(value)) {
|
|
6106
6401
|
finishReason = {
|
|
6107
6402
|
unified: mapOpenAIResponseFinishReason({
|
|
6108
|
-
finishReason: (
|
|
6403
|
+
finishReason: (_v = value.response.incomplete_details) == null ? void 0 : _v.reason,
|
|
6109
6404
|
hasFunctionCall
|
|
6110
6405
|
}),
|
|
6111
|
-
raw: (
|
|
6406
|
+
raw: (_x = (_w = value.response.incomplete_details) == null ? void 0 : _w.reason) != null ? _x : void 0
|
|
6112
6407
|
};
|
|
6113
6408
|
usage = value.response.usage;
|
|
6114
6409
|
if (typeof value.response.service_tier === "string") {
|
|
@@ -6120,7 +6415,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6120
6415
|
controller.enqueue({
|
|
6121
6416
|
type: "source",
|
|
6122
6417
|
sourceType: "url",
|
|
6123
|
-
id: (
|
|
6418
|
+
id: (_A = (_z = (_y = self.config).generateId) == null ? void 0 : _z.call(_y)) != null ? _A : generateId2(),
|
|
6124
6419
|
url: value.annotation.url,
|
|
6125
6420
|
title: value.annotation.title
|
|
6126
6421
|
});
|
|
@@ -6128,7 +6423,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6128
6423
|
controller.enqueue({
|
|
6129
6424
|
type: "source",
|
|
6130
6425
|
sourceType: "document",
|
|
6131
|
-
id: (
|
|
6426
|
+
id: (_D = (_C = (_B = self.config).generateId) == null ? void 0 : _C.call(_B)) != null ? _D : generateId2(),
|
|
6132
6427
|
mediaType: "text/plain",
|
|
6133
6428
|
title: value.annotation.filename,
|
|
6134
6429
|
filename: value.annotation.filename,
|
|
@@ -6144,7 +6439,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6144
6439
|
controller.enqueue({
|
|
6145
6440
|
type: "source",
|
|
6146
6441
|
sourceType: "document",
|
|
6147
|
-
id: (
|
|
6442
|
+
id: (_G = (_F = (_E = self.config).generateId) == null ? void 0 : _F.call(_E)) != null ? _G : generateId2(),
|
|
6148
6443
|
mediaType: "text/plain",
|
|
6149
6444
|
title: value.annotation.filename,
|
|
6150
6445
|
filename: value.annotation.filename,
|
|
@@ -6160,7 +6455,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6160
6455
|
controller.enqueue({
|
|
6161
6456
|
type: "source",
|
|
6162
6457
|
sourceType: "document",
|
|
6163
|
-
id: (
|
|
6458
|
+
id: (_J = (_I = (_H = self.config).generateId) == null ? void 0 : _I.call(_H)) != null ? _J : generateId2(),
|
|
6164
6459
|
mediaType: "application/octet-stream",
|
|
6165
6460
|
title: value.annotation.file_id,
|
|
6166
6461
|
filename: value.annotation.file_id,
|