@openrouter/sdk 0.13.38 → 0.13.39
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/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/additionaltoolsitem.d.ts +117 -0
- package/esm/models/additionaltoolsitem.js +152 -0
- package/esm/models/applypatchservertool.d.ts +11 -2
- package/esm/models/applypatchservertool.js +9 -2
- package/esm/models/applypatchservertoolopenrouter.d.ts +9 -2
- package/esm/models/applypatchservertoolopenrouter.js +6 -1
- package/esm/models/codeinterpreterservertool.d.ts +10 -2
- package/esm/models/codeinterpreterservertool.js +9 -2
- package/esm/models/codexlocalshelltool.d.ts +11 -2
- package/esm/models/codexlocalshelltool.js +9 -2
- package/esm/models/computeruseservertool.d.ts +11 -3
- package/esm/models/computeruseservertool.js +9 -2
- package/esm/models/customtool.d.ts +11 -3
- package/esm/models/customtool.js +9 -2
- package/esm/models/filesearchservertool.d.ts +11 -3
- package/esm/models/filesearchservertool.js +10 -2
- package/esm/models/imagegenerationservertool.d.ts +11 -3
- package/esm/models/imagegenerationservertool.js +9 -2
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/inputsunion.d.ts +5 -4
- package/esm/models/inputsunion.js +3 -0
- package/esm/models/legacywebsearchservertool.d.ts +11 -2
- package/esm/models/legacywebsearchservertool.js +9 -2
- package/esm/models/mcpservertool.d.ts +10 -2
- package/esm/models/mcpservertool.js +9 -2
- package/esm/models/openresponsesresult.d.ts +54 -2
- package/esm/models/openresponsesresult.js +26 -26
- package/esm/models/preview20250311websearchservertool.d.ts +11 -2
- package/esm/models/preview20250311websearchservertool.js +9 -2
- package/esm/models/previewwebsearchservertool.d.ts +11 -2
- package/esm/models/previewwebsearchservertool.js +9 -2
- package/esm/models/responsesrequest.d.ts +140 -12
- package/esm/models/responsesrequest.js +32 -32
- package/esm/models/shellservertool.d.ts +11 -2
- package/esm/models/shellservertool.js +9 -2
- package/esm/models/shellservertoolopenrouter.d.ts +9 -2
- package/esm/models/shellservertoolopenrouter.js +6 -1
- package/esm/models/websearchservertool.d.ts +11 -2
- package/esm/models/websearchservertool.js +9 -2
- package/esm/models/websearchservertoolopenrouter.d.ts +9 -2
- package/esm/models/websearchservertoolopenrouter.js +6 -1
- package/jsr.json +1 -1
- package/package.json +6 -6
package/esm/models/customtool.js
CHANGED
|
@@ -10,6 +10,9 @@ export const Syntax = {
|
|
|
10
10
|
Lark: "lark",
|
|
11
11
|
Regex: "regex",
|
|
12
12
|
};
|
|
13
|
+
export const CustomToolTypeCustom = {
|
|
14
|
+
Custom: "custom",
|
|
15
|
+
};
|
|
13
16
|
/** @internal */
|
|
14
17
|
export const Syntax$inboundSchema = openEnums
|
|
15
18
|
.inboundSchema(Syntax);
|
|
@@ -68,6 +71,10 @@ export function formatFromJSON(jsonString) {
|
|
|
68
71
|
return safeParse(jsonString, (x) => Format$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Format' from JSON`);
|
|
69
72
|
}
|
|
70
73
|
/** @internal */
|
|
74
|
+
export const CustomToolTypeCustom$inboundSchema = z.enum(CustomToolTypeCustom);
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const CustomToolTypeCustom$outboundSchema = CustomToolTypeCustom$inboundSchema;
|
|
77
|
+
/** @internal */
|
|
71
78
|
export const CustomTool$inboundSchema = z
|
|
72
79
|
.object({
|
|
73
80
|
description: z.string().optional(),
|
|
@@ -76,7 +83,7 @@ export const CustomTool$inboundSchema = z
|
|
|
76
83
|
grammar: z.lazy(() => FormatGrammar$inboundSchema),
|
|
77
84
|
}).optional(),
|
|
78
85
|
name: z.string(),
|
|
79
|
-
type:
|
|
86
|
+
type: CustomToolTypeCustom$inboundSchema,
|
|
80
87
|
});
|
|
81
88
|
/** @internal */
|
|
82
89
|
export const CustomTool$outboundSchema = z.object({
|
|
@@ -86,7 +93,7 @@ export const CustomTool$outboundSchema = z.object({
|
|
|
86
93
|
z.lazy(() => FormatGrammar$outboundSchema),
|
|
87
94
|
]).optional(),
|
|
88
95
|
name: z.string(),
|
|
89
|
-
type:
|
|
96
|
+
type: CustomToolTypeCustom$outboundSchema,
|
|
90
97
|
});
|
|
91
98
|
export function customToolToJSON(customTool) {
|
|
92
99
|
return JSON.stringify(CustomTool$outboundSchema.parse(customTool));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { CompoundFilter, CompoundFilter$Outbound } from "./compoundfilter.js";
|
|
5
5
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
@@ -29,6 +29,10 @@ export type RankingOptions = {
|
|
|
29
29
|
ranker?: Ranker | undefined;
|
|
30
30
|
scoreThreshold?: number | undefined;
|
|
31
31
|
};
|
|
32
|
+
export declare const TypeFileSearch: {
|
|
33
|
+
readonly FileSearch: "file_search";
|
|
34
|
+
};
|
|
35
|
+
export type TypeFileSearch = ClosedEnum<typeof TypeFileSearch>;
|
|
32
36
|
/**
|
|
33
37
|
* File search tool configuration
|
|
34
38
|
*/
|
|
@@ -36,7 +40,7 @@ export type FileSearchServerTool = {
|
|
|
36
40
|
filters?: Filters | CompoundFilter | any | null | undefined;
|
|
37
41
|
maxNumResults?: number | undefined;
|
|
38
42
|
rankingOptions?: RankingOptions | undefined;
|
|
39
|
-
type:
|
|
43
|
+
type: TypeFileSearch;
|
|
40
44
|
vectorStoreIds: Array<string>;
|
|
41
45
|
};
|
|
42
46
|
/** @internal */
|
|
@@ -95,13 +99,17 @@ export declare const RankingOptions$outboundSchema: z.ZodType<RankingOptions$Out
|
|
|
95
99
|
export declare function rankingOptionsToJSON(rankingOptions: RankingOptions): string;
|
|
96
100
|
export declare function rankingOptionsFromJSON(jsonString: string): SafeParseResult<RankingOptions, SDKValidationError>;
|
|
97
101
|
/** @internal */
|
|
102
|
+
export declare const TypeFileSearch$inboundSchema: z.ZodEnum<typeof TypeFileSearch>;
|
|
103
|
+
/** @internal */
|
|
104
|
+
export declare const TypeFileSearch$outboundSchema: z.ZodEnum<typeof TypeFileSearch>;
|
|
105
|
+
/** @internal */
|
|
98
106
|
export declare const FileSearchServerTool$inboundSchema: z.ZodType<FileSearchServerTool, unknown>;
|
|
99
107
|
/** @internal */
|
|
100
108
|
export type FileSearchServerTool$Outbound = {
|
|
101
109
|
filters?: Filters$Outbound | CompoundFilter$Outbound | any | null | undefined;
|
|
102
110
|
max_num_results?: number | undefined;
|
|
103
111
|
ranking_options?: RankingOptions$Outbound | undefined;
|
|
104
|
-
type:
|
|
112
|
+
type: string;
|
|
105
113
|
vector_store_ids: Array<string>;
|
|
106
114
|
};
|
|
107
115
|
/** @internal */
|
|
@@ -19,6 +19,9 @@ export const Ranker = {
|
|
|
19
19
|
Auto: "auto",
|
|
20
20
|
Default20241115: "default-2024-11-15",
|
|
21
21
|
};
|
|
22
|
+
export const TypeFileSearch = {
|
|
23
|
+
FileSearch: "file_search",
|
|
24
|
+
};
|
|
22
25
|
/** @internal */
|
|
23
26
|
export const FiltersType$inboundSchema = openEnums.inboundSchema(FiltersType);
|
|
24
27
|
/** @internal */
|
|
@@ -132,6 +135,11 @@ export function rankingOptionsFromJSON(jsonString) {
|
|
|
132
135
|
return safeParse(jsonString, (x) => RankingOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RankingOptions' from JSON`);
|
|
133
136
|
}
|
|
134
137
|
/** @internal */
|
|
138
|
+
export const TypeFileSearch$inboundSchema = z
|
|
139
|
+
.enum(TypeFileSearch);
|
|
140
|
+
/** @internal */
|
|
141
|
+
export const TypeFileSearch$outboundSchema = TypeFileSearch$inboundSchema;
|
|
142
|
+
/** @internal */
|
|
135
143
|
export const FileSearchServerTool$inboundSchema = z.object({
|
|
136
144
|
filters: z.nullable(z.union([
|
|
137
145
|
z.lazy(() => Filters$inboundSchema),
|
|
@@ -140,7 +148,7 @@ export const FileSearchServerTool$inboundSchema = z.object({
|
|
|
140
148
|
])).optional(),
|
|
141
149
|
max_num_results: z.int().optional(),
|
|
142
150
|
ranking_options: z.lazy(() => RankingOptions$inboundSchema).optional(),
|
|
143
|
-
type:
|
|
151
|
+
type: TypeFileSearch$inboundSchema,
|
|
144
152
|
vector_store_ids: z.array(z.string()),
|
|
145
153
|
}).transform((v) => {
|
|
146
154
|
return remap$(v, {
|
|
@@ -158,7 +166,7 @@ export const FileSearchServerTool$outboundSchema = z.object({
|
|
|
158
166
|
])).optional(),
|
|
159
167
|
maxNumResults: z.int().optional(),
|
|
160
168
|
rankingOptions: z.lazy(() => RankingOptions$outboundSchema).optional(),
|
|
161
|
-
type:
|
|
169
|
+
type: TypeFileSearch$outboundSchema,
|
|
162
170
|
vectorStoreIds: z.array(z.string()),
|
|
163
171
|
}).transform((v) => {
|
|
164
172
|
return remap$(v, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
export declare const ImageGenerationServerToolBackground: {
|
|
@@ -35,6 +35,10 @@ export declare const ImageGenerationServerToolQuality: {
|
|
|
35
35
|
readonly Auto: "auto";
|
|
36
36
|
};
|
|
37
37
|
export type ImageGenerationServerToolQuality = OpenEnum<typeof ImageGenerationServerToolQuality>;
|
|
38
|
+
export declare const ImageGenerationServerToolType: {
|
|
39
|
+
readonly ImageGeneration: "image_generation";
|
|
40
|
+
};
|
|
41
|
+
export type ImageGenerationServerToolType = ClosedEnum<typeof ImageGenerationServerToolType>;
|
|
38
42
|
/**
|
|
39
43
|
* Image generation tool configuration
|
|
40
44
|
*/
|
|
@@ -49,7 +53,7 @@ export type ImageGenerationServerTool = {
|
|
|
49
53
|
partialImages?: number | undefined;
|
|
50
54
|
quality?: ImageGenerationServerToolQuality | undefined;
|
|
51
55
|
size?: string | undefined;
|
|
52
|
-
type:
|
|
56
|
+
type: ImageGenerationServerToolType;
|
|
53
57
|
};
|
|
54
58
|
/** @internal */
|
|
55
59
|
export declare const ImageGenerationServerToolBackground$inboundSchema: z.ZodType<ImageGenerationServerToolBackground, unknown>;
|
|
@@ -83,6 +87,10 @@ export declare const ImageGenerationServerToolQuality$inboundSchema: z.ZodType<I
|
|
|
83
87
|
/** @internal */
|
|
84
88
|
export declare const ImageGenerationServerToolQuality$outboundSchema: z.ZodType<string, ImageGenerationServerToolQuality>;
|
|
85
89
|
/** @internal */
|
|
90
|
+
export declare const ImageGenerationServerToolType$inboundSchema: z.ZodEnum<typeof ImageGenerationServerToolType>;
|
|
91
|
+
/** @internal */
|
|
92
|
+
export declare const ImageGenerationServerToolType$outboundSchema: z.ZodEnum<typeof ImageGenerationServerToolType>;
|
|
93
|
+
/** @internal */
|
|
86
94
|
export declare const ImageGenerationServerTool$inboundSchema: z.ZodType<ImageGenerationServerTool, unknown>;
|
|
87
95
|
/** @internal */
|
|
88
96
|
export type ImageGenerationServerTool$Outbound = {
|
|
@@ -96,7 +104,7 @@ export type ImageGenerationServerTool$Outbound = {
|
|
|
96
104
|
partial_images?: number | undefined;
|
|
97
105
|
quality?: string | undefined;
|
|
98
106
|
size?: string | undefined;
|
|
99
|
-
type:
|
|
107
|
+
type: string;
|
|
100
108
|
};
|
|
101
109
|
/** @internal */
|
|
102
110
|
export declare const ImageGenerationServerTool$outboundSchema: z.ZodType<ImageGenerationServerTool$Outbound, ImageGenerationServerTool>;
|
|
@@ -30,6 +30,9 @@ export const ImageGenerationServerToolQuality = {
|
|
|
30
30
|
High: "high",
|
|
31
31
|
Auto: "auto",
|
|
32
32
|
};
|
|
33
|
+
export const ImageGenerationServerToolType = {
|
|
34
|
+
ImageGeneration: "image_generation",
|
|
35
|
+
};
|
|
33
36
|
/** @internal */
|
|
34
37
|
export const ImageGenerationServerToolBackground$inboundSchema = openEnums.inboundSchema(ImageGenerationServerToolBackground);
|
|
35
38
|
/** @internal */
|
|
@@ -77,6 +80,10 @@ export const ImageGenerationServerToolQuality$inboundSchema = openEnums.inboundS
|
|
|
77
80
|
/** @internal */
|
|
78
81
|
export const ImageGenerationServerToolQuality$outboundSchema = openEnums.outboundSchema(ImageGenerationServerToolQuality);
|
|
79
82
|
/** @internal */
|
|
83
|
+
export const ImageGenerationServerToolType$inboundSchema = z.enum(ImageGenerationServerToolType);
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const ImageGenerationServerToolType$outboundSchema = ImageGenerationServerToolType$inboundSchema;
|
|
86
|
+
/** @internal */
|
|
80
87
|
export const ImageGenerationServerTool$inboundSchema = z.object({
|
|
81
88
|
background: ImageGenerationServerToolBackground$inboundSchema.optional(),
|
|
82
89
|
input_fidelity: z.nullable(InputFidelity$inboundSchema).optional(),
|
|
@@ -88,7 +95,7 @@ export const ImageGenerationServerTool$inboundSchema = z.object({
|
|
|
88
95
|
partial_images: z.int().optional(),
|
|
89
96
|
quality: ImageGenerationServerToolQuality$inboundSchema.optional(),
|
|
90
97
|
size: z.string().optional(),
|
|
91
|
-
type:
|
|
98
|
+
type: ImageGenerationServerToolType$inboundSchema,
|
|
92
99
|
}).transform((v) => {
|
|
93
100
|
return remap$(v, {
|
|
94
101
|
"input_fidelity": "inputFidelity",
|
|
@@ -110,7 +117,7 @@ export const ImageGenerationServerTool$outboundSchema = z.object({
|
|
|
110
117
|
partialImages: z.int().optional(),
|
|
111
118
|
quality: ImageGenerationServerToolQuality$outboundSchema.optional(),
|
|
112
119
|
size: z.string().optional(),
|
|
113
|
-
type:
|
|
120
|
+
type: ImageGenerationServerToolType$outboundSchema,
|
|
114
121
|
}).transform((v) => {
|
|
115
122
|
return remap$(v, {
|
|
116
123
|
inputFidelity: "input_fidelity",
|
package/esm/models/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./aabenchmarkentry.js";
|
|
2
2
|
export * from "./activityitem.js";
|
|
3
3
|
export * from "./activityresponse.js";
|
|
4
|
+
export * from "./additionaltoolsitem.js";
|
|
4
5
|
export * from "./advisornestedtool.js";
|
|
5
6
|
export * from "./advisorreasoning.js";
|
|
6
7
|
export * from "./advisorservertoolconfig.js";
|
package/esm/models/index.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export * from "./aabenchmarkentry.js";
|
|
6
6
|
export * from "./activityitem.js";
|
|
7
7
|
export * from "./activityresponse.js";
|
|
8
|
+
export * from "./additionaltoolsitem.js";
|
|
8
9
|
export * from "./advisornestedtool.js";
|
|
9
10
|
export * from "./advisorreasoning.js";
|
|
10
11
|
export * from "./advisorservertoolconfig.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { AdditionalToolsItem, AdditionalToolsItem$Outbound } from "./additionaltoolsitem.js";
|
|
3
4
|
import { ApplyPatchCallItem, ApplyPatchCallItem$Outbound } from "./applypatchcallitem.js";
|
|
4
5
|
import { ApplyPatchCallOutputItem, ApplyPatchCallOutputItem$Outbound } from "./applypatchcalloutputitem.js";
|
|
5
6
|
import { CompactionItem, CompactionItem$Outbound } from "./compactionitem.js";
|
|
@@ -131,11 +132,11 @@ export type InputsMessage = {
|
|
|
131
132
|
status?: InputsStatusCompleted1 | InputsStatusIncomplete1 | InputsStatusInProgress1 | undefined;
|
|
132
133
|
type: InputsTypeMessage;
|
|
133
134
|
};
|
|
134
|
-
export type InputsUnion1 = OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem;
|
|
135
|
+
export type InputsUnion1 = OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem;
|
|
135
136
|
/**
|
|
136
137
|
* Input for a response request - can be a string or array of items
|
|
137
138
|
*/
|
|
138
|
-
export type InputsUnion = string | Array<OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem>;
|
|
139
|
+
export type InputsUnion = string | Array<OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem>;
|
|
139
140
|
/** @internal */
|
|
140
141
|
export declare const InputsStatusInProgress2$outboundSchema: z.ZodEnum<typeof InputsStatusInProgress2>;
|
|
141
142
|
/** @internal */
|
|
@@ -210,12 +211,12 @@ export type InputsMessage$Outbound = {
|
|
|
210
211
|
export declare const InputsMessage$outboundSchema: z.ZodType<InputsMessage$Outbound, InputsMessage>;
|
|
211
212
|
export declare function inputsMessageToJSON(inputsMessage: InputsMessage): string;
|
|
212
213
|
/** @internal */
|
|
213
|
-
export type InputsUnion1$Outbound = OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound;
|
|
214
|
+
export type InputsUnion1$Outbound = OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound;
|
|
214
215
|
/** @internal */
|
|
215
216
|
export declare const InputsUnion1$outboundSchema: z.ZodType<InputsUnion1$Outbound, InputsUnion1>;
|
|
216
217
|
export declare function inputsUnion1ToJSON(inputsUnion1: InputsUnion1): string;
|
|
217
218
|
/** @internal */
|
|
218
|
-
export type InputsUnion$Outbound = string | Array<OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound>;
|
|
219
|
+
export type InputsUnion$Outbound = string | Array<OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound>;
|
|
219
220
|
/** @internal */
|
|
220
221
|
export declare const InputsUnion$outboundSchema: z.ZodType<InputsUnion$Outbound, InputsUnion>;
|
|
221
222
|
export declare function inputsUnionToJSON(inputsUnion: InputsUnion): string;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { AdditionalToolsItem$outboundSchema, } from "./additionaltoolsitem.js";
|
|
7
8
|
import { ApplyPatchCallItem$outboundSchema, } from "./applypatchcallitem.js";
|
|
8
9
|
import { ApplyPatchCallOutputItem$outboundSchema, } from "./applypatchcalloutputitem.js";
|
|
9
10
|
import { CompactionItem$outboundSchema, } from "./compactionitem.js";
|
|
@@ -231,6 +232,7 @@ export const InputsUnion1$outboundSchema = z.union([
|
|
|
231
232
|
ShellCallOutputItem$outboundSchema,
|
|
232
233
|
McpApprovalResponseItem$outboundSchema,
|
|
233
234
|
CustomToolCallOutputItem$outboundSchema,
|
|
235
|
+
AdditionalToolsItem$outboundSchema,
|
|
234
236
|
OutputWebSearchServerToolItem$outboundSchema,
|
|
235
237
|
OutputCodeInterpreterServerToolItem$outboundSchema,
|
|
236
238
|
OutputFileSearchServerToolItem$outboundSchema,
|
|
@@ -285,6 +287,7 @@ export const InputsUnion$outboundSchema = z.union([
|
|
|
285
287
|
ShellCallOutputItem$outboundSchema,
|
|
286
288
|
McpApprovalResponseItem$outboundSchema,
|
|
287
289
|
CustomToolCallOutputItem$outboundSchema,
|
|
290
|
+
AdditionalToolsItem$outboundSchema,
|
|
288
291
|
OutputWebSearchServerToolItem$outboundSchema,
|
|
289
292
|
OutputCodeInterpreterServerToolItem$outboundSchema,
|
|
290
293
|
OutputFileSearchServerToolItem$outboundSchema,
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
2
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
5
|
import { SearchContextSizeEnum } from "./searchcontextsizeenum.js";
|
|
5
6
|
import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websearchdomainfilter.js";
|
|
6
7
|
import { WebSearchEngineEnum } from "./websearchengineenum.js";
|
|
7
8
|
import { WebSearchUserLocation, WebSearchUserLocation$Outbound } from "./websearchuserlocation.js";
|
|
9
|
+
export declare const LegacyWebSearchServerToolType: {
|
|
10
|
+
readonly WebSearch: "web_search";
|
|
11
|
+
};
|
|
12
|
+
export type LegacyWebSearchServerToolType = ClosedEnum<typeof LegacyWebSearchServerToolType>;
|
|
8
13
|
/**
|
|
9
14
|
* Web search tool configuration
|
|
10
15
|
*/
|
|
@@ -22,13 +27,17 @@ export type LegacyWebSearchServerTool = {
|
|
|
22
27
|
* Size of the search context for web search tools
|
|
23
28
|
*/
|
|
24
29
|
searchContextSize?: SearchContextSizeEnum | undefined;
|
|
25
|
-
type:
|
|
30
|
+
type: LegacyWebSearchServerToolType;
|
|
26
31
|
/**
|
|
27
32
|
* User location information for web search
|
|
28
33
|
*/
|
|
29
34
|
userLocation?: WebSearchUserLocation | null | undefined;
|
|
30
35
|
};
|
|
31
36
|
/** @internal */
|
|
37
|
+
export declare const LegacyWebSearchServerToolType$inboundSchema: z.ZodEnum<typeof LegacyWebSearchServerToolType>;
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const LegacyWebSearchServerToolType$outboundSchema: z.ZodEnum<typeof LegacyWebSearchServerToolType>;
|
|
40
|
+
/** @internal */
|
|
32
41
|
export declare const LegacyWebSearchServerTool$inboundSchema: z.ZodType<LegacyWebSearchServerTool, unknown>;
|
|
33
42
|
/** @internal */
|
|
34
43
|
export type LegacyWebSearchServerTool$Outbound = {
|
|
@@ -36,7 +45,7 @@ export type LegacyWebSearchServerTool$Outbound = {
|
|
|
36
45
|
filters?: WebSearchDomainFilter$Outbound | null | undefined;
|
|
37
46
|
max_results?: number | undefined;
|
|
38
47
|
search_context_size?: string | undefined;
|
|
39
|
-
type:
|
|
48
|
+
type: string;
|
|
40
49
|
user_location?: WebSearchUserLocation$Outbound | null | undefined;
|
|
41
50
|
};
|
|
42
51
|
/** @internal */
|
|
@@ -9,13 +9,20 @@ import { SearchContextSizeEnum$inboundSchema, SearchContextSizeEnum$outboundSche
|
|
|
9
9
|
import { WebSearchDomainFilter$inboundSchema, WebSearchDomainFilter$outboundSchema, } from "./websearchdomainfilter.js";
|
|
10
10
|
import { WebSearchEngineEnum$inboundSchema, WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
|
|
11
11
|
import { WebSearchUserLocation$inboundSchema, WebSearchUserLocation$outboundSchema, } from "./websearchuserlocation.js";
|
|
12
|
+
export const LegacyWebSearchServerToolType = {
|
|
13
|
+
WebSearch: "web_search",
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const LegacyWebSearchServerToolType$inboundSchema = z.enum(LegacyWebSearchServerToolType);
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const LegacyWebSearchServerToolType$outboundSchema = LegacyWebSearchServerToolType$inboundSchema;
|
|
12
19
|
/** @internal */
|
|
13
20
|
export const LegacyWebSearchServerTool$inboundSchema = z.object({
|
|
14
21
|
engine: WebSearchEngineEnum$inboundSchema.optional(),
|
|
15
22
|
filters: z.nullable(WebSearchDomainFilter$inboundSchema).optional(),
|
|
16
23
|
max_results: z.int().optional(),
|
|
17
24
|
search_context_size: SearchContextSizeEnum$inboundSchema.optional(),
|
|
18
|
-
type:
|
|
25
|
+
type: LegacyWebSearchServerToolType$inboundSchema,
|
|
19
26
|
user_location: z.nullable(WebSearchUserLocation$inboundSchema).optional(),
|
|
20
27
|
}).transform((v) => {
|
|
21
28
|
return remap$(v, {
|
|
@@ -30,7 +37,7 @@ export const LegacyWebSearchServerTool$outboundSchema = z.object({
|
|
|
30
37
|
filters: z.nullable(WebSearchDomainFilter$outboundSchema).optional(),
|
|
31
38
|
maxResults: z.int().optional(),
|
|
32
39
|
searchContextSize: SearchContextSizeEnum$outboundSchema.optional(),
|
|
33
|
-
type:
|
|
40
|
+
type: LegacyWebSearchServerToolType$outboundSchema,
|
|
34
41
|
userLocation: z.nullable(WebSearchUserLocation$outboundSchema).optional(),
|
|
35
42
|
}).transform((v) => {
|
|
36
43
|
return remap$(v, {
|
|
@@ -37,6 +37,10 @@ export type RequireApproval = {
|
|
|
37
37
|
never?: Never | undefined;
|
|
38
38
|
};
|
|
39
39
|
export type RequireApprovalUnion = RequireApproval | RequireApprovalAlways | RequireApprovalNever | any;
|
|
40
|
+
export declare const McpServerToolType: {
|
|
41
|
+
readonly Mcp: "mcp";
|
|
42
|
+
};
|
|
43
|
+
export type McpServerToolType = ClosedEnum<typeof McpServerToolType>;
|
|
40
44
|
/**
|
|
41
45
|
* MCP (Model Context Protocol) tool configuration
|
|
42
46
|
*/
|
|
@@ -51,7 +55,7 @@ export type McpServerTool = {
|
|
|
51
55
|
serverDescription?: string | undefined;
|
|
52
56
|
serverLabel: string;
|
|
53
57
|
serverUrl?: string | undefined;
|
|
54
|
-
type:
|
|
58
|
+
type: McpServerToolType;
|
|
55
59
|
};
|
|
56
60
|
/** @internal */
|
|
57
61
|
export declare const AllowedTools$inboundSchema: z.ZodType<AllowedTools, unknown>;
|
|
@@ -124,6 +128,10 @@ export declare const RequireApprovalUnion$outboundSchema: z.ZodType<RequireAppro
|
|
|
124
128
|
export declare function requireApprovalUnionToJSON(requireApprovalUnion: RequireApprovalUnion): string;
|
|
125
129
|
export declare function requireApprovalUnionFromJSON(jsonString: string): SafeParseResult<RequireApprovalUnion, SDKValidationError>;
|
|
126
130
|
/** @internal */
|
|
131
|
+
export declare const McpServerToolType$inboundSchema: z.ZodEnum<typeof McpServerToolType>;
|
|
132
|
+
/** @internal */
|
|
133
|
+
export declare const McpServerToolType$outboundSchema: z.ZodEnum<typeof McpServerToolType>;
|
|
134
|
+
/** @internal */
|
|
127
135
|
export declare const McpServerTool$inboundSchema: z.ZodType<McpServerTool, unknown>;
|
|
128
136
|
/** @internal */
|
|
129
137
|
export type McpServerTool$Outbound = {
|
|
@@ -137,7 +145,7 @@ export type McpServerTool$Outbound = {
|
|
|
137
145
|
server_description?: string | undefined;
|
|
138
146
|
server_label: string;
|
|
139
147
|
server_url?: string | undefined;
|
|
140
|
-
type:
|
|
148
|
+
type: string;
|
|
141
149
|
};
|
|
142
150
|
/** @internal */
|
|
143
151
|
export declare const McpServerTool$outboundSchema: z.ZodType<McpServerTool$Outbound, McpServerTool>;
|
|
@@ -22,6 +22,9 @@ export const RequireApprovalNever = {
|
|
|
22
22
|
export const RequireApprovalAlways = {
|
|
23
23
|
Always: "always",
|
|
24
24
|
};
|
|
25
|
+
export const McpServerToolType = {
|
|
26
|
+
Mcp: "mcp",
|
|
27
|
+
};
|
|
25
28
|
/** @internal */
|
|
26
29
|
export const AllowedTools$inboundSchema = z
|
|
27
30
|
.object({
|
|
@@ -161,6 +164,10 @@ export function requireApprovalUnionFromJSON(jsonString) {
|
|
|
161
164
|
return safeParse(jsonString, (x) => RequireApprovalUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequireApprovalUnion' from JSON`);
|
|
162
165
|
}
|
|
163
166
|
/** @internal */
|
|
167
|
+
export const McpServerToolType$inboundSchema = z.enum(McpServerToolType);
|
|
168
|
+
/** @internal */
|
|
169
|
+
export const McpServerToolType$outboundSchema = McpServerToolType$inboundSchema;
|
|
170
|
+
/** @internal */
|
|
164
171
|
export const McpServerTool$inboundSchema = z
|
|
165
172
|
.object({
|
|
166
173
|
allowed_tools: z.nullable(z.union([
|
|
@@ -180,7 +187,7 @@ export const McpServerTool$inboundSchema = z
|
|
|
180
187
|
server_description: z.string().optional(),
|
|
181
188
|
server_label: z.string(),
|
|
182
189
|
server_url: z.string().optional(),
|
|
183
|
-
type:
|
|
190
|
+
type: McpServerToolType$inboundSchema,
|
|
184
191
|
}).transform((v) => {
|
|
185
192
|
return remap$(v, {
|
|
186
193
|
"allowed_tools": "allowedTools",
|
|
@@ -210,7 +217,7 @@ export const McpServerTool$outboundSchema = z.object({
|
|
|
210
217
|
serverDescription: z.string().optional(),
|
|
211
218
|
serverLabel: z.string(),
|
|
212
219
|
serverUrl: z.string().optional(),
|
|
213
|
-
type:
|
|
220
|
+
type: McpServerToolType$outboundSchema,
|
|
214
221
|
}).transform((v) => {
|
|
215
222
|
return remap$(v, {
|
|
216
223
|
allowedTools: "allowed_tools",
|
|
@@ -45,7 +45,33 @@ export type OpenResponsesResultToolFunction = {
|
|
|
45
45
|
strict?: boolean | null | undefined;
|
|
46
46
|
type: "function";
|
|
47
47
|
};
|
|
48
|
-
export type OpenResponsesResultToolUnion = OpenResponsesResultToolFunction | PreviewWebSearchServerTool
|
|
48
|
+
export type OpenResponsesResultToolUnion = OpenResponsesResultToolFunction | (PreviewWebSearchServerTool & {
|
|
49
|
+
type: "web_search_preview";
|
|
50
|
+
}) | (Preview20250311WebSearchServerTool & {
|
|
51
|
+
type: "web_search_preview_2025_03_11";
|
|
52
|
+
}) | (LegacyWebSearchServerTool & {
|
|
53
|
+
type: "web_search";
|
|
54
|
+
}) | (WebSearchServerTool & {
|
|
55
|
+
type: "web_search_2025_08_26";
|
|
56
|
+
}) | (FileSearchServerTool & {
|
|
57
|
+
type: "file_search";
|
|
58
|
+
}) | (ComputerUseServerTool & {
|
|
59
|
+
type: "computer_use_preview";
|
|
60
|
+
}) | (CodeInterpreterServerTool & {
|
|
61
|
+
type: "code_interpreter";
|
|
62
|
+
}) | (McpServerTool & {
|
|
63
|
+
type: "mcp";
|
|
64
|
+
}) | (ImageGenerationServerTool & {
|
|
65
|
+
type: "image_generation";
|
|
66
|
+
}) | (CodexLocalShellTool & {
|
|
67
|
+
type: "local_shell";
|
|
68
|
+
}) | (ShellServerTool & {
|
|
69
|
+
type: "shell";
|
|
70
|
+
}) | (ApplyPatchServerTool & {
|
|
71
|
+
type: "apply_patch";
|
|
72
|
+
}) | (CustomTool & {
|
|
73
|
+
type: "custom";
|
|
74
|
+
}) | discriminatedUnionTypes.Unknown<"type">;
|
|
49
75
|
/**
|
|
50
76
|
* Complete non-streaming response from the Responses API
|
|
51
77
|
*/
|
|
@@ -89,7 +115,33 @@ export type OpenResponsesResult = {
|
|
|
89
115
|
*/
|
|
90
116
|
text?: TextExtendedConfig | undefined;
|
|
91
117
|
toolChoice: OpenAIResponsesToolChoiceUnion;
|
|
92
|
-
tools: Array<OpenResponsesResultToolFunction | PreviewWebSearchServerTool
|
|
118
|
+
tools: Array<OpenResponsesResultToolFunction | (PreviewWebSearchServerTool & {
|
|
119
|
+
type: "web_search_preview";
|
|
120
|
+
}) | (Preview20250311WebSearchServerTool & {
|
|
121
|
+
type: "web_search_preview_2025_03_11";
|
|
122
|
+
}) | (LegacyWebSearchServerTool & {
|
|
123
|
+
type: "web_search";
|
|
124
|
+
}) | (WebSearchServerTool & {
|
|
125
|
+
type: "web_search_2025_08_26";
|
|
126
|
+
}) | (FileSearchServerTool & {
|
|
127
|
+
type: "file_search";
|
|
128
|
+
}) | (ComputerUseServerTool & {
|
|
129
|
+
type: "computer_use_preview";
|
|
130
|
+
}) | (CodeInterpreterServerTool & {
|
|
131
|
+
type: "code_interpreter";
|
|
132
|
+
}) | (McpServerTool & {
|
|
133
|
+
type: "mcp";
|
|
134
|
+
}) | (ImageGenerationServerTool & {
|
|
135
|
+
type: "image_generation";
|
|
136
|
+
}) | (CodexLocalShellTool & {
|
|
137
|
+
type: "local_shell";
|
|
138
|
+
}) | (ShellServerTool & {
|
|
139
|
+
type: "shell";
|
|
140
|
+
}) | (ApplyPatchServerTool & {
|
|
141
|
+
type: "apply_patch";
|
|
142
|
+
}) | (CustomTool & {
|
|
143
|
+
type: "custom";
|
|
144
|
+
}) | discriminatedUnionTypes.Unknown<"type">>;
|
|
93
145
|
topLogprobs?: number | null | undefined;
|
|
94
146
|
topP: number | null;
|
|
95
147
|
truncation?: Truncation | null | undefined;
|
|
@@ -51,19 +51,19 @@ export function openResponsesResultToolFunctionFromJSON(jsonString) {
|
|
|
51
51
|
/** @internal */
|
|
52
52
|
export const OpenResponsesResultToolUnion$inboundSchema = discriminatedUnion("type", {
|
|
53
53
|
function: z.lazy(() => OpenResponsesResultToolFunction$inboundSchema),
|
|
54
|
-
web_search_preview: PreviewWebSearchServerTool$inboundSchema,
|
|
55
|
-
web_search_preview_2025_03_11: Preview20250311WebSearchServerTool$inboundSchema,
|
|
56
|
-
web_search: LegacyWebSearchServerTool$inboundSchema,
|
|
57
|
-
web_search_2025_08_26: WebSearchServerTool$inboundSchema,
|
|
58
|
-
file_search: FileSearchServerTool$inboundSchema,
|
|
59
|
-
computer_use_preview: ComputerUseServerTool$inboundSchema,
|
|
60
|
-
code_interpreter: CodeInterpreterServerTool$inboundSchema,
|
|
61
|
-
mcp: McpServerTool$inboundSchema,
|
|
62
|
-
image_generation: ImageGenerationServerTool$inboundSchema,
|
|
63
|
-
local_shell: CodexLocalShellTool$inboundSchema,
|
|
64
|
-
shell: ShellServerTool$inboundSchema,
|
|
65
|
-
apply_patch: ApplyPatchServerTool$inboundSchema,
|
|
66
|
-
custom: CustomTool$inboundSchema,
|
|
54
|
+
web_search_preview: PreviewWebSearchServerTool$inboundSchema.and(z.object({ type: z.literal("web_search_preview") })),
|
|
55
|
+
web_search_preview_2025_03_11: Preview20250311WebSearchServerTool$inboundSchema.and(z.object({ type: z.literal("web_search_preview_2025_03_11") })),
|
|
56
|
+
web_search: LegacyWebSearchServerTool$inboundSchema.and(z.object({ type: z.literal("web_search") })),
|
|
57
|
+
web_search_2025_08_26: WebSearchServerTool$inboundSchema.and(z.object({ type: z.literal("web_search_2025_08_26") })),
|
|
58
|
+
file_search: FileSearchServerTool$inboundSchema.and(z.object({ type: z.literal("file_search") })),
|
|
59
|
+
computer_use_preview: ComputerUseServerTool$inboundSchema.and(z.object({ type: z.literal("computer_use_preview") })),
|
|
60
|
+
code_interpreter: CodeInterpreterServerTool$inboundSchema.and(z.object({ type: z.literal("code_interpreter") })),
|
|
61
|
+
mcp: McpServerTool$inboundSchema.and(z.object({ type: z.literal("mcp") })),
|
|
62
|
+
image_generation: ImageGenerationServerTool$inboundSchema.and(z.object({ type: z.literal("image_generation") })),
|
|
63
|
+
local_shell: CodexLocalShellTool$inboundSchema.and(z.object({ type: z.literal("local_shell") })),
|
|
64
|
+
shell: ShellServerTool$inboundSchema.and(z.object({ type: z.literal("shell") })),
|
|
65
|
+
apply_patch: ApplyPatchServerTool$inboundSchema.and(z.object({ type: z.literal("apply_patch") })),
|
|
66
|
+
custom: CustomTool$inboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
67
67
|
});
|
|
68
68
|
export function openResponsesResultToolUnionFromJSON(jsonString) {
|
|
69
69
|
return safeParse(jsonString, (x) => OpenResponsesResultToolUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesResultToolUnion' from JSON`);
|
|
@@ -100,19 +100,19 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
100
100
|
tool_choice: OpenAIResponsesToolChoiceUnion$inboundSchema,
|
|
101
101
|
tools: z.array(discriminatedUnion("type", {
|
|
102
102
|
function: z.lazy(() => OpenResponsesResultToolFunction$inboundSchema),
|
|
103
|
-
web_search_preview: PreviewWebSearchServerTool$inboundSchema,
|
|
104
|
-
web_search_preview_2025_03_11: Preview20250311WebSearchServerTool$inboundSchema,
|
|
105
|
-
web_search: LegacyWebSearchServerTool$inboundSchema,
|
|
106
|
-
web_search_2025_08_26: WebSearchServerTool$inboundSchema,
|
|
107
|
-
file_search: FileSearchServerTool$inboundSchema,
|
|
108
|
-
computer_use_preview: ComputerUseServerTool$inboundSchema,
|
|
109
|
-
code_interpreter: CodeInterpreterServerTool$inboundSchema,
|
|
110
|
-
mcp: McpServerTool$inboundSchema,
|
|
111
|
-
image_generation: ImageGenerationServerTool$inboundSchema,
|
|
112
|
-
local_shell: CodexLocalShellTool$inboundSchema,
|
|
113
|
-
shell: ShellServerTool$inboundSchema,
|
|
114
|
-
apply_patch: ApplyPatchServerTool$inboundSchema,
|
|
115
|
-
custom: CustomTool$inboundSchema,
|
|
103
|
+
web_search_preview: PreviewWebSearchServerTool$inboundSchema.and(z.object({ type: z.literal("web_search_preview") })),
|
|
104
|
+
web_search_preview_2025_03_11: Preview20250311WebSearchServerTool$inboundSchema.and(z.object({ type: z.literal("web_search_preview_2025_03_11") })),
|
|
105
|
+
web_search: LegacyWebSearchServerTool$inboundSchema.and(z.object({ type: z.literal("web_search") })),
|
|
106
|
+
web_search_2025_08_26: WebSearchServerTool$inboundSchema.and(z.object({ type: z.literal("web_search_2025_08_26") })),
|
|
107
|
+
file_search: FileSearchServerTool$inboundSchema.and(z.object({ type: z.literal("file_search") })),
|
|
108
|
+
computer_use_preview: ComputerUseServerTool$inboundSchema.and(z.object({ type: z.literal("computer_use_preview") })),
|
|
109
|
+
code_interpreter: CodeInterpreterServerTool$inboundSchema.and(z.object({ type: z.literal("code_interpreter") })),
|
|
110
|
+
mcp: McpServerTool$inboundSchema.and(z.object({ type: z.literal("mcp") })),
|
|
111
|
+
image_generation: ImageGenerationServerTool$inboundSchema.and(z.object({ type: z.literal("image_generation") })),
|
|
112
|
+
local_shell: CodexLocalShellTool$inboundSchema.and(z.object({ type: z.literal("local_shell") })),
|
|
113
|
+
shell: ShellServerTool$inboundSchema.and(z.object({ type: z.literal("shell") })),
|
|
114
|
+
apply_patch: ApplyPatchServerTool$inboundSchema.and(z.object({ type: z.literal("apply_patch") })),
|
|
115
|
+
custom: CustomTool$inboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
116
116
|
})),
|
|
117
117
|
top_logprobs: z.nullable(z.int()).optional(),
|
|
118
118
|
top_p: z.nullable(z.number()),
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
2
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
5
|
import { PreviewWebSearchUserLocation, PreviewWebSearchUserLocation$Outbound } from "./previewwebsearchuserlocation.js";
|
|
5
6
|
import { SearchContextSizeEnum } from "./searchcontextsizeenum.js";
|
|
6
7
|
import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websearchdomainfilter.js";
|
|
7
8
|
import { WebSearchEngineEnum } from "./websearchengineenum.js";
|
|
9
|
+
export declare const Preview20250311WebSearchServerToolType: {
|
|
10
|
+
readonly WebSearchPreview20250311: "web_search_preview_2025_03_11";
|
|
11
|
+
};
|
|
12
|
+
export type Preview20250311WebSearchServerToolType = ClosedEnum<typeof Preview20250311WebSearchServerToolType>;
|
|
8
13
|
/**
|
|
9
14
|
* Web search preview tool configuration (2025-03-11 version)
|
|
10
15
|
*/
|
|
@@ -22,10 +27,14 @@ export type Preview20250311WebSearchServerTool = {
|
|
|
22
27
|
* Size of the search context for web search tools
|
|
23
28
|
*/
|
|
24
29
|
searchContextSize?: SearchContextSizeEnum | undefined;
|
|
25
|
-
type:
|
|
30
|
+
type: Preview20250311WebSearchServerToolType;
|
|
26
31
|
userLocation?: PreviewWebSearchUserLocation | null | undefined;
|
|
27
32
|
};
|
|
28
33
|
/** @internal */
|
|
34
|
+
export declare const Preview20250311WebSearchServerToolType$inboundSchema: z.ZodEnum<typeof Preview20250311WebSearchServerToolType>;
|
|
35
|
+
/** @internal */
|
|
36
|
+
export declare const Preview20250311WebSearchServerToolType$outboundSchema: z.ZodEnum<typeof Preview20250311WebSearchServerToolType>;
|
|
37
|
+
/** @internal */
|
|
29
38
|
export declare const Preview20250311WebSearchServerTool$inboundSchema: z.ZodType<Preview20250311WebSearchServerTool, unknown>;
|
|
30
39
|
/** @internal */
|
|
31
40
|
export type Preview20250311WebSearchServerTool$Outbound = {
|
|
@@ -33,7 +42,7 @@ export type Preview20250311WebSearchServerTool$Outbound = {
|
|
|
33
42
|
filters?: WebSearchDomainFilter$Outbound | null | undefined;
|
|
34
43
|
max_results?: number | undefined;
|
|
35
44
|
search_context_size?: string | undefined;
|
|
36
|
-
type:
|
|
45
|
+
type: string;
|
|
37
46
|
user_location?: PreviewWebSearchUserLocation$Outbound | null | undefined;
|
|
38
47
|
};
|
|
39
48
|
/** @internal */
|