@ai-sdk/openai 2.0.133 → 2.0.134
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 +6 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +76 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -9
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +570 -503
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +568 -500
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/internal/index.js
CHANGED
|
@@ -2323,8 +2323,8 @@ var import_provider_utils30 = require("@ai-sdk/provider-utils");
|
|
|
2323
2323
|
|
|
2324
2324
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2325
2325
|
var import_provider6 = require("@ai-sdk/provider");
|
|
2326
|
-
var
|
|
2327
|
-
var
|
|
2326
|
+
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
2327
|
+
var import_v416 = require("zod/v4");
|
|
2328
2328
|
|
|
2329
2329
|
// src/responses/openai-responses-options.ts
|
|
2330
2330
|
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
@@ -2555,7 +2555,115 @@ var localShell = (0, import_provider_utils21.createProviderDefinedToolFactoryWit
|
|
|
2555
2555
|
outputSchema: localShellOutputSchema
|
|
2556
2556
|
});
|
|
2557
2557
|
|
|
2558
|
+
// src/tool/web-search.ts
|
|
2559
|
+
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
2560
|
+
var import_v415 = require("zod/v4");
|
|
2561
|
+
var webSearchArgsSchema = (0, import_provider_utils22.lazySchema)(
|
|
2562
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
2563
|
+
import_v415.z.object({
|
|
2564
|
+
externalWebAccess: import_v415.z.boolean().optional(),
|
|
2565
|
+
filters: import_v415.z.object({
|
|
2566
|
+
allowedDomains: import_v415.z.array(import_v415.z.string()).optional(),
|
|
2567
|
+
blockedDomains: import_v415.z.array(import_v415.z.string()).optional()
|
|
2568
|
+
}).optional(),
|
|
2569
|
+
searchContextSize: import_v415.z.enum(["low", "medium", "high"]).optional(),
|
|
2570
|
+
userLocation: import_v415.z.object({
|
|
2571
|
+
type: import_v415.z.literal("approximate"),
|
|
2572
|
+
country: import_v415.z.string().optional(),
|
|
2573
|
+
city: import_v415.z.string().optional(),
|
|
2574
|
+
region: import_v415.z.string().optional(),
|
|
2575
|
+
timezone: import_v415.z.string().optional()
|
|
2576
|
+
}).optional()
|
|
2577
|
+
})
|
|
2578
|
+
)
|
|
2579
|
+
);
|
|
2580
|
+
var webSearchInputSchema = (0, import_provider_utils22.lazySchema)(() => (0, import_provider_utils22.zodSchema)(import_v415.z.object({})));
|
|
2581
|
+
var webSearchOutputSchema = (0, import_provider_utils22.lazySchema)(
|
|
2582
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
2583
|
+
import_v415.z.object({
|
|
2584
|
+
action: import_v415.z.discriminatedUnion("type", [
|
|
2585
|
+
import_v415.z.object({
|
|
2586
|
+
type: import_v415.z.literal("search"),
|
|
2587
|
+
query: import_v415.z.string().optional()
|
|
2588
|
+
}),
|
|
2589
|
+
import_v415.z.object({
|
|
2590
|
+
type: import_v415.z.literal("openPage"),
|
|
2591
|
+
url: import_v415.z.string().nullish()
|
|
2592
|
+
}),
|
|
2593
|
+
import_v415.z.object({
|
|
2594
|
+
type: import_v415.z.literal("findInPage"),
|
|
2595
|
+
url: import_v415.z.string().nullish(),
|
|
2596
|
+
pattern: import_v415.z.string().nullish()
|
|
2597
|
+
})
|
|
2598
|
+
]).optional(),
|
|
2599
|
+
sources: import_v415.z.array(
|
|
2600
|
+
import_v415.z.discriminatedUnion("type", [
|
|
2601
|
+
import_v415.z.object({ type: import_v415.z.literal("url"), url: import_v415.z.string() }),
|
|
2602
|
+
import_v415.z.object({ type: import_v415.z.literal("api"), name: import_v415.z.string() })
|
|
2603
|
+
])
|
|
2604
|
+
).optional()
|
|
2605
|
+
})
|
|
2606
|
+
)
|
|
2607
|
+
);
|
|
2608
|
+
var webSearchToolFactory = (0, import_provider_utils22.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
2609
|
+
id: "openai.web_search",
|
|
2610
|
+
name: "web_search",
|
|
2611
|
+
inputSchema: webSearchInputSchema,
|
|
2612
|
+
outputSchema: webSearchOutputSchema
|
|
2613
|
+
});
|
|
2614
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
2615
|
+
|
|
2558
2616
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2617
|
+
async function convertWebSearchToolResultOutput({
|
|
2618
|
+
output,
|
|
2619
|
+
id
|
|
2620
|
+
}) {
|
|
2621
|
+
if (output.type !== "json") {
|
|
2622
|
+
return void 0;
|
|
2623
|
+
}
|
|
2624
|
+
const validation = await (0, import_provider_utils23.safeValidateTypes)({
|
|
2625
|
+
value: output.value,
|
|
2626
|
+
schema: webSearchOutputSchema
|
|
2627
|
+
});
|
|
2628
|
+
if (!validation.success || validation.value.action == null) {
|
|
2629
|
+
return void 0;
|
|
2630
|
+
}
|
|
2631
|
+
const { action, sources } = validation.value;
|
|
2632
|
+
switch (action.type) {
|
|
2633
|
+
case "search":
|
|
2634
|
+
return {
|
|
2635
|
+
type: "web_search_call",
|
|
2636
|
+
id,
|
|
2637
|
+
status: "completed",
|
|
2638
|
+
action: {
|
|
2639
|
+
type: "search",
|
|
2640
|
+
...action.query != null && { query: action.query },
|
|
2641
|
+
...sources != null && { sources }
|
|
2642
|
+
}
|
|
2643
|
+
};
|
|
2644
|
+
case "openPage":
|
|
2645
|
+
return {
|
|
2646
|
+
type: "web_search_call",
|
|
2647
|
+
id,
|
|
2648
|
+
status: "completed",
|
|
2649
|
+
action: {
|
|
2650
|
+
type: "open_page",
|
|
2651
|
+
url: action.url
|
|
2652
|
+
}
|
|
2653
|
+
};
|
|
2654
|
+
case "findInPage":
|
|
2655
|
+
return {
|
|
2656
|
+
type: "web_search_call",
|
|
2657
|
+
id,
|
|
2658
|
+
status: "completed",
|
|
2659
|
+
action: {
|
|
2660
|
+
type: "find_in_page",
|
|
2661
|
+
url: action.url,
|
|
2662
|
+
pattern: action.pattern
|
|
2663
|
+
}
|
|
2664
|
+
};
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2559
2667
|
function getPromptCacheBreakpoint2(providerOptions) {
|
|
2560
2668
|
var _a2;
|
|
2561
2669
|
return (_a2 = providerOptions == null ? void 0 : providerOptions.openai) == null ? void 0 : _a2.promptCacheBreakpoint;
|
|
@@ -2572,21 +2680,22 @@ async function convertToOpenAIResponsesInput({
|
|
|
2572
2680
|
fileIdPrefixes,
|
|
2573
2681
|
store,
|
|
2574
2682
|
configurationUpdateUnsupportedReason,
|
|
2575
|
-
hasLocalShellTool = false
|
|
2683
|
+
hasLocalShellTool = false,
|
|
2684
|
+
webSearchToolName
|
|
2576
2685
|
}) {
|
|
2577
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
2686
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
2578
2687
|
let input = [];
|
|
2579
2688
|
const warnings = [];
|
|
2580
2689
|
for (const { role, content, providerOptions } of prompt) {
|
|
2581
2690
|
switch (role) {
|
|
2582
2691
|
case "system": {
|
|
2583
|
-
let options = await (0,
|
|
2692
|
+
let options = await (0, import_provider_utils23.parseProviderOptions)({
|
|
2584
2693
|
provider: providerOptionsName,
|
|
2585
2694
|
providerOptions,
|
|
2586
2695
|
schema: openaiResponsesSystemMessageOptionsSchema
|
|
2587
2696
|
});
|
|
2588
2697
|
if (options == null && providerOptionsName !== "openai") {
|
|
2589
|
-
options = await (0,
|
|
2698
|
+
options = await (0, import_provider_utils23.parseProviderOptions)({
|
|
2590
2699
|
provider: "openai",
|
|
2591
2700
|
providerOptions,
|
|
2592
2701
|
schema: openaiResponsesSystemMessageOptionsSchema
|
|
@@ -2682,7 +2791,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2682
2791
|
return {
|
|
2683
2792
|
type: "input_image",
|
|
2684
2793
|
...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2685
|
-
image_url: `data:${mediaType};base64,${(0,
|
|
2794
|
+
image_url: `data:${mediaType};base64,${(0, import_provider_utils23.convertToBase64)(part.data)}`
|
|
2686
2795
|
},
|
|
2687
2796
|
detail: (_b2 = (_a3 = part.providerOptions) == null ? void 0 : _a3.openai) == null ? void 0 : _b2.imageDetail,
|
|
2688
2797
|
...promptCacheBreakpoint != null && {
|
|
@@ -2703,7 +2812,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2703
2812
|
type: "input_file",
|
|
2704
2813
|
...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2705
2814
|
filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
|
|
2706
|
-
file_data: `data:application/pdf;base64,${(0,
|
|
2815
|
+
file_data: `data:application/pdf;base64,${(0, import_provider_utils23.convertToBase64)(part.data)}`
|
|
2707
2816
|
},
|
|
2708
2817
|
...promptCacheBreakpoint != null && {
|
|
2709
2818
|
prompt_cache_breakpoint: promptCacheBreakpoint
|
|
@@ -2753,7 +2862,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2753
2862
|
break;
|
|
2754
2863
|
}
|
|
2755
2864
|
if (hasLocalShellTool && part.toolName === "local_shell") {
|
|
2756
|
-
const parsedInput = await (0,
|
|
2865
|
+
const parsedInput = await (0, import_provider_utils23.validateTypes)({
|
|
2757
2866
|
value: part.input,
|
|
2758
2867
|
schema: localShellInputSchema
|
|
2759
2868
|
});
|
|
@@ -2784,6 +2893,21 @@ async function convertToOpenAIResponsesInput({
|
|
|
2784
2893
|
}
|
|
2785
2894
|
// assistant tool result parts are from provider-executed tools:
|
|
2786
2895
|
case "tool-result": {
|
|
2896
|
+
if (part.toolName === "web_search" || part.toolName === "web_search_preview" || part.toolName === webSearchToolName) {
|
|
2897
|
+
const itemId = (_k = (_j = (_i = part.providerOptions) == null ? void 0 : _i[providerOptionsName]) == null ? void 0 : _j.itemId) != null ? _k : part.toolCallId;
|
|
2898
|
+
if (store) {
|
|
2899
|
+
input.push({ type: "item_reference", id: itemId });
|
|
2900
|
+
break;
|
|
2901
|
+
}
|
|
2902
|
+
const webSearchCall = await convertWebSearchToolResultOutput({
|
|
2903
|
+
output: part.output,
|
|
2904
|
+
id: itemId
|
|
2905
|
+
});
|
|
2906
|
+
if (webSearchCall != null) {
|
|
2907
|
+
input.push(webSearchCall);
|
|
2908
|
+
break;
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2787
2911
|
if (store) {
|
|
2788
2912
|
input.push({ type: "item_reference", id: part.toolCallId });
|
|
2789
2913
|
} else {
|
|
@@ -2795,7 +2919,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2795
2919
|
break;
|
|
2796
2920
|
}
|
|
2797
2921
|
case "reasoning": {
|
|
2798
|
-
const providerOptions2 = await (0,
|
|
2922
|
+
const providerOptions2 = await (0, import_provider_utils23.parseProviderOptions)({
|
|
2799
2923
|
provider: "openai",
|
|
2800
2924
|
providerOptions: part.providerOptions,
|
|
2801
2925
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -2859,7 +2983,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2859
2983
|
part.providerOptions
|
|
2860
2984
|
);
|
|
2861
2985
|
if (hasLocalShellTool && part.toolName === "local_shell" && output.type === "json") {
|
|
2862
|
-
const parsedOutput = await (0,
|
|
2986
|
+
const parsedOutput = await (0, import_provider_utils23.validateTypes)({
|
|
2863
2987
|
value: output.value,
|
|
2864
2988
|
schema: localShellOutputSchema
|
|
2865
2989
|
});
|
|
@@ -2952,9 +3076,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
2952
3076
|
}
|
|
2953
3077
|
return { input, warnings };
|
|
2954
3078
|
}
|
|
2955
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
2956
|
-
itemId:
|
|
2957
|
-
reasoningEncryptedContent:
|
|
3079
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v416.z.object({
|
|
3080
|
+
itemId: import_v416.z.string().nullish(),
|
|
3081
|
+
reasoningEncryptedContent: import_v416.z.string().nullish()
|
|
2958
3082
|
});
|
|
2959
3083
|
|
|
2960
3084
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -2976,288 +3100,288 @@ function mapOpenAIResponseFinishReason({
|
|
|
2976
3100
|
}
|
|
2977
3101
|
|
|
2978
3102
|
// src/responses/openai-responses-api.ts
|
|
2979
|
-
var
|
|
2980
|
-
var
|
|
2981
|
-
var openaiResponsesChunkSchema = (0,
|
|
2982
|
-
() => (0,
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
type:
|
|
2986
|
-
item_id:
|
|
2987
|
-
delta:
|
|
2988
|
-
logprobs:
|
|
2989
|
-
|
|
2990
|
-
token:
|
|
2991
|
-
logprob:
|
|
2992
|
-
top_logprobs:
|
|
2993
|
-
|
|
2994
|
-
token:
|
|
2995
|
-
logprob:
|
|
3103
|
+
var import_provider_utils24 = require("@ai-sdk/provider-utils");
|
|
3104
|
+
var import_v417 = require("zod/v4");
|
|
3105
|
+
var openaiResponsesChunkSchema = (0, import_provider_utils24.lazyValidator)(
|
|
3106
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
3107
|
+
import_v417.z.union([
|
|
3108
|
+
import_v417.z.object({
|
|
3109
|
+
type: import_v417.z.literal("response.output_text.delta"),
|
|
3110
|
+
item_id: import_v417.z.string(),
|
|
3111
|
+
delta: import_v417.z.string(),
|
|
3112
|
+
logprobs: import_v417.z.array(
|
|
3113
|
+
import_v417.z.object({
|
|
3114
|
+
token: import_v417.z.string(),
|
|
3115
|
+
logprob: import_v417.z.number(),
|
|
3116
|
+
top_logprobs: import_v417.z.array(
|
|
3117
|
+
import_v417.z.object({
|
|
3118
|
+
token: import_v417.z.string(),
|
|
3119
|
+
logprob: import_v417.z.number()
|
|
2996
3120
|
})
|
|
2997
3121
|
)
|
|
2998
3122
|
})
|
|
2999
3123
|
).nullish()
|
|
3000
3124
|
}),
|
|
3001
|
-
|
|
3002
|
-
type:
|
|
3003
|
-
response:
|
|
3004
|
-
incomplete_details:
|
|
3005
|
-
usage:
|
|
3006
|
-
input_tokens:
|
|
3007
|
-
input_tokens_details:
|
|
3008
|
-
cached_tokens:
|
|
3009
|
-
cache_write_tokens:
|
|
3010
|
-
orchestration_input_tokens:
|
|
3011
|
-
orchestration_input_cached_tokens:
|
|
3125
|
+
import_v417.z.object({
|
|
3126
|
+
type: import_v417.z.enum(["response.completed", "response.incomplete"]),
|
|
3127
|
+
response: import_v417.z.object({
|
|
3128
|
+
incomplete_details: import_v417.z.object({ reason: import_v417.z.string() }).nullish(),
|
|
3129
|
+
usage: import_v417.z.object({
|
|
3130
|
+
input_tokens: import_v417.z.number(),
|
|
3131
|
+
input_tokens_details: import_v417.z.object({
|
|
3132
|
+
cached_tokens: import_v417.z.number().nullish(),
|
|
3133
|
+
cache_write_tokens: import_v417.z.number().nullish(),
|
|
3134
|
+
orchestration_input_tokens: import_v417.z.number().nullish(),
|
|
3135
|
+
orchestration_input_cached_tokens: import_v417.z.number().nullish()
|
|
3012
3136
|
}).nullish(),
|
|
3013
|
-
output_tokens:
|
|
3014
|
-
output_tokens_details:
|
|
3015
|
-
reasoning_tokens:
|
|
3016
|
-
orchestration_output_tokens:
|
|
3137
|
+
output_tokens: import_v417.z.number(),
|
|
3138
|
+
output_tokens_details: import_v417.z.object({
|
|
3139
|
+
reasoning_tokens: import_v417.z.number().nullish(),
|
|
3140
|
+
orchestration_output_tokens: import_v417.z.number().nullish()
|
|
3017
3141
|
}).nullish()
|
|
3018
3142
|
}),
|
|
3019
|
-
reasoning:
|
|
3020
|
-
context:
|
|
3143
|
+
reasoning: import_v417.z.object({
|
|
3144
|
+
context: import_v417.z.string().nullish()
|
|
3021
3145
|
}).nullish(),
|
|
3022
|
-
service_tier:
|
|
3146
|
+
service_tier: import_v417.z.string().nullish()
|
|
3023
3147
|
})
|
|
3024
3148
|
}),
|
|
3025
|
-
|
|
3026
|
-
type:
|
|
3027
|
-
response:
|
|
3028
|
-
id:
|
|
3029
|
-
created_at:
|
|
3030
|
-
model:
|
|
3031
|
-
service_tier:
|
|
3149
|
+
import_v417.z.object({
|
|
3150
|
+
type: import_v417.z.literal("response.created"),
|
|
3151
|
+
response: import_v417.z.object({
|
|
3152
|
+
id: import_v417.z.string(),
|
|
3153
|
+
created_at: import_v417.z.number(),
|
|
3154
|
+
model: import_v417.z.string(),
|
|
3155
|
+
service_tier: import_v417.z.string().nullish()
|
|
3032
3156
|
})
|
|
3033
3157
|
}),
|
|
3034
|
-
|
|
3035
|
-
type:
|
|
3036
|
-
output_index:
|
|
3037
|
-
item:
|
|
3038
|
-
|
|
3039
|
-
type:
|
|
3040
|
-
id:
|
|
3041
|
-
phase:
|
|
3158
|
+
import_v417.z.object({
|
|
3159
|
+
type: import_v417.z.literal("response.output_item.added"),
|
|
3160
|
+
output_index: import_v417.z.number(),
|
|
3161
|
+
item: import_v417.z.discriminatedUnion("type", [
|
|
3162
|
+
import_v417.z.object({
|
|
3163
|
+
type: import_v417.z.literal("message"),
|
|
3164
|
+
id: import_v417.z.string(),
|
|
3165
|
+
phase: import_v417.z.enum(["commentary", "final_answer"]).nullish()
|
|
3042
3166
|
}),
|
|
3043
|
-
|
|
3044
|
-
type:
|
|
3045
|
-
id:
|
|
3046
|
-
encrypted_content:
|
|
3167
|
+
import_v417.z.object({
|
|
3168
|
+
type: import_v417.z.literal("reasoning"),
|
|
3169
|
+
id: import_v417.z.string(),
|
|
3170
|
+
encrypted_content: import_v417.z.string().nullish()
|
|
3047
3171
|
}),
|
|
3048
|
-
|
|
3049
|
-
type:
|
|
3050
|
-
id:
|
|
3051
|
-
call_id:
|
|
3052
|
-
name:
|
|
3053
|
-
arguments:
|
|
3054
|
-
async:
|
|
3172
|
+
import_v417.z.object({
|
|
3173
|
+
type: import_v417.z.literal("function_call"),
|
|
3174
|
+
id: import_v417.z.string(),
|
|
3175
|
+
call_id: import_v417.z.string(),
|
|
3176
|
+
name: import_v417.z.string(),
|
|
3177
|
+
arguments: import_v417.z.string(),
|
|
3178
|
+
async: import_v417.z.boolean().nullish()
|
|
3055
3179
|
}),
|
|
3056
|
-
|
|
3057
|
-
type:
|
|
3058
|
-
id:
|
|
3059
|
-
status:
|
|
3180
|
+
import_v417.z.object({
|
|
3181
|
+
type: import_v417.z.literal("web_search_call"),
|
|
3182
|
+
id: import_v417.z.string(),
|
|
3183
|
+
status: import_v417.z.string()
|
|
3060
3184
|
}),
|
|
3061
|
-
|
|
3062
|
-
type:
|
|
3063
|
-
id:
|
|
3064
|
-
status:
|
|
3185
|
+
import_v417.z.object({
|
|
3186
|
+
type: import_v417.z.literal("computer_call"),
|
|
3187
|
+
id: import_v417.z.string(),
|
|
3188
|
+
status: import_v417.z.string()
|
|
3065
3189
|
}),
|
|
3066
|
-
|
|
3067
|
-
type:
|
|
3068
|
-
id:
|
|
3190
|
+
import_v417.z.object({
|
|
3191
|
+
type: import_v417.z.literal("file_search_call"),
|
|
3192
|
+
id: import_v417.z.string()
|
|
3069
3193
|
}),
|
|
3070
|
-
|
|
3071
|
-
type:
|
|
3072
|
-
id:
|
|
3194
|
+
import_v417.z.object({
|
|
3195
|
+
type: import_v417.z.literal("image_generation_call"),
|
|
3196
|
+
id: import_v417.z.string()
|
|
3073
3197
|
}),
|
|
3074
|
-
|
|
3075
|
-
type:
|
|
3076
|
-
id:
|
|
3077
|
-
container_id:
|
|
3078
|
-
code:
|
|
3079
|
-
outputs:
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3198
|
+
import_v417.z.object({
|
|
3199
|
+
type: import_v417.z.literal("code_interpreter_call"),
|
|
3200
|
+
id: import_v417.z.string(),
|
|
3201
|
+
container_id: import_v417.z.string(),
|
|
3202
|
+
code: import_v417.z.string().nullable(),
|
|
3203
|
+
outputs: import_v417.z.array(
|
|
3204
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3205
|
+
import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
|
|
3206
|
+
import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
|
|
3083
3207
|
])
|
|
3084
3208
|
).nullable(),
|
|
3085
|
-
status:
|
|
3209
|
+
status: import_v417.z.string()
|
|
3086
3210
|
})
|
|
3087
3211
|
])
|
|
3088
3212
|
}),
|
|
3089
|
-
|
|
3090
|
-
type:
|
|
3091
|
-
output_index:
|
|
3092
|
-
item:
|
|
3093
|
-
|
|
3094
|
-
type:
|
|
3095
|
-
id:
|
|
3096
|
-
phase:
|
|
3213
|
+
import_v417.z.object({
|
|
3214
|
+
type: import_v417.z.literal("response.output_item.done"),
|
|
3215
|
+
output_index: import_v417.z.number(),
|
|
3216
|
+
item: import_v417.z.discriminatedUnion("type", [
|
|
3217
|
+
import_v417.z.object({
|
|
3218
|
+
type: import_v417.z.literal("message"),
|
|
3219
|
+
id: import_v417.z.string(),
|
|
3220
|
+
phase: import_v417.z.enum(["commentary", "final_answer"]).nullish()
|
|
3097
3221
|
}),
|
|
3098
|
-
|
|
3099
|
-
type:
|
|
3100
|
-
id:
|
|
3101
|
-
encrypted_content:
|
|
3222
|
+
import_v417.z.object({
|
|
3223
|
+
type: import_v417.z.literal("reasoning"),
|
|
3224
|
+
id: import_v417.z.string(),
|
|
3225
|
+
encrypted_content: import_v417.z.string().nullish()
|
|
3102
3226
|
}),
|
|
3103
|
-
|
|
3104
|
-
type:
|
|
3105
|
-
id:
|
|
3106
|
-
call_id:
|
|
3107
|
-
name:
|
|
3108
|
-
arguments:
|
|
3109
|
-
async:
|
|
3110
|
-
status:
|
|
3227
|
+
import_v417.z.object({
|
|
3228
|
+
type: import_v417.z.literal("function_call"),
|
|
3229
|
+
id: import_v417.z.string(),
|
|
3230
|
+
call_id: import_v417.z.string(),
|
|
3231
|
+
name: import_v417.z.string(),
|
|
3232
|
+
arguments: import_v417.z.string(),
|
|
3233
|
+
async: import_v417.z.boolean().nullish(),
|
|
3234
|
+
status: import_v417.z.enum(["in_progress", "completed", "incomplete"])
|
|
3111
3235
|
}),
|
|
3112
|
-
|
|
3113
|
-
type:
|
|
3114
|
-
id:
|
|
3115
|
-
code:
|
|
3116
|
-
container_id:
|
|
3117
|
-
outputs:
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3236
|
+
import_v417.z.object({
|
|
3237
|
+
type: import_v417.z.literal("code_interpreter_call"),
|
|
3238
|
+
id: import_v417.z.string(),
|
|
3239
|
+
code: import_v417.z.string().nullable(),
|
|
3240
|
+
container_id: import_v417.z.string(),
|
|
3241
|
+
outputs: import_v417.z.array(
|
|
3242
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3243
|
+
import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
|
|
3244
|
+
import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
|
|
3121
3245
|
])
|
|
3122
3246
|
).nullable()
|
|
3123
3247
|
}),
|
|
3124
|
-
|
|
3125
|
-
type:
|
|
3126
|
-
id:
|
|
3127
|
-
result:
|
|
3248
|
+
import_v417.z.object({
|
|
3249
|
+
type: import_v417.z.literal("image_generation_call"),
|
|
3250
|
+
id: import_v417.z.string(),
|
|
3251
|
+
result: import_v417.z.string()
|
|
3128
3252
|
}),
|
|
3129
|
-
|
|
3130
|
-
type:
|
|
3131
|
-
id:
|
|
3132
|
-
status:
|
|
3133
|
-
action:
|
|
3134
|
-
|
|
3135
|
-
type:
|
|
3136
|
-
query:
|
|
3137
|
-
sources:
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3253
|
+
import_v417.z.object({
|
|
3254
|
+
type: import_v417.z.literal("web_search_call"),
|
|
3255
|
+
id: import_v417.z.string(),
|
|
3256
|
+
status: import_v417.z.string(),
|
|
3257
|
+
action: import_v417.z.discriminatedUnion("type", [
|
|
3258
|
+
import_v417.z.object({
|
|
3259
|
+
type: import_v417.z.literal("search"),
|
|
3260
|
+
query: import_v417.z.string().nullish(),
|
|
3261
|
+
sources: import_v417.z.array(
|
|
3262
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3263
|
+
import_v417.z.object({ type: import_v417.z.literal("url"), url: import_v417.z.string() }),
|
|
3264
|
+
import_v417.z.object({ type: import_v417.z.literal("api"), name: import_v417.z.string() })
|
|
3141
3265
|
])
|
|
3142
3266
|
).nullish()
|
|
3143
3267
|
}),
|
|
3144
|
-
|
|
3145
|
-
type:
|
|
3146
|
-
url:
|
|
3268
|
+
import_v417.z.object({
|
|
3269
|
+
type: import_v417.z.literal("open_page"),
|
|
3270
|
+
url: import_v417.z.string().nullish()
|
|
3147
3271
|
}),
|
|
3148
|
-
|
|
3149
|
-
type:
|
|
3150
|
-
url:
|
|
3151
|
-
pattern:
|
|
3272
|
+
import_v417.z.object({
|
|
3273
|
+
type: import_v417.z.literal("find_in_page"),
|
|
3274
|
+
url: import_v417.z.string().nullish(),
|
|
3275
|
+
pattern: import_v417.z.string().nullish()
|
|
3152
3276
|
})
|
|
3153
3277
|
]).nullish()
|
|
3154
3278
|
}),
|
|
3155
|
-
|
|
3156
|
-
type:
|
|
3157
|
-
id:
|
|
3158
|
-
queries:
|
|
3159
|
-
results:
|
|
3160
|
-
|
|
3161
|
-
attributes:
|
|
3162
|
-
file_id:
|
|
3163
|
-
filename:
|
|
3164
|
-
score:
|
|
3165
|
-
text:
|
|
3279
|
+
import_v417.z.object({
|
|
3280
|
+
type: import_v417.z.literal("file_search_call"),
|
|
3281
|
+
id: import_v417.z.string(),
|
|
3282
|
+
queries: import_v417.z.array(import_v417.z.string()),
|
|
3283
|
+
results: import_v417.z.array(
|
|
3284
|
+
import_v417.z.object({
|
|
3285
|
+
attributes: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()),
|
|
3286
|
+
file_id: import_v417.z.string(),
|
|
3287
|
+
filename: import_v417.z.string(),
|
|
3288
|
+
score: import_v417.z.number(),
|
|
3289
|
+
text: import_v417.z.string()
|
|
3166
3290
|
})
|
|
3167
3291
|
).nullish()
|
|
3168
3292
|
}),
|
|
3169
|
-
|
|
3170
|
-
type:
|
|
3171
|
-
id:
|
|
3172
|
-
call_id:
|
|
3173
|
-
action:
|
|
3174
|
-
type:
|
|
3175
|
-
command:
|
|
3176
|
-
timeout_ms:
|
|
3177
|
-
user:
|
|
3178
|
-
working_directory:
|
|
3179
|
-
env:
|
|
3293
|
+
import_v417.z.object({
|
|
3294
|
+
type: import_v417.z.literal("local_shell_call"),
|
|
3295
|
+
id: import_v417.z.string(),
|
|
3296
|
+
call_id: import_v417.z.string(),
|
|
3297
|
+
action: import_v417.z.object({
|
|
3298
|
+
type: import_v417.z.literal("exec"),
|
|
3299
|
+
command: import_v417.z.array(import_v417.z.string()),
|
|
3300
|
+
timeout_ms: import_v417.z.number().optional(),
|
|
3301
|
+
user: import_v417.z.string().optional(),
|
|
3302
|
+
working_directory: import_v417.z.string().optional(),
|
|
3303
|
+
env: import_v417.z.record(import_v417.z.string(), import_v417.z.string()).optional()
|
|
3180
3304
|
})
|
|
3181
3305
|
}),
|
|
3182
|
-
|
|
3183
|
-
type:
|
|
3184
|
-
id:
|
|
3185
|
-
status:
|
|
3306
|
+
import_v417.z.object({
|
|
3307
|
+
type: import_v417.z.literal("computer_call"),
|
|
3308
|
+
id: import_v417.z.string(),
|
|
3309
|
+
status: import_v417.z.literal("completed")
|
|
3186
3310
|
})
|
|
3187
3311
|
])
|
|
3188
3312
|
}),
|
|
3189
|
-
|
|
3190
|
-
type:
|
|
3191
|
-
item_id:
|
|
3192
|
-
output_index:
|
|
3193
|
-
delta:
|
|
3313
|
+
import_v417.z.object({
|
|
3314
|
+
type: import_v417.z.literal("response.function_call_arguments.delta"),
|
|
3315
|
+
item_id: import_v417.z.string(),
|
|
3316
|
+
output_index: import_v417.z.number(),
|
|
3317
|
+
delta: import_v417.z.string()
|
|
3194
3318
|
}),
|
|
3195
|
-
|
|
3196
|
-
type:
|
|
3197
|
-
item_id:
|
|
3198
|
-
output_index:
|
|
3199
|
-
partial_image_b64:
|
|
3319
|
+
import_v417.z.object({
|
|
3320
|
+
type: import_v417.z.literal("response.image_generation_call.partial_image"),
|
|
3321
|
+
item_id: import_v417.z.string(),
|
|
3322
|
+
output_index: import_v417.z.number(),
|
|
3323
|
+
partial_image_b64: import_v417.z.string()
|
|
3200
3324
|
}),
|
|
3201
|
-
|
|
3202
|
-
type:
|
|
3203
|
-
item_id:
|
|
3204
|
-
output_index:
|
|
3205
|
-
delta:
|
|
3325
|
+
import_v417.z.object({
|
|
3326
|
+
type: import_v417.z.literal("response.code_interpreter_call_code.delta"),
|
|
3327
|
+
item_id: import_v417.z.string(),
|
|
3328
|
+
output_index: import_v417.z.number(),
|
|
3329
|
+
delta: import_v417.z.string()
|
|
3206
3330
|
}),
|
|
3207
|
-
|
|
3208
|
-
type:
|
|
3209
|
-
item_id:
|
|
3210
|
-
output_index:
|
|
3211
|
-
code:
|
|
3331
|
+
import_v417.z.object({
|
|
3332
|
+
type: import_v417.z.literal("response.code_interpreter_call_code.done"),
|
|
3333
|
+
item_id: import_v417.z.string(),
|
|
3334
|
+
output_index: import_v417.z.number(),
|
|
3335
|
+
code: import_v417.z.string()
|
|
3212
3336
|
}),
|
|
3213
|
-
|
|
3214
|
-
type:
|
|
3215
|
-
annotation:
|
|
3216
|
-
|
|
3217
|
-
type:
|
|
3218
|
-
start_index:
|
|
3219
|
-
end_index:
|
|
3220
|
-
url:
|
|
3221
|
-
title:
|
|
3337
|
+
import_v417.z.object({
|
|
3338
|
+
type: import_v417.z.literal("response.output_text.annotation.added"),
|
|
3339
|
+
annotation: import_v417.z.discriminatedUnion("type", [
|
|
3340
|
+
import_v417.z.object({
|
|
3341
|
+
type: import_v417.z.literal("url_citation"),
|
|
3342
|
+
start_index: import_v417.z.number(),
|
|
3343
|
+
end_index: import_v417.z.number(),
|
|
3344
|
+
url: import_v417.z.string(),
|
|
3345
|
+
title: import_v417.z.string()
|
|
3222
3346
|
}),
|
|
3223
|
-
|
|
3224
|
-
type:
|
|
3225
|
-
file_id:
|
|
3226
|
-
filename:
|
|
3227
|
-
index:
|
|
3228
|
-
start_index:
|
|
3229
|
-
end_index:
|
|
3230
|
-
quote:
|
|
3347
|
+
import_v417.z.object({
|
|
3348
|
+
type: import_v417.z.literal("file_citation"),
|
|
3349
|
+
file_id: import_v417.z.string(),
|
|
3350
|
+
filename: import_v417.z.string().nullish(),
|
|
3351
|
+
index: import_v417.z.number().nullish(),
|
|
3352
|
+
start_index: import_v417.z.number().nullish(),
|
|
3353
|
+
end_index: import_v417.z.number().nullish(),
|
|
3354
|
+
quote: import_v417.z.string().nullish()
|
|
3231
3355
|
})
|
|
3232
3356
|
])
|
|
3233
3357
|
}),
|
|
3234
|
-
|
|
3235
|
-
type:
|
|
3236
|
-
item_id:
|
|
3237
|
-
summary_index:
|
|
3358
|
+
import_v417.z.object({
|
|
3359
|
+
type: import_v417.z.literal("response.reasoning_summary_part.added"),
|
|
3360
|
+
item_id: import_v417.z.string(),
|
|
3361
|
+
summary_index: import_v417.z.number()
|
|
3238
3362
|
}),
|
|
3239
|
-
|
|
3240
|
-
type:
|
|
3241
|
-
item_id:
|
|
3242
|
-
summary_index:
|
|
3243
|
-
delta:
|
|
3363
|
+
import_v417.z.object({
|
|
3364
|
+
type: import_v417.z.literal("response.reasoning_summary_text.delta"),
|
|
3365
|
+
item_id: import_v417.z.string(),
|
|
3366
|
+
summary_index: import_v417.z.number(),
|
|
3367
|
+
delta: import_v417.z.string()
|
|
3244
3368
|
}),
|
|
3245
|
-
|
|
3246
|
-
type:
|
|
3247
|
-
item_id:
|
|
3248
|
-
summary_index:
|
|
3369
|
+
import_v417.z.object({
|
|
3370
|
+
type: import_v417.z.literal("response.reasoning_summary_part.done"),
|
|
3371
|
+
item_id: import_v417.z.string(),
|
|
3372
|
+
summary_index: import_v417.z.number()
|
|
3249
3373
|
}),
|
|
3250
|
-
|
|
3251
|
-
type:
|
|
3252
|
-
sequence_number:
|
|
3253
|
-
error:
|
|
3254
|
-
type:
|
|
3255
|
-
code:
|
|
3256
|
-
message:
|
|
3257
|
-
param:
|
|
3374
|
+
import_v417.z.object({
|
|
3375
|
+
type: import_v417.z.literal("error"),
|
|
3376
|
+
sequence_number: import_v417.z.number(),
|
|
3377
|
+
error: import_v417.z.object({
|
|
3378
|
+
type: import_v417.z.string(),
|
|
3379
|
+
code: import_v417.z.string(),
|
|
3380
|
+
message: import_v417.z.string(),
|
|
3381
|
+
param: import_v417.z.string().nullish()
|
|
3258
3382
|
})
|
|
3259
3383
|
}),
|
|
3260
|
-
|
|
3384
|
+
import_v417.z.object({ type: import_v417.z.string() }).loose().transform((value) => ({
|
|
3261
3385
|
type: "unknown_chunk",
|
|
3262
3386
|
message: value.type
|
|
3263
3387
|
}))
|
|
@@ -3265,197 +3389,197 @@ var openaiResponsesChunkSchema = (0, import_provider_utils23.lazyValidator)(
|
|
|
3265
3389
|
])
|
|
3266
3390
|
)
|
|
3267
3391
|
);
|
|
3268
|
-
var openaiResponsesResponseSchema = (0,
|
|
3269
|
-
() => (0,
|
|
3270
|
-
|
|
3271
|
-
id:
|
|
3272
|
-
created_at:
|
|
3273
|
-
error:
|
|
3274
|
-
message:
|
|
3275
|
-
type:
|
|
3276
|
-
param:
|
|
3277
|
-
code:
|
|
3392
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils24.lazyValidator)(
|
|
3393
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
3394
|
+
import_v417.z.object({
|
|
3395
|
+
id: import_v417.z.string().optional(),
|
|
3396
|
+
created_at: import_v417.z.number().optional(),
|
|
3397
|
+
error: import_v417.z.object({
|
|
3398
|
+
message: import_v417.z.string(),
|
|
3399
|
+
type: import_v417.z.string(),
|
|
3400
|
+
param: import_v417.z.string().nullish(),
|
|
3401
|
+
code: import_v417.z.string()
|
|
3278
3402
|
}).nullish(),
|
|
3279
|
-
model:
|
|
3280
|
-
output:
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
type:
|
|
3284
|
-
role:
|
|
3285
|
-
id:
|
|
3286
|
-
phase:
|
|
3287
|
-
content:
|
|
3288
|
-
|
|
3289
|
-
type:
|
|
3290
|
-
text:
|
|
3291
|
-
logprobs:
|
|
3292
|
-
|
|
3293
|
-
token:
|
|
3294
|
-
logprob:
|
|
3295
|
-
top_logprobs:
|
|
3296
|
-
|
|
3297
|
-
token:
|
|
3298
|
-
logprob:
|
|
3403
|
+
model: import_v417.z.string().optional(),
|
|
3404
|
+
output: import_v417.z.array(
|
|
3405
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3406
|
+
import_v417.z.object({
|
|
3407
|
+
type: import_v417.z.literal("message"),
|
|
3408
|
+
role: import_v417.z.literal("assistant"),
|
|
3409
|
+
id: import_v417.z.string(),
|
|
3410
|
+
phase: import_v417.z.enum(["commentary", "final_answer"]).nullish(),
|
|
3411
|
+
content: import_v417.z.array(
|
|
3412
|
+
import_v417.z.object({
|
|
3413
|
+
type: import_v417.z.literal("output_text"),
|
|
3414
|
+
text: import_v417.z.string(),
|
|
3415
|
+
logprobs: import_v417.z.array(
|
|
3416
|
+
import_v417.z.object({
|
|
3417
|
+
token: import_v417.z.string(),
|
|
3418
|
+
logprob: import_v417.z.number(),
|
|
3419
|
+
top_logprobs: import_v417.z.array(
|
|
3420
|
+
import_v417.z.object({
|
|
3421
|
+
token: import_v417.z.string(),
|
|
3422
|
+
logprob: import_v417.z.number()
|
|
3299
3423
|
})
|
|
3300
3424
|
)
|
|
3301
3425
|
})
|
|
3302
3426
|
).nullish(),
|
|
3303
|
-
annotations:
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
type:
|
|
3307
|
-
start_index:
|
|
3308
|
-
end_index:
|
|
3309
|
-
url:
|
|
3310
|
-
title:
|
|
3427
|
+
annotations: import_v417.z.array(
|
|
3428
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3429
|
+
import_v417.z.object({
|
|
3430
|
+
type: import_v417.z.literal("url_citation"),
|
|
3431
|
+
start_index: import_v417.z.number(),
|
|
3432
|
+
end_index: import_v417.z.number(),
|
|
3433
|
+
url: import_v417.z.string(),
|
|
3434
|
+
title: import_v417.z.string()
|
|
3311
3435
|
}),
|
|
3312
|
-
|
|
3313
|
-
type:
|
|
3314
|
-
file_id:
|
|
3315
|
-
filename:
|
|
3316
|
-
index:
|
|
3317
|
-
start_index:
|
|
3318
|
-
end_index:
|
|
3319
|
-
quote:
|
|
3436
|
+
import_v417.z.object({
|
|
3437
|
+
type: import_v417.z.literal("file_citation"),
|
|
3438
|
+
file_id: import_v417.z.string(),
|
|
3439
|
+
filename: import_v417.z.string().nullish(),
|
|
3440
|
+
index: import_v417.z.number().nullish(),
|
|
3441
|
+
start_index: import_v417.z.number().nullish(),
|
|
3442
|
+
end_index: import_v417.z.number().nullish(),
|
|
3443
|
+
quote: import_v417.z.string().nullish()
|
|
3320
3444
|
}),
|
|
3321
|
-
|
|
3322
|
-
type:
|
|
3323
|
-
container_id:
|
|
3324
|
-
file_id:
|
|
3325
|
-
filename:
|
|
3326
|
-
start_index:
|
|
3327
|
-
end_index:
|
|
3328
|
-
index:
|
|
3445
|
+
import_v417.z.object({
|
|
3446
|
+
type: import_v417.z.literal("container_file_citation"),
|
|
3447
|
+
container_id: import_v417.z.string(),
|
|
3448
|
+
file_id: import_v417.z.string(),
|
|
3449
|
+
filename: import_v417.z.string().nullish(),
|
|
3450
|
+
start_index: import_v417.z.number().nullish(),
|
|
3451
|
+
end_index: import_v417.z.number().nullish(),
|
|
3452
|
+
index: import_v417.z.number().nullish()
|
|
3329
3453
|
}),
|
|
3330
|
-
|
|
3331
|
-
type:
|
|
3332
|
-
file_id:
|
|
3333
|
-
index:
|
|
3454
|
+
import_v417.z.object({
|
|
3455
|
+
type: import_v417.z.literal("file_path"),
|
|
3456
|
+
file_id: import_v417.z.string(),
|
|
3457
|
+
index: import_v417.z.number().nullish()
|
|
3334
3458
|
})
|
|
3335
3459
|
])
|
|
3336
3460
|
)
|
|
3337
3461
|
})
|
|
3338
3462
|
)
|
|
3339
3463
|
}),
|
|
3340
|
-
|
|
3341
|
-
type:
|
|
3342
|
-
id:
|
|
3343
|
-
status:
|
|
3344
|
-
action:
|
|
3345
|
-
|
|
3346
|
-
type:
|
|
3347
|
-
query:
|
|
3348
|
-
sources:
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
type:
|
|
3353
|
-
name:
|
|
3464
|
+
import_v417.z.object({
|
|
3465
|
+
type: import_v417.z.literal("web_search_call"),
|
|
3466
|
+
id: import_v417.z.string(),
|
|
3467
|
+
status: import_v417.z.string(),
|
|
3468
|
+
action: import_v417.z.discriminatedUnion("type", [
|
|
3469
|
+
import_v417.z.object({
|
|
3470
|
+
type: import_v417.z.literal("search"),
|
|
3471
|
+
query: import_v417.z.string().nullish(),
|
|
3472
|
+
sources: import_v417.z.array(
|
|
3473
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3474
|
+
import_v417.z.object({ type: import_v417.z.literal("url"), url: import_v417.z.string() }),
|
|
3475
|
+
import_v417.z.object({
|
|
3476
|
+
type: import_v417.z.literal("api"),
|
|
3477
|
+
name: import_v417.z.string()
|
|
3354
3478
|
})
|
|
3355
3479
|
])
|
|
3356
3480
|
).nullish()
|
|
3357
3481
|
}),
|
|
3358
|
-
|
|
3359
|
-
type:
|
|
3360
|
-
url:
|
|
3482
|
+
import_v417.z.object({
|
|
3483
|
+
type: import_v417.z.literal("open_page"),
|
|
3484
|
+
url: import_v417.z.string().nullish()
|
|
3361
3485
|
}),
|
|
3362
|
-
|
|
3363
|
-
type:
|
|
3364
|
-
url:
|
|
3365
|
-
pattern:
|
|
3486
|
+
import_v417.z.object({
|
|
3487
|
+
type: import_v417.z.literal("find_in_page"),
|
|
3488
|
+
url: import_v417.z.string().nullish(),
|
|
3489
|
+
pattern: import_v417.z.string().nullish()
|
|
3366
3490
|
})
|
|
3367
3491
|
]).nullish()
|
|
3368
3492
|
}),
|
|
3369
|
-
|
|
3370
|
-
type:
|
|
3371
|
-
id:
|
|
3372
|
-
queries:
|
|
3373
|
-
results:
|
|
3374
|
-
|
|
3375
|
-
attributes:
|
|
3376
|
-
|
|
3377
|
-
|
|
3493
|
+
import_v417.z.object({
|
|
3494
|
+
type: import_v417.z.literal("file_search_call"),
|
|
3495
|
+
id: import_v417.z.string(),
|
|
3496
|
+
queries: import_v417.z.array(import_v417.z.string()),
|
|
3497
|
+
results: import_v417.z.array(
|
|
3498
|
+
import_v417.z.object({
|
|
3499
|
+
attributes: import_v417.z.record(
|
|
3500
|
+
import_v417.z.string(),
|
|
3501
|
+
import_v417.z.union([import_v417.z.string(), import_v417.z.number(), import_v417.z.boolean()])
|
|
3378
3502
|
),
|
|
3379
|
-
file_id:
|
|
3380
|
-
filename:
|
|
3381
|
-
score:
|
|
3382
|
-
text:
|
|
3503
|
+
file_id: import_v417.z.string(),
|
|
3504
|
+
filename: import_v417.z.string(),
|
|
3505
|
+
score: import_v417.z.number(),
|
|
3506
|
+
text: import_v417.z.string()
|
|
3383
3507
|
})
|
|
3384
3508
|
).nullish()
|
|
3385
3509
|
}),
|
|
3386
|
-
|
|
3387
|
-
type:
|
|
3388
|
-
id:
|
|
3389
|
-
code:
|
|
3390
|
-
container_id:
|
|
3391
|
-
outputs:
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3510
|
+
import_v417.z.object({
|
|
3511
|
+
type: import_v417.z.literal("code_interpreter_call"),
|
|
3512
|
+
id: import_v417.z.string(),
|
|
3513
|
+
code: import_v417.z.string().nullable(),
|
|
3514
|
+
container_id: import_v417.z.string(),
|
|
3515
|
+
outputs: import_v417.z.array(
|
|
3516
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3517
|
+
import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
|
|
3518
|
+
import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
|
|
3395
3519
|
])
|
|
3396
3520
|
).nullable()
|
|
3397
3521
|
}),
|
|
3398
|
-
|
|
3399
|
-
type:
|
|
3400
|
-
id:
|
|
3401
|
-
result:
|
|
3522
|
+
import_v417.z.object({
|
|
3523
|
+
type: import_v417.z.literal("image_generation_call"),
|
|
3524
|
+
id: import_v417.z.string(),
|
|
3525
|
+
result: import_v417.z.string()
|
|
3402
3526
|
}),
|
|
3403
|
-
|
|
3404
|
-
type:
|
|
3405
|
-
id:
|
|
3406
|
-
call_id:
|
|
3407
|
-
action:
|
|
3408
|
-
type:
|
|
3409
|
-
command:
|
|
3410
|
-
timeout_ms:
|
|
3411
|
-
user:
|
|
3412
|
-
working_directory:
|
|
3413
|
-
env:
|
|
3527
|
+
import_v417.z.object({
|
|
3528
|
+
type: import_v417.z.literal("local_shell_call"),
|
|
3529
|
+
id: import_v417.z.string(),
|
|
3530
|
+
call_id: import_v417.z.string(),
|
|
3531
|
+
action: import_v417.z.object({
|
|
3532
|
+
type: import_v417.z.literal("exec"),
|
|
3533
|
+
command: import_v417.z.array(import_v417.z.string()),
|
|
3534
|
+
timeout_ms: import_v417.z.number().optional(),
|
|
3535
|
+
user: import_v417.z.string().optional(),
|
|
3536
|
+
working_directory: import_v417.z.string().optional(),
|
|
3537
|
+
env: import_v417.z.record(import_v417.z.string(), import_v417.z.string()).optional()
|
|
3414
3538
|
})
|
|
3415
3539
|
}),
|
|
3416
|
-
|
|
3417
|
-
type:
|
|
3418
|
-
call_id:
|
|
3419
|
-
name:
|
|
3420
|
-
arguments:
|
|
3421
|
-
id:
|
|
3422
|
-
async:
|
|
3540
|
+
import_v417.z.object({
|
|
3541
|
+
type: import_v417.z.literal("function_call"),
|
|
3542
|
+
call_id: import_v417.z.string(),
|
|
3543
|
+
name: import_v417.z.string(),
|
|
3544
|
+
arguments: import_v417.z.string(),
|
|
3545
|
+
id: import_v417.z.string(),
|
|
3546
|
+
async: import_v417.z.boolean().nullish()
|
|
3423
3547
|
}),
|
|
3424
|
-
|
|
3425
|
-
type:
|
|
3426
|
-
id:
|
|
3427
|
-
status:
|
|
3548
|
+
import_v417.z.object({
|
|
3549
|
+
type: import_v417.z.literal("computer_call"),
|
|
3550
|
+
id: import_v417.z.string(),
|
|
3551
|
+
status: import_v417.z.string().optional()
|
|
3428
3552
|
}),
|
|
3429
|
-
|
|
3430
|
-
type:
|
|
3431
|
-
id:
|
|
3432
|
-
encrypted_content:
|
|
3433
|
-
summary:
|
|
3434
|
-
|
|
3435
|
-
type:
|
|
3436
|
-
text:
|
|
3553
|
+
import_v417.z.object({
|
|
3554
|
+
type: import_v417.z.literal("reasoning"),
|
|
3555
|
+
id: import_v417.z.string(),
|
|
3556
|
+
encrypted_content: import_v417.z.string().nullish(),
|
|
3557
|
+
summary: import_v417.z.array(
|
|
3558
|
+
import_v417.z.object({
|
|
3559
|
+
type: import_v417.z.literal("summary_text"),
|
|
3560
|
+
text: import_v417.z.string()
|
|
3437
3561
|
})
|
|
3438
3562
|
)
|
|
3439
3563
|
})
|
|
3440
3564
|
])
|
|
3441
3565
|
).optional(),
|
|
3442
|
-
service_tier:
|
|
3443
|
-
reasoning:
|
|
3444
|
-
context:
|
|
3566
|
+
service_tier: import_v417.z.string().nullish(),
|
|
3567
|
+
reasoning: import_v417.z.object({
|
|
3568
|
+
context: import_v417.z.string().nullish()
|
|
3445
3569
|
}).nullish(),
|
|
3446
|
-
incomplete_details:
|
|
3447
|
-
usage:
|
|
3448
|
-
input_tokens:
|
|
3449
|
-
input_tokens_details:
|
|
3450
|
-
cached_tokens:
|
|
3451
|
-
cache_write_tokens:
|
|
3452
|
-
orchestration_input_tokens:
|
|
3453
|
-
orchestration_input_cached_tokens:
|
|
3570
|
+
incomplete_details: import_v417.z.object({ reason: import_v417.z.string() }).nullish(),
|
|
3571
|
+
usage: import_v417.z.object({
|
|
3572
|
+
input_tokens: import_v417.z.number(),
|
|
3573
|
+
input_tokens_details: import_v417.z.object({
|
|
3574
|
+
cached_tokens: import_v417.z.number().nullish(),
|
|
3575
|
+
cache_write_tokens: import_v417.z.number().nullish(),
|
|
3576
|
+
orchestration_input_tokens: import_v417.z.number().nullish(),
|
|
3577
|
+
orchestration_input_cached_tokens: import_v417.z.number().nullish()
|
|
3454
3578
|
}).nullish(),
|
|
3455
|
-
output_tokens:
|
|
3456
|
-
output_tokens_details:
|
|
3457
|
-
reasoning_tokens:
|
|
3458
|
-
orchestration_output_tokens:
|
|
3579
|
+
output_tokens: import_v417.z.number(),
|
|
3580
|
+
output_tokens_details: import_v417.z.object({
|
|
3581
|
+
reasoning_tokens: import_v417.z.number().nullish(),
|
|
3582
|
+
orchestration_output_tokens: import_v417.z.number().nullish()
|
|
3459
3583
|
}).nullish()
|
|
3460
3584
|
}).optional()
|
|
3461
3585
|
})
|
|
@@ -3466,41 +3590,41 @@ var openaiResponsesResponseSchema = (0, import_provider_utils23.lazyValidator)(
|
|
|
3466
3590
|
var import_provider7 = require("@ai-sdk/provider");
|
|
3467
3591
|
|
|
3468
3592
|
// src/tool/code-interpreter.ts
|
|
3469
|
-
var
|
|
3470
|
-
var
|
|
3471
|
-
var codeInterpreterInputSchema = (0,
|
|
3472
|
-
() => (0,
|
|
3473
|
-
|
|
3474
|
-
code:
|
|
3475
|
-
containerId:
|
|
3593
|
+
var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
3594
|
+
var import_v418 = require("zod/v4");
|
|
3595
|
+
var codeInterpreterInputSchema = (0, import_provider_utils25.lazySchema)(
|
|
3596
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3597
|
+
import_v418.z.object({
|
|
3598
|
+
code: import_v418.z.string().nullish(),
|
|
3599
|
+
containerId: import_v418.z.string()
|
|
3476
3600
|
})
|
|
3477
3601
|
)
|
|
3478
3602
|
);
|
|
3479
|
-
var codeInterpreterOutputSchema = (0,
|
|
3480
|
-
() => (0,
|
|
3481
|
-
|
|
3482
|
-
outputs:
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3603
|
+
var codeInterpreterOutputSchema = (0, import_provider_utils25.lazySchema)(
|
|
3604
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3605
|
+
import_v418.z.object({
|
|
3606
|
+
outputs: import_v418.z.array(
|
|
3607
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3608
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3609
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3486
3610
|
])
|
|
3487
3611
|
).nullish()
|
|
3488
3612
|
})
|
|
3489
3613
|
)
|
|
3490
3614
|
);
|
|
3491
|
-
var codeInterpreterArgsSchema = (0,
|
|
3492
|
-
() => (0,
|
|
3493
|
-
|
|
3494
|
-
container:
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
fileIds:
|
|
3615
|
+
var codeInterpreterArgsSchema = (0, import_provider_utils25.lazySchema)(
|
|
3616
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3617
|
+
import_v418.z.object({
|
|
3618
|
+
container: import_v418.z.union([
|
|
3619
|
+
import_v418.z.string(),
|
|
3620
|
+
import_v418.z.object({
|
|
3621
|
+
fileIds: import_v418.z.array(import_v418.z.string()).optional()
|
|
3498
3622
|
})
|
|
3499
3623
|
]).optional()
|
|
3500
3624
|
})
|
|
3501
3625
|
)
|
|
3502
3626
|
);
|
|
3503
|
-
var codeInterpreterToolFactory = (0,
|
|
3627
|
+
var codeInterpreterToolFactory = (0, import_provider_utils25.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
3504
3628
|
id: "openai.code_interpreter",
|
|
3505
3629
|
name: "code_interpreter",
|
|
3506
3630
|
inputSchema: codeInterpreterInputSchema,
|
|
@@ -3511,112 +3635,54 @@ var codeInterpreter = (args = {}) => {
|
|
|
3511
3635
|
};
|
|
3512
3636
|
|
|
3513
3637
|
// src/tool/file-search.ts
|
|
3514
|
-
var
|
|
3515
|
-
var
|
|
3516
|
-
var comparisonFilterSchema =
|
|
3517
|
-
key:
|
|
3518
|
-
type:
|
|
3519
|
-
value:
|
|
3520
|
-
});
|
|
3521
|
-
var compoundFilterSchema = import_v418.z.object({
|
|
3522
|
-
type: import_v418.z.enum(["and", "or"]),
|
|
3523
|
-
filters: import_v418.z.array(
|
|
3524
|
-
import_v418.z.union([comparisonFilterSchema, import_v418.z.lazy(() => compoundFilterSchema)])
|
|
3525
|
-
)
|
|
3638
|
+
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
3639
|
+
var import_v419 = require("zod/v4");
|
|
3640
|
+
var comparisonFilterSchema = import_v419.z.object({
|
|
3641
|
+
key: import_v419.z.string(),
|
|
3642
|
+
type: import_v419.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
3643
|
+
value: import_v419.z.union([import_v419.z.string(), import_v419.z.number(), import_v419.z.boolean(), import_v419.z.array(import_v419.z.string())])
|
|
3526
3644
|
});
|
|
3527
|
-
var
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
maxNumResults: import_v418.z.number().optional(),
|
|
3532
|
-
ranking: import_v418.z.object({
|
|
3533
|
-
ranker: import_v418.z.string().optional(),
|
|
3534
|
-
scoreThreshold: import_v418.z.number().optional()
|
|
3535
|
-
}).optional(),
|
|
3536
|
-
filters: import_v418.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
3537
|
-
})
|
|
3538
|
-
)
|
|
3539
|
-
);
|
|
3540
|
-
var fileSearchOutputSchema = (0, import_provider_utils25.lazySchema)(
|
|
3541
|
-
() => (0, import_provider_utils25.zodSchema)(
|
|
3542
|
-
import_v418.z.object({
|
|
3543
|
-
queries: import_v418.z.array(import_v418.z.string()),
|
|
3544
|
-
results: import_v418.z.array(
|
|
3545
|
-
import_v418.z.object({
|
|
3546
|
-
attributes: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()),
|
|
3547
|
-
fileId: import_v418.z.string(),
|
|
3548
|
-
filename: import_v418.z.string(),
|
|
3549
|
-
score: import_v418.z.number(),
|
|
3550
|
-
text: import_v418.z.string()
|
|
3551
|
-
})
|
|
3552
|
-
).nullable()
|
|
3553
|
-
})
|
|
3645
|
+
var compoundFilterSchema = import_v419.z.object({
|
|
3646
|
+
type: import_v419.z.enum(["and", "or"]),
|
|
3647
|
+
filters: import_v419.z.array(
|
|
3648
|
+
import_v419.z.union([comparisonFilterSchema, import_v419.z.lazy(() => compoundFilterSchema)])
|
|
3554
3649
|
)
|
|
3555
|
-
);
|
|
3556
|
-
var fileSearch = (0, import_provider_utils25.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
3557
|
-
id: "openai.file_search",
|
|
3558
|
-
name: "file_search",
|
|
3559
|
-
inputSchema: import_v418.z.object({}),
|
|
3560
|
-
outputSchema: fileSearchOutputSchema
|
|
3561
3650
|
});
|
|
3562
|
-
|
|
3563
|
-
// src/tool/web-search.ts
|
|
3564
|
-
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
3565
|
-
var import_v419 = require("zod/v4");
|
|
3566
|
-
var webSearchArgsSchema = (0, import_provider_utils26.lazySchema)(
|
|
3651
|
+
var fileSearchArgsSchema = (0, import_provider_utils26.lazySchema)(
|
|
3567
3652
|
() => (0, import_provider_utils26.zodSchema)(
|
|
3568
3653
|
import_v419.z.object({
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3654
|
+
vectorStoreIds: import_v419.z.array(import_v419.z.string()),
|
|
3655
|
+
maxNumResults: import_v419.z.number().optional(),
|
|
3656
|
+
ranking: import_v419.z.object({
|
|
3657
|
+
ranker: import_v419.z.string().optional(),
|
|
3658
|
+
scoreThreshold: import_v419.z.number().optional()
|
|
3573
3659
|
}).optional(),
|
|
3574
|
-
|
|
3575
|
-
userLocation: import_v419.z.object({
|
|
3576
|
-
type: import_v419.z.literal("approximate"),
|
|
3577
|
-
country: import_v419.z.string().optional(),
|
|
3578
|
-
city: import_v419.z.string().optional(),
|
|
3579
|
-
region: import_v419.z.string().optional(),
|
|
3580
|
-
timezone: import_v419.z.string().optional()
|
|
3581
|
-
}).optional()
|
|
3660
|
+
filters: import_v419.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
3582
3661
|
})
|
|
3583
3662
|
)
|
|
3584
3663
|
);
|
|
3585
|
-
var
|
|
3586
|
-
var webSearchOutputSchema = (0, import_provider_utils26.lazySchema)(
|
|
3664
|
+
var fileSearchOutputSchema = (0, import_provider_utils26.lazySchema)(
|
|
3587
3665
|
() => (0, import_provider_utils26.zodSchema)(
|
|
3588
3666
|
import_v419.z.object({
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
type: import_v419.z.literal("search"),
|
|
3592
|
-
query: import_v419.z.string().optional()
|
|
3593
|
-
}),
|
|
3594
|
-
import_v419.z.object({
|
|
3595
|
-
type: import_v419.z.literal("openPage"),
|
|
3596
|
-
url: import_v419.z.string().nullish()
|
|
3597
|
-
}),
|
|
3667
|
+
queries: import_v419.z.array(import_v419.z.string()),
|
|
3668
|
+
results: import_v419.z.array(
|
|
3598
3669
|
import_v419.z.object({
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3670
|
+
attributes: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()),
|
|
3671
|
+
fileId: import_v419.z.string(),
|
|
3672
|
+
filename: import_v419.z.string(),
|
|
3673
|
+
score: import_v419.z.number(),
|
|
3674
|
+
text: import_v419.z.string()
|
|
3602
3675
|
})
|
|
3603
|
-
|
|
3604
|
-
sources: import_v419.z.array(
|
|
3605
|
-
import_v419.z.discriminatedUnion("type", [
|
|
3606
|
-
import_v419.z.object({ type: import_v419.z.literal("url"), url: import_v419.z.string() }),
|
|
3607
|
-
import_v419.z.object({ type: import_v419.z.literal("api"), name: import_v419.z.string() })
|
|
3608
|
-
])
|
|
3609
|
-
).optional()
|
|
3676
|
+
).nullable()
|
|
3610
3677
|
})
|
|
3611
3678
|
)
|
|
3612
3679
|
);
|
|
3613
|
-
var
|
|
3614
|
-
id: "openai.
|
|
3615
|
-
name: "
|
|
3616
|
-
inputSchema:
|
|
3617
|
-
outputSchema:
|
|
3680
|
+
var fileSearch = (0, import_provider_utils26.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
3681
|
+
id: "openai.file_search",
|
|
3682
|
+
name: "file_search",
|
|
3683
|
+
inputSchema: import_v419.z.object({}),
|
|
3684
|
+
outputSchema: fileSearchOutputSchema
|
|
3618
3685
|
});
|
|
3619
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
3620
3686
|
|
|
3621
3687
|
// src/tool/web-search-preview.ts
|
|
3622
3688
|
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
@@ -3953,6 +4019,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3953
4019
|
modelCapabilities,
|
|
3954
4020
|
options: openaiOptions
|
|
3955
4021
|
});
|
|
4022
|
+
const webSearchToolName = (_a2 = tools == null ? void 0 : tools.find(
|
|
4023
|
+
(tool) => tool.type === "provider-defined" && (tool.id === "openai.web_search" || tool.id === "openai.web_search_preview")
|
|
4024
|
+
)) == null ? void 0 : _a2.name;
|
|
3956
4025
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
3957
4026
|
prompt,
|
|
3958
4027
|
configurationUpdateUnsupportedReason,
|
|
@@ -3960,8 +4029,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3960
4029
|
systemMessageMode: modelCapabilities.systemMessageMode,
|
|
3961
4030
|
explicitMessageItemType: this.config.explicitMessageItemType,
|
|
3962
4031
|
fileIdPrefixes: this.config.fileIdPrefixes,
|
|
3963
|
-
store: (
|
|
3964
|
-
hasLocalShellTool: hasOpenAITool("openai.local_shell")
|
|
4032
|
+
store: (_b = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _b : true,
|
|
4033
|
+
hasLocalShellTool: hasOpenAITool("openai.local_shell"),
|
|
4034
|
+
webSearchToolName
|
|
3965
4035
|
});
|
|
3966
4036
|
warnings.push(...inputWarnings);
|
|
3967
4037
|
let resolvedReasoningEffort = openaiOptions == null ? void 0 : openaiOptions.reasoningEffort;
|
|
@@ -3998,7 +4068,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3998
4068
|
});
|
|
3999
4069
|
}
|
|
4000
4070
|
}
|
|
4001
|
-
const strictJsonSchema = (
|
|
4071
|
+
const strictJsonSchema = (_c = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _c : false;
|
|
4002
4072
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
4003
4073
|
function addInclude(key) {
|
|
4004
4074
|
if (include == null) {
|
|
@@ -4016,9 +4086,6 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4016
4086
|
if (topLogprobs) {
|
|
4017
4087
|
addInclude("message.output_text.logprobs");
|
|
4018
4088
|
}
|
|
4019
|
-
const webSearchToolName = (_c = tools == null ? void 0 : tools.find(
|
|
4020
|
-
(tool) => tool.type === "provider-defined" && (tool.id === "openai.web_search" || tool.id === "openai.web_search_preview")
|
|
4021
|
-
)) == null ? void 0 : _c.name;
|
|
4022
4089
|
if (webSearchToolName) {
|
|
4023
4090
|
addInclude("web_search_call.action.sources");
|
|
4024
4091
|
}
|