@ai-sdk/openai 2.0.133 → 2.0.135
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 +14 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +86 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +87 -13
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +580 -507
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +578 -504
- 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;
|
|
@@ -2571,22 +2679,24 @@ async function convertToOpenAIResponsesInput({
|
|
|
2571
2679
|
explicitMessageItemType = false,
|
|
2572
2680
|
fileIdPrefixes,
|
|
2573
2681
|
store,
|
|
2682
|
+
isReasoningModel = false,
|
|
2574
2683
|
configurationUpdateUnsupportedReason,
|
|
2575
|
-
hasLocalShellTool = false
|
|
2684
|
+
hasLocalShellTool = false,
|
|
2685
|
+
webSearchToolName
|
|
2576
2686
|
}) {
|
|
2577
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
2687
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
2578
2688
|
let input = [];
|
|
2579
2689
|
const warnings = [];
|
|
2580
2690
|
for (const { role, content, providerOptions } of prompt) {
|
|
2581
2691
|
switch (role) {
|
|
2582
2692
|
case "system": {
|
|
2583
|
-
let options = await (0,
|
|
2693
|
+
let options = await (0, import_provider_utils23.parseProviderOptions)({
|
|
2584
2694
|
provider: providerOptionsName,
|
|
2585
2695
|
providerOptions,
|
|
2586
2696
|
schema: openaiResponsesSystemMessageOptionsSchema
|
|
2587
2697
|
});
|
|
2588
2698
|
if (options == null && providerOptionsName !== "openai") {
|
|
2589
|
-
options = await (0,
|
|
2699
|
+
options = await (0, import_provider_utils23.parseProviderOptions)({
|
|
2590
2700
|
provider: "openai",
|
|
2591
2701
|
providerOptions,
|
|
2592
2702
|
schema: openaiResponsesSystemMessageOptionsSchema
|
|
@@ -2682,7 +2792,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2682
2792
|
return {
|
|
2683
2793
|
type: "input_image",
|
|
2684
2794
|
...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,
|
|
2795
|
+
image_url: `data:${mediaType};base64,${(0, import_provider_utils23.convertToBase64)(part.data)}`
|
|
2686
2796
|
},
|
|
2687
2797
|
detail: (_b2 = (_a3 = part.providerOptions) == null ? void 0 : _a3.openai) == null ? void 0 : _b2.imageDetail,
|
|
2688
2798
|
...promptCacheBreakpoint != null && {
|
|
@@ -2703,7 +2813,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2703
2813
|
type: "input_file",
|
|
2704
2814
|
...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2705
2815
|
filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
|
|
2706
|
-
file_data: `data:application/pdf;base64,${(0,
|
|
2816
|
+
file_data: `data:application/pdf;base64,${(0, import_provider_utils23.convertToBase64)(part.data)}`
|
|
2707
2817
|
},
|
|
2708
2818
|
...promptCacheBreakpoint != null && {
|
|
2709
2819
|
prompt_cache_breakpoint: promptCacheBreakpoint
|
|
@@ -2723,12 +2833,14 @@ async function convertToOpenAIResponsesInput({
|
|
|
2723
2833
|
case "assistant": {
|
|
2724
2834
|
const reasoningMessages = {};
|
|
2725
2835
|
const toolCallParts = {};
|
|
2836
|
+
let hasPrecedingReasoning = false;
|
|
2726
2837
|
for (const part of content) {
|
|
2727
2838
|
switch (part.type) {
|
|
2728
2839
|
case "text": {
|
|
2729
2840
|
const id = (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b.itemId;
|
|
2730
2841
|
const phase = (_d = (_c = part.providerOptions) == null ? void 0 : _c.openai) == null ? void 0 : _d.phase;
|
|
2731
|
-
|
|
2842
|
+
const canUseItemId = id != null && (!isReasoningModel || hasPrecedingReasoning);
|
|
2843
|
+
if (store && canUseItemId) {
|
|
2732
2844
|
input.push({ type: "item_reference", id });
|
|
2733
2845
|
break;
|
|
2734
2846
|
}
|
|
@@ -2736,7 +2848,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2736
2848
|
...explicitMessageItemType && { type: "message" },
|
|
2737
2849
|
role: "assistant",
|
|
2738
2850
|
content: [{ type: "output_text", text: part.text }],
|
|
2739
|
-
id,
|
|
2851
|
+
id: canUseItemId ? id : void 0,
|
|
2740
2852
|
...phase != null && { phase }
|
|
2741
2853
|
});
|
|
2742
2854
|
break;
|
|
@@ -2748,12 +2860,13 @@ async function convertToOpenAIResponsesInput({
|
|
|
2748
2860
|
}
|
|
2749
2861
|
const id = (_f = (_e = part.providerOptions) == null ? void 0 : _e.openai) == null ? void 0 : _f.itemId;
|
|
2750
2862
|
const isAsync = (_h = (_g = part.providerOptions) == null ? void 0 : _g.openai) == null ? void 0 : _h.async;
|
|
2751
|
-
|
|
2863
|
+
const canUseItemId = id != null && (!isReasoningModel || hasPrecedingReasoning);
|
|
2864
|
+
if (store && canUseItemId) {
|
|
2752
2865
|
input.push({ type: "item_reference", id });
|
|
2753
2866
|
break;
|
|
2754
2867
|
}
|
|
2755
2868
|
if (hasLocalShellTool && part.toolName === "local_shell") {
|
|
2756
|
-
const parsedInput = await (0,
|
|
2869
|
+
const parsedInput = await (0, import_provider_utils23.validateTypes)({
|
|
2757
2870
|
value: part.input,
|
|
2758
2871
|
schema: localShellInputSchema
|
|
2759
2872
|
});
|
|
@@ -2778,12 +2891,27 @@ async function convertToOpenAIResponsesInput({
|
|
|
2778
2891
|
name: part.toolName,
|
|
2779
2892
|
arguments: JSON.stringify(part.input),
|
|
2780
2893
|
...isAsync != null && { async: isAsync },
|
|
2781
|
-
id
|
|
2894
|
+
id: canUseItemId ? id : void 0
|
|
2782
2895
|
});
|
|
2783
2896
|
break;
|
|
2784
2897
|
}
|
|
2785
2898
|
// assistant tool result parts are from provider-executed tools:
|
|
2786
2899
|
case "tool-result": {
|
|
2900
|
+
if (part.toolName === "web_search" || part.toolName === "web_search_preview" || part.toolName === webSearchToolName) {
|
|
2901
|
+
const itemId = (_k = (_j = (_i = part.providerOptions) == null ? void 0 : _i[providerOptionsName]) == null ? void 0 : _j.itemId) != null ? _k : part.toolCallId;
|
|
2902
|
+
if (store) {
|
|
2903
|
+
input.push({ type: "item_reference", id: itemId });
|
|
2904
|
+
break;
|
|
2905
|
+
}
|
|
2906
|
+
const webSearchCall = await convertWebSearchToolResultOutput({
|
|
2907
|
+
output: part.output,
|
|
2908
|
+
id: itemId
|
|
2909
|
+
});
|
|
2910
|
+
if (webSearchCall != null) {
|
|
2911
|
+
input.push(webSearchCall);
|
|
2912
|
+
break;
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2787
2915
|
if (store) {
|
|
2788
2916
|
input.push({ type: "item_reference", id: part.toolCallId });
|
|
2789
2917
|
} else {
|
|
@@ -2795,7 +2923,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
2795
2923
|
break;
|
|
2796
2924
|
}
|
|
2797
2925
|
case "reasoning": {
|
|
2798
|
-
|
|
2926
|
+
hasPrecedingReasoning = true;
|
|
2927
|
+
const providerOptions2 = await (0, import_provider_utils23.parseProviderOptions)({
|
|
2799
2928
|
provider: "openai",
|
|
2800
2929
|
providerOptions: part.providerOptions,
|
|
2801
2930
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -2859,7 +2988,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2859
2988
|
part.providerOptions
|
|
2860
2989
|
);
|
|
2861
2990
|
if (hasLocalShellTool && part.toolName === "local_shell" && output.type === "json") {
|
|
2862
|
-
const parsedOutput = await (0,
|
|
2991
|
+
const parsedOutput = await (0, import_provider_utils23.validateTypes)({
|
|
2863
2992
|
value: output.value,
|
|
2864
2993
|
schema: localShellOutputSchema
|
|
2865
2994
|
});
|
|
@@ -2952,9 +3081,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
2952
3081
|
}
|
|
2953
3082
|
return { input, warnings };
|
|
2954
3083
|
}
|
|
2955
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
2956
|
-
itemId:
|
|
2957
|
-
reasoningEncryptedContent:
|
|
3084
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v416.z.object({
|
|
3085
|
+
itemId: import_v416.z.string().nullish(),
|
|
3086
|
+
reasoningEncryptedContent: import_v416.z.string().nullish()
|
|
2958
3087
|
});
|
|
2959
3088
|
|
|
2960
3089
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -2976,288 +3105,288 @@ function mapOpenAIResponseFinishReason({
|
|
|
2976
3105
|
}
|
|
2977
3106
|
|
|
2978
3107
|
// 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:
|
|
3108
|
+
var import_provider_utils24 = require("@ai-sdk/provider-utils");
|
|
3109
|
+
var import_v417 = require("zod/v4");
|
|
3110
|
+
var openaiResponsesChunkSchema = (0, import_provider_utils24.lazyValidator)(
|
|
3111
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
3112
|
+
import_v417.z.union([
|
|
3113
|
+
import_v417.z.object({
|
|
3114
|
+
type: import_v417.z.literal("response.output_text.delta"),
|
|
3115
|
+
item_id: import_v417.z.string(),
|
|
3116
|
+
delta: import_v417.z.string(),
|
|
3117
|
+
logprobs: import_v417.z.array(
|
|
3118
|
+
import_v417.z.object({
|
|
3119
|
+
token: import_v417.z.string(),
|
|
3120
|
+
logprob: import_v417.z.number(),
|
|
3121
|
+
top_logprobs: import_v417.z.array(
|
|
3122
|
+
import_v417.z.object({
|
|
3123
|
+
token: import_v417.z.string(),
|
|
3124
|
+
logprob: import_v417.z.number()
|
|
2996
3125
|
})
|
|
2997
3126
|
)
|
|
2998
3127
|
})
|
|
2999
3128
|
).nullish()
|
|
3000
3129
|
}),
|
|
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:
|
|
3130
|
+
import_v417.z.object({
|
|
3131
|
+
type: import_v417.z.enum(["response.completed", "response.incomplete"]),
|
|
3132
|
+
response: import_v417.z.object({
|
|
3133
|
+
incomplete_details: import_v417.z.object({ reason: import_v417.z.string() }).nullish(),
|
|
3134
|
+
usage: import_v417.z.object({
|
|
3135
|
+
input_tokens: import_v417.z.number(),
|
|
3136
|
+
input_tokens_details: import_v417.z.object({
|
|
3137
|
+
cached_tokens: import_v417.z.number().nullish(),
|
|
3138
|
+
cache_write_tokens: import_v417.z.number().nullish(),
|
|
3139
|
+
orchestration_input_tokens: import_v417.z.number().nullish(),
|
|
3140
|
+
orchestration_input_cached_tokens: import_v417.z.number().nullish()
|
|
3012
3141
|
}).nullish(),
|
|
3013
|
-
output_tokens:
|
|
3014
|
-
output_tokens_details:
|
|
3015
|
-
reasoning_tokens:
|
|
3016
|
-
orchestration_output_tokens:
|
|
3142
|
+
output_tokens: import_v417.z.number(),
|
|
3143
|
+
output_tokens_details: import_v417.z.object({
|
|
3144
|
+
reasoning_tokens: import_v417.z.number().nullish(),
|
|
3145
|
+
orchestration_output_tokens: import_v417.z.number().nullish()
|
|
3017
3146
|
}).nullish()
|
|
3018
3147
|
}),
|
|
3019
|
-
reasoning:
|
|
3020
|
-
context:
|
|
3148
|
+
reasoning: import_v417.z.object({
|
|
3149
|
+
context: import_v417.z.string().nullish()
|
|
3021
3150
|
}).nullish(),
|
|
3022
|
-
service_tier:
|
|
3151
|
+
service_tier: import_v417.z.string().nullish()
|
|
3023
3152
|
})
|
|
3024
3153
|
}),
|
|
3025
|
-
|
|
3026
|
-
type:
|
|
3027
|
-
response:
|
|
3028
|
-
id:
|
|
3029
|
-
created_at:
|
|
3030
|
-
model:
|
|
3031
|
-
service_tier:
|
|
3154
|
+
import_v417.z.object({
|
|
3155
|
+
type: import_v417.z.literal("response.created"),
|
|
3156
|
+
response: import_v417.z.object({
|
|
3157
|
+
id: import_v417.z.string(),
|
|
3158
|
+
created_at: import_v417.z.number(),
|
|
3159
|
+
model: import_v417.z.string(),
|
|
3160
|
+
service_tier: import_v417.z.string().nullish()
|
|
3032
3161
|
})
|
|
3033
3162
|
}),
|
|
3034
|
-
|
|
3035
|
-
type:
|
|
3036
|
-
output_index:
|
|
3037
|
-
item:
|
|
3038
|
-
|
|
3039
|
-
type:
|
|
3040
|
-
id:
|
|
3041
|
-
phase:
|
|
3163
|
+
import_v417.z.object({
|
|
3164
|
+
type: import_v417.z.literal("response.output_item.added"),
|
|
3165
|
+
output_index: import_v417.z.number(),
|
|
3166
|
+
item: import_v417.z.discriminatedUnion("type", [
|
|
3167
|
+
import_v417.z.object({
|
|
3168
|
+
type: import_v417.z.literal("message"),
|
|
3169
|
+
id: import_v417.z.string(),
|
|
3170
|
+
phase: import_v417.z.enum(["commentary", "final_answer"]).nullish()
|
|
3042
3171
|
}),
|
|
3043
|
-
|
|
3044
|
-
type:
|
|
3045
|
-
id:
|
|
3046
|
-
encrypted_content:
|
|
3172
|
+
import_v417.z.object({
|
|
3173
|
+
type: import_v417.z.literal("reasoning"),
|
|
3174
|
+
id: import_v417.z.string(),
|
|
3175
|
+
encrypted_content: import_v417.z.string().nullish()
|
|
3047
3176
|
}),
|
|
3048
|
-
|
|
3049
|
-
type:
|
|
3050
|
-
id:
|
|
3051
|
-
call_id:
|
|
3052
|
-
name:
|
|
3053
|
-
arguments:
|
|
3054
|
-
async:
|
|
3177
|
+
import_v417.z.object({
|
|
3178
|
+
type: import_v417.z.literal("function_call"),
|
|
3179
|
+
id: import_v417.z.string(),
|
|
3180
|
+
call_id: import_v417.z.string(),
|
|
3181
|
+
name: import_v417.z.string(),
|
|
3182
|
+
arguments: import_v417.z.string(),
|
|
3183
|
+
async: import_v417.z.boolean().nullish()
|
|
3055
3184
|
}),
|
|
3056
|
-
|
|
3057
|
-
type:
|
|
3058
|
-
id:
|
|
3059
|
-
status:
|
|
3185
|
+
import_v417.z.object({
|
|
3186
|
+
type: import_v417.z.literal("web_search_call"),
|
|
3187
|
+
id: import_v417.z.string(),
|
|
3188
|
+
status: import_v417.z.string()
|
|
3060
3189
|
}),
|
|
3061
|
-
|
|
3062
|
-
type:
|
|
3063
|
-
id:
|
|
3064
|
-
status:
|
|
3190
|
+
import_v417.z.object({
|
|
3191
|
+
type: import_v417.z.literal("computer_call"),
|
|
3192
|
+
id: import_v417.z.string(),
|
|
3193
|
+
status: import_v417.z.string()
|
|
3065
3194
|
}),
|
|
3066
|
-
|
|
3067
|
-
type:
|
|
3068
|
-
id:
|
|
3195
|
+
import_v417.z.object({
|
|
3196
|
+
type: import_v417.z.literal("file_search_call"),
|
|
3197
|
+
id: import_v417.z.string()
|
|
3069
3198
|
}),
|
|
3070
|
-
|
|
3071
|
-
type:
|
|
3072
|
-
id:
|
|
3199
|
+
import_v417.z.object({
|
|
3200
|
+
type: import_v417.z.literal("image_generation_call"),
|
|
3201
|
+
id: import_v417.z.string()
|
|
3073
3202
|
}),
|
|
3074
|
-
|
|
3075
|
-
type:
|
|
3076
|
-
id:
|
|
3077
|
-
container_id:
|
|
3078
|
-
code:
|
|
3079
|
-
outputs:
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3203
|
+
import_v417.z.object({
|
|
3204
|
+
type: import_v417.z.literal("code_interpreter_call"),
|
|
3205
|
+
id: import_v417.z.string(),
|
|
3206
|
+
container_id: import_v417.z.string(),
|
|
3207
|
+
code: import_v417.z.string().nullable(),
|
|
3208
|
+
outputs: import_v417.z.array(
|
|
3209
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3210
|
+
import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
|
|
3211
|
+
import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
|
|
3083
3212
|
])
|
|
3084
3213
|
).nullable(),
|
|
3085
|
-
status:
|
|
3214
|
+
status: import_v417.z.string()
|
|
3086
3215
|
})
|
|
3087
3216
|
])
|
|
3088
3217
|
}),
|
|
3089
|
-
|
|
3090
|
-
type:
|
|
3091
|
-
output_index:
|
|
3092
|
-
item:
|
|
3093
|
-
|
|
3094
|
-
type:
|
|
3095
|
-
id:
|
|
3096
|
-
phase:
|
|
3218
|
+
import_v417.z.object({
|
|
3219
|
+
type: import_v417.z.literal("response.output_item.done"),
|
|
3220
|
+
output_index: import_v417.z.number(),
|
|
3221
|
+
item: import_v417.z.discriminatedUnion("type", [
|
|
3222
|
+
import_v417.z.object({
|
|
3223
|
+
type: import_v417.z.literal("message"),
|
|
3224
|
+
id: import_v417.z.string(),
|
|
3225
|
+
phase: import_v417.z.enum(["commentary", "final_answer"]).nullish()
|
|
3097
3226
|
}),
|
|
3098
|
-
|
|
3099
|
-
type:
|
|
3100
|
-
id:
|
|
3101
|
-
encrypted_content:
|
|
3227
|
+
import_v417.z.object({
|
|
3228
|
+
type: import_v417.z.literal("reasoning"),
|
|
3229
|
+
id: import_v417.z.string(),
|
|
3230
|
+
encrypted_content: import_v417.z.string().nullish()
|
|
3102
3231
|
}),
|
|
3103
|
-
|
|
3104
|
-
type:
|
|
3105
|
-
id:
|
|
3106
|
-
call_id:
|
|
3107
|
-
name:
|
|
3108
|
-
arguments:
|
|
3109
|
-
async:
|
|
3110
|
-
status:
|
|
3232
|
+
import_v417.z.object({
|
|
3233
|
+
type: import_v417.z.literal("function_call"),
|
|
3234
|
+
id: import_v417.z.string(),
|
|
3235
|
+
call_id: import_v417.z.string(),
|
|
3236
|
+
name: import_v417.z.string(),
|
|
3237
|
+
arguments: import_v417.z.string(),
|
|
3238
|
+
async: import_v417.z.boolean().nullish(),
|
|
3239
|
+
status: import_v417.z.enum(["in_progress", "completed", "incomplete"])
|
|
3111
3240
|
}),
|
|
3112
|
-
|
|
3113
|
-
type:
|
|
3114
|
-
id:
|
|
3115
|
-
code:
|
|
3116
|
-
container_id:
|
|
3117
|
-
outputs:
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3241
|
+
import_v417.z.object({
|
|
3242
|
+
type: import_v417.z.literal("code_interpreter_call"),
|
|
3243
|
+
id: import_v417.z.string(),
|
|
3244
|
+
code: import_v417.z.string().nullable(),
|
|
3245
|
+
container_id: import_v417.z.string(),
|
|
3246
|
+
outputs: import_v417.z.array(
|
|
3247
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3248
|
+
import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
|
|
3249
|
+
import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
|
|
3121
3250
|
])
|
|
3122
3251
|
).nullable()
|
|
3123
3252
|
}),
|
|
3124
|
-
|
|
3125
|
-
type:
|
|
3126
|
-
id:
|
|
3127
|
-
result:
|
|
3253
|
+
import_v417.z.object({
|
|
3254
|
+
type: import_v417.z.literal("image_generation_call"),
|
|
3255
|
+
id: import_v417.z.string(),
|
|
3256
|
+
result: import_v417.z.string()
|
|
3128
3257
|
}),
|
|
3129
|
-
|
|
3130
|
-
type:
|
|
3131
|
-
id:
|
|
3132
|
-
status:
|
|
3133
|
-
action:
|
|
3134
|
-
|
|
3135
|
-
type:
|
|
3136
|
-
query:
|
|
3137
|
-
sources:
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3258
|
+
import_v417.z.object({
|
|
3259
|
+
type: import_v417.z.literal("web_search_call"),
|
|
3260
|
+
id: import_v417.z.string(),
|
|
3261
|
+
status: import_v417.z.string(),
|
|
3262
|
+
action: import_v417.z.discriminatedUnion("type", [
|
|
3263
|
+
import_v417.z.object({
|
|
3264
|
+
type: import_v417.z.literal("search"),
|
|
3265
|
+
query: import_v417.z.string().nullish(),
|
|
3266
|
+
sources: import_v417.z.array(
|
|
3267
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3268
|
+
import_v417.z.object({ type: import_v417.z.literal("url"), url: import_v417.z.string() }),
|
|
3269
|
+
import_v417.z.object({ type: import_v417.z.literal("api"), name: import_v417.z.string() })
|
|
3141
3270
|
])
|
|
3142
3271
|
).nullish()
|
|
3143
3272
|
}),
|
|
3144
|
-
|
|
3145
|
-
type:
|
|
3146
|
-
url:
|
|
3273
|
+
import_v417.z.object({
|
|
3274
|
+
type: import_v417.z.literal("open_page"),
|
|
3275
|
+
url: import_v417.z.string().nullish()
|
|
3147
3276
|
}),
|
|
3148
|
-
|
|
3149
|
-
type:
|
|
3150
|
-
url:
|
|
3151
|
-
pattern:
|
|
3277
|
+
import_v417.z.object({
|
|
3278
|
+
type: import_v417.z.literal("find_in_page"),
|
|
3279
|
+
url: import_v417.z.string().nullish(),
|
|
3280
|
+
pattern: import_v417.z.string().nullish()
|
|
3152
3281
|
})
|
|
3153
3282
|
]).nullish()
|
|
3154
3283
|
}),
|
|
3155
|
-
|
|
3156
|
-
type:
|
|
3157
|
-
id:
|
|
3158
|
-
queries:
|
|
3159
|
-
results:
|
|
3160
|
-
|
|
3161
|
-
attributes:
|
|
3162
|
-
file_id:
|
|
3163
|
-
filename:
|
|
3164
|
-
score:
|
|
3165
|
-
text:
|
|
3284
|
+
import_v417.z.object({
|
|
3285
|
+
type: import_v417.z.literal("file_search_call"),
|
|
3286
|
+
id: import_v417.z.string(),
|
|
3287
|
+
queries: import_v417.z.array(import_v417.z.string()),
|
|
3288
|
+
results: import_v417.z.array(
|
|
3289
|
+
import_v417.z.object({
|
|
3290
|
+
attributes: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()),
|
|
3291
|
+
file_id: import_v417.z.string(),
|
|
3292
|
+
filename: import_v417.z.string(),
|
|
3293
|
+
score: import_v417.z.number(),
|
|
3294
|
+
text: import_v417.z.string()
|
|
3166
3295
|
})
|
|
3167
3296
|
).nullish()
|
|
3168
3297
|
}),
|
|
3169
|
-
|
|
3170
|
-
type:
|
|
3171
|
-
id:
|
|
3172
|
-
call_id:
|
|
3173
|
-
action:
|
|
3174
|
-
type:
|
|
3175
|
-
command:
|
|
3176
|
-
timeout_ms:
|
|
3177
|
-
user:
|
|
3178
|
-
working_directory:
|
|
3179
|
-
env:
|
|
3298
|
+
import_v417.z.object({
|
|
3299
|
+
type: import_v417.z.literal("local_shell_call"),
|
|
3300
|
+
id: import_v417.z.string(),
|
|
3301
|
+
call_id: import_v417.z.string(),
|
|
3302
|
+
action: import_v417.z.object({
|
|
3303
|
+
type: import_v417.z.literal("exec"),
|
|
3304
|
+
command: import_v417.z.array(import_v417.z.string()),
|
|
3305
|
+
timeout_ms: import_v417.z.number().optional(),
|
|
3306
|
+
user: import_v417.z.string().optional(),
|
|
3307
|
+
working_directory: import_v417.z.string().optional(),
|
|
3308
|
+
env: import_v417.z.record(import_v417.z.string(), import_v417.z.string()).optional()
|
|
3180
3309
|
})
|
|
3181
3310
|
}),
|
|
3182
|
-
|
|
3183
|
-
type:
|
|
3184
|
-
id:
|
|
3185
|
-
status:
|
|
3311
|
+
import_v417.z.object({
|
|
3312
|
+
type: import_v417.z.literal("computer_call"),
|
|
3313
|
+
id: import_v417.z.string(),
|
|
3314
|
+
status: import_v417.z.literal("completed")
|
|
3186
3315
|
})
|
|
3187
3316
|
])
|
|
3188
3317
|
}),
|
|
3189
|
-
|
|
3190
|
-
type:
|
|
3191
|
-
item_id:
|
|
3192
|
-
output_index:
|
|
3193
|
-
delta:
|
|
3318
|
+
import_v417.z.object({
|
|
3319
|
+
type: import_v417.z.literal("response.function_call_arguments.delta"),
|
|
3320
|
+
item_id: import_v417.z.string(),
|
|
3321
|
+
output_index: import_v417.z.number(),
|
|
3322
|
+
delta: import_v417.z.string()
|
|
3194
3323
|
}),
|
|
3195
|
-
|
|
3196
|
-
type:
|
|
3197
|
-
item_id:
|
|
3198
|
-
output_index:
|
|
3199
|
-
partial_image_b64:
|
|
3324
|
+
import_v417.z.object({
|
|
3325
|
+
type: import_v417.z.literal("response.image_generation_call.partial_image"),
|
|
3326
|
+
item_id: import_v417.z.string(),
|
|
3327
|
+
output_index: import_v417.z.number(),
|
|
3328
|
+
partial_image_b64: import_v417.z.string()
|
|
3200
3329
|
}),
|
|
3201
|
-
|
|
3202
|
-
type:
|
|
3203
|
-
item_id:
|
|
3204
|
-
output_index:
|
|
3205
|
-
delta:
|
|
3330
|
+
import_v417.z.object({
|
|
3331
|
+
type: import_v417.z.literal("response.code_interpreter_call_code.delta"),
|
|
3332
|
+
item_id: import_v417.z.string(),
|
|
3333
|
+
output_index: import_v417.z.number(),
|
|
3334
|
+
delta: import_v417.z.string()
|
|
3206
3335
|
}),
|
|
3207
|
-
|
|
3208
|
-
type:
|
|
3209
|
-
item_id:
|
|
3210
|
-
output_index:
|
|
3211
|
-
code:
|
|
3336
|
+
import_v417.z.object({
|
|
3337
|
+
type: import_v417.z.literal("response.code_interpreter_call_code.done"),
|
|
3338
|
+
item_id: import_v417.z.string(),
|
|
3339
|
+
output_index: import_v417.z.number(),
|
|
3340
|
+
code: import_v417.z.string()
|
|
3212
3341
|
}),
|
|
3213
|
-
|
|
3214
|
-
type:
|
|
3215
|
-
annotation:
|
|
3216
|
-
|
|
3217
|
-
type:
|
|
3218
|
-
start_index:
|
|
3219
|
-
end_index:
|
|
3220
|
-
url:
|
|
3221
|
-
title:
|
|
3342
|
+
import_v417.z.object({
|
|
3343
|
+
type: import_v417.z.literal("response.output_text.annotation.added"),
|
|
3344
|
+
annotation: import_v417.z.discriminatedUnion("type", [
|
|
3345
|
+
import_v417.z.object({
|
|
3346
|
+
type: import_v417.z.literal("url_citation"),
|
|
3347
|
+
start_index: import_v417.z.number(),
|
|
3348
|
+
end_index: import_v417.z.number(),
|
|
3349
|
+
url: import_v417.z.string(),
|
|
3350
|
+
title: import_v417.z.string()
|
|
3222
3351
|
}),
|
|
3223
|
-
|
|
3224
|
-
type:
|
|
3225
|
-
file_id:
|
|
3226
|
-
filename:
|
|
3227
|
-
index:
|
|
3228
|
-
start_index:
|
|
3229
|
-
end_index:
|
|
3230
|
-
quote:
|
|
3352
|
+
import_v417.z.object({
|
|
3353
|
+
type: import_v417.z.literal("file_citation"),
|
|
3354
|
+
file_id: import_v417.z.string(),
|
|
3355
|
+
filename: import_v417.z.string().nullish(),
|
|
3356
|
+
index: import_v417.z.number().nullish(),
|
|
3357
|
+
start_index: import_v417.z.number().nullish(),
|
|
3358
|
+
end_index: import_v417.z.number().nullish(),
|
|
3359
|
+
quote: import_v417.z.string().nullish()
|
|
3231
3360
|
})
|
|
3232
3361
|
])
|
|
3233
3362
|
}),
|
|
3234
|
-
|
|
3235
|
-
type:
|
|
3236
|
-
item_id:
|
|
3237
|
-
summary_index:
|
|
3363
|
+
import_v417.z.object({
|
|
3364
|
+
type: import_v417.z.literal("response.reasoning_summary_part.added"),
|
|
3365
|
+
item_id: import_v417.z.string(),
|
|
3366
|
+
summary_index: import_v417.z.number()
|
|
3238
3367
|
}),
|
|
3239
|
-
|
|
3240
|
-
type:
|
|
3241
|
-
item_id:
|
|
3242
|
-
summary_index:
|
|
3243
|
-
delta:
|
|
3368
|
+
import_v417.z.object({
|
|
3369
|
+
type: import_v417.z.literal("response.reasoning_summary_text.delta"),
|
|
3370
|
+
item_id: import_v417.z.string(),
|
|
3371
|
+
summary_index: import_v417.z.number(),
|
|
3372
|
+
delta: import_v417.z.string()
|
|
3244
3373
|
}),
|
|
3245
|
-
|
|
3246
|
-
type:
|
|
3247
|
-
item_id:
|
|
3248
|
-
summary_index:
|
|
3374
|
+
import_v417.z.object({
|
|
3375
|
+
type: import_v417.z.literal("response.reasoning_summary_part.done"),
|
|
3376
|
+
item_id: import_v417.z.string(),
|
|
3377
|
+
summary_index: import_v417.z.number()
|
|
3249
3378
|
}),
|
|
3250
|
-
|
|
3251
|
-
type:
|
|
3252
|
-
sequence_number:
|
|
3253
|
-
error:
|
|
3254
|
-
type:
|
|
3255
|
-
code:
|
|
3256
|
-
message:
|
|
3257
|
-
param:
|
|
3379
|
+
import_v417.z.object({
|
|
3380
|
+
type: import_v417.z.literal("error"),
|
|
3381
|
+
sequence_number: import_v417.z.number(),
|
|
3382
|
+
error: import_v417.z.object({
|
|
3383
|
+
type: import_v417.z.string(),
|
|
3384
|
+
code: import_v417.z.string(),
|
|
3385
|
+
message: import_v417.z.string(),
|
|
3386
|
+
param: import_v417.z.string().nullish()
|
|
3258
3387
|
})
|
|
3259
3388
|
}),
|
|
3260
|
-
|
|
3389
|
+
import_v417.z.object({ type: import_v417.z.string() }).loose().transform((value) => ({
|
|
3261
3390
|
type: "unknown_chunk",
|
|
3262
3391
|
message: value.type
|
|
3263
3392
|
}))
|
|
@@ -3265,197 +3394,197 @@ var openaiResponsesChunkSchema = (0, import_provider_utils23.lazyValidator)(
|
|
|
3265
3394
|
])
|
|
3266
3395
|
)
|
|
3267
3396
|
);
|
|
3268
|
-
var openaiResponsesResponseSchema = (0,
|
|
3269
|
-
() => (0,
|
|
3270
|
-
|
|
3271
|
-
id:
|
|
3272
|
-
created_at:
|
|
3273
|
-
error:
|
|
3274
|
-
message:
|
|
3275
|
-
type:
|
|
3276
|
-
param:
|
|
3277
|
-
code:
|
|
3397
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils24.lazyValidator)(
|
|
3398
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
3399
|
+
import_v417.z.object({
|
|
3400
|
+
id: import_v417.z.string().optional(),
|
|
3401
|
+
created_at: import_v417.z.number().optional(),
|
|
3402
|
+
error: import_v417.z.object({
|
|
3403
|
+
message: import_v417.z.string(),
|
|
3404
|
+
type: import_v417.z.string(),
|
|
3405
|
+
param: import_v417.z.string().nullish(),
|
|
3406
|
+
code: import_v417.z.string()
|
|
3278
3407
|
}).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:
|
|
3408
|
+
model: import_v417.z.string().optional(),
|
|
3409
|
+
output: import_v417.z.array(
|
|
3410
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3411
|
+
import_v417.z.object({
|
|
3412
|
+
type: import_v417.z.literal("message"),
|
|
3413
|
+
role: import_v417.z.literal("assistant"),
|
|
3414
|
+
id: import_v417.z.string(),
|
|
3415
|
+
phase: import_v417.z.enum(["commentary", "final_answer"]).nullish(),
|
|
3416
|
+
content: import_v417.z.array(
|
|
3417
|
+
import_v417.z.object({
|
|
3418
|
+
type: import_v417.z.literal("output_text"),
|
|
3419
|
+
text: import_v417.z.string(),
|
|
3420
|
+
logprobs: import_v417.z.array(
|
|
3421
|
+
import_v417.z.object({
|
|
3422
|
+
token: import_v417.z.string(),
|
|
3423
|
+
logprob: import_v417.z.number(),
|
|
3424
|
+
top_logprobs: import_v417.z.array(
|
|
3425
|
+
import_v417.z.object({
|
|
3426
|
+
token: import_v417.z.string(),
|
|
3427
|
+
logprob: import_v417.z.number()
|
|
3299
3428
|
})
|
|
3300
3429
|
)
|
|
3301
3430
|
})
|
|
3302
3431
|
).nullish(),
|
|
3303
|
-
annotations:
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
type:
|
|
3307
|
-
start_index:
|
|
3308
|
-
end_index:
|
|
3309
|
-
url:
|
|
3310
|
-
title:
|
|
3432
|
+
annotations: import_v417.z.array(
|
|
3433
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3434
|
+
import_v417.z.object({
|
|
3435
|
+
type: import_v417.z.literal("url_citation"),
|
|
3436
|
+
start_index: import_v417.z.number(),
|
|
3437
|
+
end_index: import_v417.z.number(),
|
|
3438
|
+
url: import_v417.z.string(),
|
|
3439
|
+
title: import_v417.z.string()
|
|
3311
3440
|
}),
|
|
3312
|
-
|
|
3313
|
-
type:
|
|
3314
|
-
file_id:
|
|
3315
|
-
filename:
|
|
3316
|
-
index:
|
|
3317
|
-
start_index:
|
|
3318
|
-
end_index:
|
|
3319
|
-
quote:
|
|
3441
|
+
import_v417.z.object({
|
|
3442
|
+
type: import_v417.z.literal("file_citation"),
|
|
3443
|
+
file_id: import_v417.z.string(),
|
|
3444
|
+
filename: import_v417.z.string().nullish(),
|
|
3445
|
+
index: import_v417.z.number().nullish(),
|
|
3446
|
+
start_index: import_v417.z.number().nullish(),
|
|
3447
|
+
end_index: import_v417.z.number().nullish(),
|
|
3448
|
+
quote: import_v417.z.string().nullish()
|
|
3320
3449
|
}),
|
|
3321
|
-
|
|
3322
|
-
type:
|
|
3323
|
-
container_id:
|
|
3324
|
-
file_id:
|
|
3325
|
-
filename:
|
|
3326
|
-
start_index:
|
|
3327
|
-
end_index:
|
|
3328
|
-
index:
|
|
3450
|
+
import_v417.z.object({
|
|
3451
|
+
type: import_v417.z.literal("container_file_citation"),
|
|
3452
|
+
container_id: import_v417.z.string(),
|
|
3453
|
+
file_id: import_v417.z.string(),
|
|
3454
|
+
filename: import_v417.z.string().nullish(),
|
|
3455
|
+
start_index: import_v417.z.number().nullish(),
|
|
3456
|
+
end_index: import_v417.z.number().nullish(),
|
|
3457
|
+
index: import_v417.z.number().nullish()
|
|
3329
3458
|
}),
|
|
3330
|
-
|
|
3331
|
-
type:
|
|
3332
|
-
file_id:
|
|
3333
|
-
index:
|
|
3459
|
+
import_v417.z.object({
|
|
3460
|
+
type: import_v417.z.literal("file_path"),
|
|
3461
|
+
file_id: import_v417.z.string(),
|
|
3462
|
+
index: import_v417.z.number().nullish()
|
|
3334
3463
|
})
|
|
3335
3464
|
])
|
|
3336
3465
|
)
|
|
3337
3466
|
})
|
|
3338
3467
|
)
|
|
3339
3468
|
}),
|
|
3340
|
-
|
|
3341
|
-
type:
|
|
3342
|
-
id:
|
|
3343
|
-
status:
|
|
3344
|
-
action:
|
|
3345
|
-
|
|
3346
|
-
type:
|
|
3347
|
-
query:
|
|
3348
|
-
sources:
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
type:
|
|
3353
|
-
name:
|
|
3469
|
+
import_v417.z.object({
|
|
3470
|
+
type: import_v417.z.literal("web_search_call"),
|
|
3471
|
+
id: import_v417.z.string(),
|
|
3472
|
+
status: import_v417.z.string(),
|
|
3473
|
+
action: import_v417.z.discriminatedUnion("type", [
|
|
3474
|
+
import_v417.z.object({
|
|
3475
|
+
type: import_v417.z.literal("search"),
|
|
3476
|
+
query: import_v417.z.string().nullish(),
|
|
3477
|
+
sources: import_v417.z.array(
|
|
3478
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3479
|
+
import_v417.z.object({ type: import_v417.z.literal("url"), url: import_v417.z.string() }),
|
|
3480
|
+
import_v417.z.object({
|
|
3481
|
+
type: import_v417.z.literal("api"),
|
|
3482
|
+
name: import_v417.z.string()
|
|
3354
3483
|
})
|
|
3355
3484
|
])
|
|
3356
3485
|
).nullish()
|
|
3357
3486
|
}),
|
|
3358
|
-
|
|
3359
|
-
type:
|
|
3360
|
-
url:
|
|
3487
|
+
import_v417.z.object({
|
|
3488
|
+
type: import_v417.z.literal("open_page"),
|
|
3489
|
+
url: import_v417.z.string().nullish()
|
|
3361
3490
|
}),
|
|
3362
|
-
|
|
3363
|
-
type:
|
|
3364
|
-
url:
|
|
3365
|
-
pattern:
|
|
3491
|
+
import_v417.z.object({
|
|
3492
|
+
type: import_v417.z.literal("find_in_page"),
|
|
3493
|
+
url: import_v417.z.string().nullish(),
|
|
3494
|
+
pattern: import_v417.z.string().nullish()
|
|
3366
3495
|
})
|
|
3367
3496
|
]).nullish()
|
|
3368
3497
|
}),
|
|
3369
|
-
|
|
3370
|
-
type:
|
|
3371
|
-
id:
|
|
3372
|
-
queries:
|
|
3373
|
-
results:
|
|
3374
|
-
|
|
3375
|
-
attributes:
|
|
3376
|
-
|
|
3377
|
-
|
|
3498
|
+
import_v417.z.object({
|
|
3499
|
+
type: import_v417.z.literal("file_search_call"),
|
|
3500
|
+
id: import_v417.z.string(),
|
|
3501
|
+
queries: import_v417.z.array(import_v417.z.string()),
|
|
3502
|
+
results: import_v417.z.array(
|
|
3503
|
+
import_v417.z.object({
|
|
3504
|
+
attributes: import_v417.z.record(
|
|
3505
|
+
import_v417.z.string(),
|
|
3506
|
+
import_v417.z.union([import_v417.z.string(), import_v417.z.number(), import_v417.z.boolean()])
|
|
3378
3507
|
),
|
|
3379
|
-
file_id:
|
|
3380
|
-
filename:
|
|
3381
|
-
score:
|
|
3382
|
-
text:
|
|
3508
|
+
file_id: import_v417.z.string(),
|
|
3509
|
+
filename: import_v417.z.string(),
|
|
3510
|
+
score: import_v417.z.number(),
|
|
3511
|
+
text: import_v417.z.string()
|
|
3383
3512
|
})
|
|
3384
3513
|
).nullish()
|
|
3385
3514
|
}),
|
|
3386
|
-
|
|
3387
|
-
type:
|
|
3388
|
-
id:
|
|
3389
|
-
code:
|
|
3390
|
-
container_id:
|
|
3391
|
-
outputs:
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3515
|
+
import_v417.z.object({
|
|
3516
|
+
type: import_v417.z.literal("code_interpreter_call"),
|
|
3517
|
+
id: import_v417.z.string(),
|
|
3518
|
+
code: import_v417.z.string().nullable(),
|
|
3519
|
+
container_id: import_v417.z.string(),
|
|
3520
|
+
outputs: import_v417.z.array(
|
|
3521
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3522
|
+
import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
|
|
3523
|
+
import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
|
|
3395
3524
|
])
|
|
3396
3525
|
).nullable()
|
|
3397
3526
|
}),
|
|
3398
|
-
|
|
3399
|
-
type:
|
|
3400
|
-
id:
|
|
3401
|
-
result:
|
|
3527
|
+
import_v417.z.object({
|
|
3528
|
+
type: import_v417.z.literal("image_generation_call"),
|
|
3529
|
+
id: import_v417.z.string(),
|
|
3530
|
+
result: import_v417.z.string()
|
|
3402
3531
|
}),
|
|
3403
|
-
|
|
3404
|
-
type:
|
|
3405
|
-
id:
|
|
3406
|
-
call_id:
|
|
3407
|
-
action:
|
|
3408
|
-
type:
|
|
3409
|
-
command:
|
|
3410
|
-
timeout_ms:
|
|
3411
|
-
user:
|
|
3412
|
-
working_directory:
|
|
3413
|
-
env:
|
|
3532
|
+
import_v417.z.object({
|
|
3533
|
+
type: import_v417.z.literal("local_shell_call"),
|
|
3534
|
+
id: import_v417.z.string(),
|
|
3535
|
+
call_id: import_v417.z.string(),
|
|
3536
|
+
action: import_v417.z.object({
|
|
3537
|
+
type: import_v417.z.literal("exec"),
|
|
3538
|
+
command: import_v417.z.array(import_v417.z.string()),
|
|
3539
|
+
timeout_ms: import_v417.z.number().optional(),
|
|
3540
|
+
user: import_v417.z.string().optional(),
|
|
3541
|
+
working_directory: import_v417.z.string().optional(),
|
|
3542
|
+
env: import_v417.z.record(import_v417.z.string(), import_v417.z.string()).optional()
|
|
3414
3543
|
})
|
|
3415
3544
|
}),
|
|
3416
|
-
|
|
3417
|
-
type:
|
|
3418
|
-
call_id:
|
|
3419
|
-
name:
|
|
3420
|
-
arguments:
|
|
3421
|
-
id:
|
|
3422
|
-
async:
|
|
3545
|
+
import_v417.z.object({
|
|
3546
|
+
type: import_v417.z.literal("function_call"),
|
|
3547
|
+
call_id: import_v417.z.string(),
|
|
3548
|
+
name: import_v417.z.string(),
|
|
3549
|
+
arguments: import_v417.z.string(),
|
|
3550
|
+
id: import_v417.z.string(),
|
|
3551
|
+
async: import_v417.z.boolean().nullish()
|
|
3423
3552
|
}),
|
|
3424
|
-
|
|
3425
|
-
type:
|
|
3426
|
-
id:
|
|
3427
|
-
status:
|
|
3553
|
+
import_v417.z.object({
|
|
3554
|
+
type: import_v417.z.literal("computer_call"),
|
|
3555
|
+
id: import_v417.z.string(),
|
|
3556
|
+
status: import_v417.z.string().optional()
|
|
3428
3557
|
}),
|
|
3429
|
-
|
|
3430
|
-
type:
|
|
3431
|
-
id:
|
|
3432
|
-
encrypted_content:
|
|
3433
|
-
summary:
|
|
3434
|
-
|
|
3435
|
-
type:
|
|
3436
|
-
text:
|
|
3558
|
+
import_v417.z.object({
|
|
3559
|
+
type: import_v417.z.literal("reasoning"),
|
|
3560
|
+
id: import_v417.z.string(),
|
|
3561
|
+
encrypted_content: import_v417.z.string().nullish(),
|
|
3562
|
+
summary: import_v417.z.array(
|
|
3563
|
+
import_v417.z.object({
|
|
3564
|
+
type: import_v417.z.literal("summary_text"),
|
|
3565
|
+
text: import_v417.z.string()
|
|
3437
3566
|
})
|
|
3438
3567
|
)
|
|
3439
3568
|
})
|
|
3440
3569
|
])
|
|
3441
3570
|
).optional(),
|
|
3442
|
-
service_tier:
|
|
3443
|
-
reasoning:
|
|
3444
|
-
context:
|
|
3571
|
+
service_tier: import_v417.z.string().nullish(),
|
|
3572
|
+
reasoning: import_v417.z.object({
|
|
3573
|
+
context: import_v417.z.string().nullish()
|
|
3445
3574
|
}).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:
|
|
3575
|
+
incomplete_details: import_v417.z.object({ reason: import_v417.z.string() }).nullish(),
|
|
3576
|
+
usage: import_v417.z.object({
|
|
3577
|
+
input_tokens: import_v417.z.number(),
|
|
3578
|
+
input_tokens_details: import_v417.z.object({
|
|
3579
|
+
cached_tokens: import_v417.z.number().nullish(),
|
|
3580
|
+
cache_write_tokens: import_v417.z.number().nullish(),
|
|
3581
|
+
orchestration_input_tokens: import_v417.z.number().nullish(),
|
|
3582
|
+
orchestration_input_cached_tokens: import_v417.z.number().nullish()
|
|
3454
3583
|
}).nullish(),
|
|
3455
|
-
output_tokens:
|
|
3456
|
-
output_tokens_details:
|
|
3457
|
-
reasoning_tokens:
|
|
3458
|
-
orchestration_output_tokens:
|
|
3584
|
+
output_tokens: import_v417.z.number(),
|
|
3585
|
+
output_tokens_details: import_v417.z.object({
|
|
3586
|
+
reasoning_tokens: import_v417.z.number().nullish(),
|
|
3587
|
+
orchestration_output_tokens: import_v417.z.number().nullish()
|
|
3459
3588
|
}).nullish()
|
|
3460
3589
|
}).optional()
|
|
3461
3590
|
})
|
|
@@ -3466,41 +3595,41 @@ var openaiResponsesResponseSchema = (0, import_provider_utils23.lazyValidator)(
|
|
|
3466
3595
|
var import_provider7 = require("@ai-sdk/provider");
|
|
3467
3596
|
|
|
3468
3597
|
// src/tool/code-interpreter.ts
|
|
3469
|
-
var
|
|
3470
|
-
var
|
|
3471
|
-
var codeInterpreterInputSchema = (0,
|
|
3472
|
-
() => (0,
|
|
3473
|
-
|
|
3474
|
-
code:
|
|
3475
|
-
containerId:
|
|
3598
|
+
var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
3599
|
+
var import_v418 = require("zod/v4");
|
|
3600
|
+
var codeInterpreterInputSchema = (0, import_provider_utils25.lazySchema)(
|
|
3601
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3602
|
+
import_v418.z.object({
|
|
3603
|
+
code: import_v418.z.string().nullish(),
|
|
3604
|
+
containerId: import_v418.z.string()
|
|
3476
3605
|
})
|
|
3477
3606
|
)
|
|
3478
3607
|
);
|
|
3479
|
-
var codeInterpreterOutputSchema = (0,
|
|
3480
|
-
() => (0,
|
|
3481
|
-
|
|
3482
|
-
outputs:
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3608
|
+
var codeInterpreterOutputSchema = (0, import_provider_utils25.lazySchema)(
|
|
3609
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3610
|
+
import_v418.z.object({
|
|
3611
|
+
outputs: import_v418.z.array(
|
|
3612
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3613
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3614
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3486
3615
|
])
|
|
3487
3616
|
).nullish()
|
|
3488
3617
|
})
|
|
3489
3618
|
)
|
|
3490
3619
|
);
|
|
3491
|
-
var codeInterpreterArgsSchema = (0,
|
|
3492
|
-
() => (0,
|
|
3493
|
-
|
|
3494
|
-
container:
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
fileIds:
|
|
3620
|
+
var codeInterpreterArgsSchema = (0, import_provider_utils25.lazySchema)(
|
|
3621
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3622
|
+
import_v418.z.object({
|
|
3623
|
+
container: import_v418.z.union([
|
|
3624
|
+
import_v418.z.string(),
|
|
3625
|
+
import_v418.z.object({
|
|
3626
|
+
fileIds: import_v418.z.array(import_v418.z.string()).optional()
|
|
3498
3627
|
})
|
|
3499
3628
|
]).optional()
|
|
3500
3629
|
})
|
|
3501
3630
|
)
|
|
3502
3631
|
);
|
|
3503
|
-
var codeInterpreterToolFactory = (0,
|
|
3632
|
+
var codeInterpreterToolFactory = (0, import_provider_utils25.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
3504
3633
|
id: "openai.code_interpreter",
|
|
3505
3634
|
name: "code_interpreter",
|
|
3506
3635
|
inputSchema: codeInterpreterInputSchema,
|
|
@@ -3511,112 +3640,54 @@ var codeInterpreter = (args = {}) => {
|
|
|
3511
3640
|
};
|
|
3512
3641
|
|
|
3513
3642
|
// 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
|
-
)
|
|
3643
|
+
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
3644
|
+
var import_v419 = require("zod/v4");
|
|
3645
|
+
var comparisonFilterSchema = import_v419.z.object({
|
|
3646
|
+
key: import_v419.z.string(),
|
|
3647
|
+
type: import_v419.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
3648
|
+
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
3649
|
});
|
|
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
|
-
})
|
|
3650
|
+
var compoundFilterSchema = import_v419.z.object({
|
|
3651
|
+
type: import_v419.z.enum(["and", "or"]),
|
|
3652
|
+
filters: import_v419.z.array(
|
|
3653
|
+
import_v419.z.union([comparisonFilterSchema, import_v419.z.lazy(() => compoundFilterSchema)])
|
|
3554
3654
|
)
|
|
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
3655
|
});
|
|
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)(
|
|
3656
|
+
var fileSearchArgsSchema = (0, import_provider_utils26.lazySchema)(
|
|
3567
3657
|
() => (0, import_provider_utils26.zodSchema)(
|
|
3568
3658
|
import_v419.z.object({
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3659
|
+
vectorStoreIds: import_v419.z.array(import_v419.z.string()),
|
|
3660
|
+
maxNumResults: import_v419.z.number().optional(),
|
|
3661
|
+
ranking: import_v419.z.object({
|
|
3662
|
+
ranker: import_v419.z.string().optional(),
|
|
3663
|
+
scoreThreshold: import_v419.z.number().optional()
|
|
3573
3664
|
}).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()
|
|
3665
|
+
filters: import_v419.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
3582
3666
|
})
|
|
3583
3667
|
)
|
|
3584
3668
|
);
|
|
3585
|
-
var
|
|
3586
|
-
var webSearchOutputSchema = (0, import_provider_utils26.lazySchema)(
|
|
3669
|
+
var fileSearchOutputSchema = (0, import_provider_utils26.lazySchema)(
|
|
3587
3670
|
() => (0, import_provider_utils26.zodSchema)(
|
|
3588
3671
|
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
|
-
}),
|
|
3672
|
+
queries: import_v419.z.array(import_v419.z.string()),
|
|
3673
|
+
results: import_v419.z.array(
|
|
3598
3674
|
import_v419.z.object({
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3675
|
+
attributes: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()),
|
|
3676
|
+
fileId: import_v419.z.string(),
|
|
3677
|
+
filename: import_v419.z.string(),
|
|
3678
|
+
score: import_v419.z.number(),
|
|
3679
|
+
text: import_v419.z.string()
|
|
3602
3680
|
})
|
|
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()
|
|
3681
|
+
).nullable()
|
|
3610
3682
|
})
|
|
3611
3683
|
)
|
|
3612
3684
|
);
|
|
3613
|
-
var
|
|
3614
|
-
id: "openai.
|
|
3615
|
-
name: "
|
|
3616
|
-
inputSchema:
|
|
3617
|
-
outputSchema:
|
|
3685
|
+
var fileSearch = (0, import_provider_utils26.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
3686
|
+
id: "openai.file_search",
|
|
3687
|
+
name: "file_search",
|
|
3688
|
+
inputSchema: import_v419.z.object({}),
|
|
3689
|
+
outputSchema: fileSearchOutputSchema
|
|
3618
3690
|
});
|
|
3619
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
3620
3691
|
|
|
3621
3692
|
// src/tool/web-search-preview.ts
|
|
3622
3693
|
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
@@ -3953,6 +4024,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3953
4024
|
modelCapabilities,
|
|
3954
4025
|
options: openaiOptions
|
|
3955
4026
|
});
|
|
4027
|
+
const webSearchToolName = (_a2 = tools == null ? void 0 : tools.find(
|
|
4028
|
+
(tool) => tool.type === "provider-defined" && (tool.id === "openai.web_search" || tool.id === "openai.web_search_preview")
|
|
4029
|
+
)) == null ? void 0 : _a2.name;
|
|
3956
4030
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
3957
4031
|
prompt,
|
|
3958
4032
|
configurationUpdateUnsupportedReason,
|
|
@@ -3960,8 +4034,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3960
4034
|
systemMessageMode: modelCapabilities.systemMessageMode,
|
|
3961
4035
|
explicitMessageItemType: this.config.explicitMessageItemType,
|
|
3962
4036
|
fileIdPrefixes: this.config.fileIdPrefixes,
|
|
3963
|
-
store: (
|
|
3964
|
-
|
|
4037
|
+
store: (_b = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _b : true,
|
|
4038
|
+
isReasoningModel: modelCapabilities.isReasoningModel,
|
|
4039
|
+
hasLocalShellTool: hasOpenAITool("openai.local_shell"),
|
|
4040
|
+
webSearchToolName
|
|
3965
4041
|
});
|
|
3966
4042
|
warnings.push(...inputWarnings);
|
|
3967
4043
|
let resolvedReasoningEffort = openaiOptions == null ? void 0 : openaiOptions.reasoningEffort;
|
|
@@ -3998,7 +4074,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3998
4074
|
});
|
|
3999
4075
|
}
|
|
4000
4076
|
}
|
|
4001
|
-
const strictJsonSchema = (
|
|
4077
|
+
const strictJsonSchema = (_c = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _c : false;
|
|
4002
4078
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
4003
4079
|
function addInclude(key) {
|
|
4004
4080
|
if (include == null) {
|
|
@@ -4016,9 +4092,6 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4016
4092
|
if (topLogprobs) {
|
|
4017
4093
|
addInclude("message.output_text.logprobs");
|
|
4018
4094
|
}
|
|
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
4095
|
if (webSearchToolName) {
|
|
4023
4096
|
addInclude("web_search_call.action.sources");
|
|
4024
4097
|
}
|