@openrouter/sdk 0.1.27 → 0.2.9
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/biome.json +171 -0
- package/esm/funcs/callModel.d.ts +7 -7
- package/esm/funcs/callModel.js +35 -23
- package/esm/funcs/embeddingsGenerate.js +2 -4
- package/esm/funcs/oAuthCreateAuthorizationUrl.d.ts +3 -3
- package/esm/funcs/oAuthCreateAuthorizationUrl.js +30 -14
- package/esm/funcs/oAuthCreateSHA256CodeChallenge.d.ts +2 -2
- package/esm/funcs/oAuthCreateSHA256CodeChallenge.js +13 -12
- package/esm/hooks/registration.d.ts +2 -2
- package/esm/hooks/registration.js +1 -2
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/encodings.d.ts +1 -0
- package/esm/lib/encodings.js +12 -1
- package/esm/lib/response-wrapper.d.ts +17 -5
- package/esm/lib/response-wrapper.js +119 -68
- package/esm/lib/reusable-stream.js +26 -7
- package/esm/lib/stream-transformers.d.ts +3 -3
- package/esm/lib/stream-transformers.js +43 -41
- package/esm/lib/tool-executor.d.ts +9 -9
- package/esm/lib/tool-executor.js +9 -9
- package/esm/lib/tool-orchestrator.d.ts +3 -3
- package/esm/lib/tool-orchestrator.js +39 -19
- package/esm/lib/tool-types.d.ts +26 -25
- package/esm/lib/tool-types.js +3 -3
- package/esm/models/chatcompletionfinishreason.d.ts +13 -0
- package/esm/models/chatcompletionfinishreason.js +14 -0
- package/esm/models/chatgenerationparams.d.ts +16 -4
- package/esm/models/chatgenerationparams.js +16 -4
- package/esm/models/chatmessagecontentitem.d.ts +2 -19
- package/esm/models/chatmessagecontentitem.js +6 -9
- package/esm/models/chatmessagecontentitemaudio.d.ts +1 -16
- package/esm/models/chatmessagecontentitemaudio.js +2 -16
- package/esm/models/chatmessagecontentitemcachecontrol.d.ts +29 -0
- package/esm/models/chatmessagecontentitemcachecontrol.js +33 -0
- package/esm/models/chatmessagecontentitemtext.d.ts +3 -0
- package/esm/models/chatmessagecontentitemtext.js +12 -0
- package/esm/models/chatmessagecontentitemvideo.d.ts +23 -11
- package/esm/models/chatmessagecontentitemvideo.js +24 -11
- package/esm/models/chatresponsechoice.d.ts +1 -21
- package/esm/models/chatresponsechoice.js +1 -25
- package/esm/models/chatstreamingchoice.d.ts +16 -0
- package/esm/models/chatstreamingchoice.js +24 -0
- package/esm/models/chatstreamingresponsechunk.d.ts +1 -1
- package/esm/models/chatstreamingresponsechunk.js +1 -1
- package/esm/models/completionchoice.d.ts +2 -0
- package/esm/models/completionchoice.js +3 -0
- package/esm/models/completioncreateparams.d.ts +4 -4
- package/esm/models/completioncreateparams.js +4 -4
- package/esm/models/completionresponse.d.ts +1 -0
- package/esm/models/completionresponse.js +1 -0
- package/esm/models/filecitation.d.ts +2 -11
- package/esm/models/filecitation.js +2 -9
- package/esm/models/filepath.d.ts +2 -11
- package/esm/models/filepath.js +2 -10
- package/esm/models/index.d.ts +3 -2
- package/esm/models/index.js +3 -2
- package/esm/models/message.d.ts +2 -2
- package/esm/models/message.js +1 -1
- package/esm/models/openairesponsesannotation.d.ts +2 -2
- package/esm/models/openairesponsesannotation.js +2 -2
- package/esm/models/openairesponsesinputunion.d.ts +5 -45
- package/esm/models/openairesponsesinputunion.js +20 -20
- package/esm/models/openairesponsesrefusalcontent.d.ts +2 -11
- package/esm/models/openairesponsesrefusalcontent.js +2 -9
- package/esm/models/openresponseseasyinputmessage.d.ts +6 -54
- package/esm/models/openresponseseasyinputmessage.js +12 -12
- package/esm/models/openresponseserrorevent.d.ts +1 -8
- package/esm/models/openresponseserrorevent.js +1 -6
- package/esm/models/openresponsesimagegencallcompleted.d.ts +1 -8
- package/esm/models/openresponsesimagegencallcompleted.js +1 -6
- package/esm/models/openresponsesimagegencallgenerating.d.ts +1 -8
- package/esm/models/openresponsesimagegencallgenerating.js +1 -6
- package/esm/models/openresponsesimagegencallinprogress.d.ts +1 -8
- package/esm/models/openresponsesimagegencallinprogress.js +1 -6
- package/esm/models/openresponsesimagegencallpartialimage.d.ts +1 -8
- package/esm/models/openresponsesimagegencallpartialimage.js +1 -6
- package/esm/models/openresponsesinputmessageitem.d.ts +4 -36
- package/esm/models/openresponsesinputmessageitem.js +8 -8
- package/esm/models/openresponsesnonstreamingresponse.d.ts +1 -7
- package/esm/models/openresponsesnonstreamingresponse.js +1 -6
- package/esm/models/openresponsesreasoningdeltaevent.d.ts +1 -8
- package/esm/models/openresponsesreasoningdeltaevent.js +1 -6
- package/esm/models/openresponsesreasoningdoneevent.d.ts +1 -8
- package/esm/models/openresponsesreasoningdoneevent.js +1 -6
- package/esm/models/openresponsesreasoningsummarypartaddedevent.d.ts +1 -8
- package/esm/models/openresponsesreasoningsummarypartaddedevent.js +1 -6
- package/esm/models/openresponsesreasoningsummarytextdeltaevent.d.ts +1 -8
- package/esm/models/openresponsesreasoningsummarytextdeltaevent.js +1 -6
- package/esm/models/openresponsesreasoningsummarytextdoneevent.d.ts +1 -8
- package/esm/models/openresponsesreasoningsummarytextdoneevent.js +1 -6
- package/esm/models/openresponsesrequest.d.ts +26 -44
- package/esm/models/openresponsesrequest.js +15 -32
- package/esm/models/openresponsesstreamevent.d.ts +30 -125
- package/esm/models/openresponsesstreamevent.js +34 -119
- package/esm/models/openresponseswebsearch20250826tool.d.ts +2 -11
- package/esm/models/openresponseswebsearch20250826tool.js +2 -9
- package/esm/models/openresponseswebsearchpreview20250311tool.d.ts +2 -11
- package/esm/models/openresponseswebsearchpreview20250311tool.js +2 -9
- package/esm/models/openresponseswebsearchpreviewtool.d.ts +2 -11
- package/esm/models/openresponseswebsearchpreviewtool.js +2 -9
- package/esm/models/openresponseswebsearchtool.d.ts +2 -11
- package/esm/models/openresponseswebsearchtool.js +2 -9
- package/esm/models/operations/createembeddings.d.ts +5 -21
- package/esm/models/operations/createembeddings.js +3 -22
- package/esm/models/operations/getcredits.d.ts +16 -1
- package/esm/models/operations/getcredits.js +17 -1
- package/esm/models/operations/getparameters.d.ts +5 -1
- package/esm/models/operations/getparameters.js +5 -1
- package/esm/models/providername.d.ts +5 -1
- package/esm/models/providername.js +5 -1
- package/esm/models/responseformattextconfig.d.ts +2 -2
- package/esm/models/responseformattextconfig.js +2 -2
- package/esm/models/responseinputaudio.d.ts +3 -11
- package/esm/models/responseinputaudio.js +2 -9
- package/esm/models/responseinputfile.d.ts +2 -11
- package/esm/models/responseinputfile.js +2 -9
- package/esm/models/responseinputimage.d.ts +3 -11
- package/esm/models/responseinputimage.js +2 -9
- package/esm/models/responseinputtext.d.ts +2 -11
- package/esm/models/responseinputtext.js +2 -9
- package/esm/models/responseoutputtext.d.ts +2 -11
- package/esm/models/responseoutputtext.js +2 -9
- package/esm/models/responsesformatjsonobject.d.ts +2 -11
- package/esm/models/responsesformatjsonobject.js +2 -9
- package/esm/models/responsesformattext.d.ts +2 -11
- package/esm/models/responsesformattext.js +2 -9
- package/esm/models/responsesformattextjsonschemaconfig.d.ts +2 -11
- package/esm/models/responsesformattextjsonschemaconfig.js +2 -9
- package/esm/models/responsesoutputitem.d.ts +13 -1
- package/esm/models/responsesoutputitem.js +6 -6
- package/esm/models/urlcitation.d.ts +2 -11
- package/esm/models/urlcitation.js +2 -9
- package/esm/sdk/oauth.d.ts +2 -2
- package/esm/sdk/oauth.js +2 -3
- package/esm/sdk/sdk.d.ts +9 -8
- package/esm/types/unrecognized.d.ts +7 -1
- package/esm/types/unrecognized.js +9 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/tsconfig.json +0 -1
- package/vitest.config.ts +14 -8
- package/esm/models/chatmessagecontentitemfile.d.ts +0 -36
- package/esm/models/chatmessagecontentitemfile.js +0 -51
- package/esm/models/videourl.d.ts +0 -17
- package/esm/models/videourl.js +0 -21
|
@@ -22,62 +22,9 @@ import { ReasoningSummaryText$inboundSchema, } from "./reasoningsummarytext.js";
|
|
|
22
22
|
import { ReasoningTextContent$inboundSchema, } from "./reasoningtextcontent.js";
|
|
23
23
|
import { ResponseOutputText$inboundSchema, } from "./responseoutputtext.js";
|
|
24
24
|
import { ResponsesOutputItem$inboundSchema, } from "./responsesoutputitem.js";
|
|
25
|
-
export const TypeResponseReasoningSummaryPartDone = {
|
|
26
|
-
ResponseReasoningSummaryPartDone: "response.reasoning_summary_part.done",
|
|
27
|
-
};
|
|
28
|
-
export const TypeResponseFunctionCallArgumentsDone = {
|
|
29
|
-
ResponseFunctionCallArgumentsDone: "response.function_call_arguments.done",
|
|
30
|
-
};
|
|
31
|
-
export const TypeResponseFunctionCallArgumentsDelta = {
|
|
32
|
-
ResponseFunctionCallArgumentsDelta: "response.function_call_arguments.delta",
|
|
33
|
-
};
|
|
34
|
-
export const TypeResponseOutputTextAnnotationAdded = {
|
|
35
|
-
ResponseOutputTextAnnotationAdded: "response.output_text.annotation.added",
|
|
36
|
-
};
|
|
37
|
-
export const TypeResponseRefusalDone = {
|
|
38
|
-
ResponseRefusalDone: "response.refusal.done",
|
|
39
|
-
};
|
|
40
|
-
export const TypeResponseRefusalDelta = {
|
|
41
|
-
ResponseRefusalDelta: "response.refusal.delta",
|
|
42
|
-
};
|
|
43
|
-
export const TypeResponseOutputTextDone = {
|
|
44
|
-
ResponseOutputTextDone: "response.output_text.done",
|
|
45
|
-
};
|
|
46
|
-
export const TypeResponseOutputTextDelta = {
|
|
47
|
-
ResponseOutputTextDelta: "response.output_text.delta",
|
|
48
|
-
};
|
|
49
|
-
export const TypeResponseContentPartDone = {
|
|
50
|
-
ResponseContentPartDone: "response.content_part.done",
|
|
51
|
-
};
|
|
52
|
-
export const TypeResponseContentPartAdded = {
|
|
53
|
-
ResponseContentPartAdded: "response.content_part.added",
|
|
54
|
-
};
|
|
55
|
-
export const TypeResponseOutputItemDone = {
|
|
56
|
-
ResponseOutputItemDone: "response.output_item.done",
|
|
57
|
-
};
|
|
58
|
-
export const TypeResponseOutputItemAdded = {
|
|
59
|
-
ResponseOutputItemAdded: "response.output_item.added",
|
|
60
|
-
};
|
|
61
|
-
export const TypeResponseFailed = {
|
|
62
|
-
ResponseFailed: "response.failed",
|
|
63
|
-
};
|
|
64
|
-
export const TypeResponseIncomplete = {
|
|
65
|
-
ResponseIncomplete: "response.incomplete",
|
|
66
|
-
};
|
|
67
|
-
export const TypeResponseCompleted = {
|
|
68
|
-
ResponseCompleted: "response.completed",
|
|
69
|
-
};
|
|
70
|
-
export const TypeResponseInProgress = {
|
|
71
|
-
ResponseInProgress: "response.in_progress",
|
|
72
|
-
};
|
|
73
|
-
export const TypeResponseCreated = {
|
|
74
|
-
ResponseCreated: "response.created",
|
|
75
|
-
};
|
|
76
|
-
/** @internal */
|
|
77
|
-
export const TypeResponseReasoningSummaryPartDone$inboundSchema = z.enum(TypeResponseReasoningSummaryPartDone);
|
|
78
25
|
/** @internal */
|
|
79
26
|
export const OpenResponsesStreamEventResponseReasoningSummaryPartDone$inboundSchema = z.object({
|
|
80
|
-
type:
|
|
27
|
+
type: z.literal("response.reasoning_summary_part.done"),
|
|
81
28
|
output_index: z.number(),
|
|
82
29
|
item_id: z.string(),
|
|
83
30
|
summary_index: z.number(),
|
|
@@ -96,10 +43,8 @@ export function openResponsesStreamEventResponseReasoningSummaryPartDoneFromJSON
|
|
|
96
43
|
.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseReasoningSummaryPartDone' from JSON`);
|
|
97
44
|
}
|
|
98
45
|
/** @internal */
|
|
99
|
-
export const TypeResponseFunctionCallArgumentsDone$inboundSchema = z.enum(TypeResponseFunctionCallArgumentsDone);
|
|
100
|
-
/** @internal */
|
|
101
46
|
export const OpenResponsesStreamEventResponseFunctionCallArgumentsDone$inboundSchema = z.object({
|
|
102
|
-
type:
|
|
47
|
+
type: z.literal("response.function_call_arguments.done"),
|
|
103
48
|
item_id: z.string(),
|
|
104
49
|
output_index: z.number(),
|
|
105
50
|
name: z.string(),
|
|
@@ -117,10 +62,8 @@ export function openResponsesStreamEventResponseFunctionCallArgumentsDoneFromJSO
|
|
|
117
62
|
.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseFunctionCallArgumentsDone' from JSON`);
|
|
118
63
|
}
|
|
119
64
|
/** @internal */
|
|
120
|
-
export const TypeResponseFunctionCallArgumentsDelta$inboundSchema = z.enum(TypeResponseFunctionCallArgumentsDelta);
|
|
121
|
-
/** @internal */
|
|
122
65
|
export const OpenResponsesStreamEventResponseFunctionCallArgumentsDelta$inboundSchema = z.object({
|
|
123
|
-
type:
|
|
66
|
+
type: z.literal("response.function_call_arguments.delta"),
|
|
124
67
|
item_id: z.string(),
|
|
125
68
|
output_index: z.number(),
|
|
126
69
|
delta: z.string(),
|
|
@@ -137,10 +80,8 @@ export function openResponsesStreamEventResponseFunctionCallArgumentsDeltaFromJS
|
|
|
137
80
|
.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseFunctionCallArgumentsDelta' from JSON`);
|
|
138
81
|
}
|
|
139
82
|
/** @internal */
|
|
140
|
-
export const TypeResponseOutputTextAnnotationAdded$inboundSchema = z.enum(TypeResponseOutputTextAnnotationAdded);
|
|
141
|
-
/** @internal */
|
|
142
83
|
export const OpenResponsesStreamEventResponseOutputTextAnnotationAdded$inboundSchema = z.object({
|
|
143
|
-
type:
|
|
84
|
+
type: z.literal("response.output_text.annotation.added"),
|
|
144
85
|
output_index: z.number(),
|
|
145
86
|
item_id: z.string(),
|
|
146
87
|
content_index: z.number(),
|
|
@@ -161,10 +102,8 @@ export function openResponsesStreamEventResponseOutputTextAnnotationAddedFromJSO
|
|
|
161
102
|
.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseOutputTextAnnotationAdded' from JSON`);
|
|
162
103
|
}
|
|
163
104
|
/** @internal */
|
|
164
|
-
export const TypeResponseRefusalDone$inboundSchema = z.enum(TypeResponseRefusalDone);
|
|
165
|
-
/** @internal */
|
|
166
105
|
export const OpenResponsesStreamEventResponseRefusalDone$inboundSchema = z.object({
|
|
167
|
-
type:
|
|
106
|
+
type: z.literal("response.refusal.done"),
|
|
168
107
|
output_index: z.number(),
|
|
169
108
|
item_id: z.string(),
|
|
170
109
|
content_index: z.number(),
|
|
@@ -182,10 +121,8 @@ export function openResponsesStreamEventResponseRefusalDoneFromJSON(jsonString)
|
|
|
182
121
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseRefusalDone$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseRefusalDone' from JSON`);
|
|
183
122
|
}
|
|
184
123
|
/** @internal */
|
|
185
|
-
export const TypeResponseRefusalDelta$inboundSchema = z.enum(TypeResponseRefusalDelta);
|
|
186
|
-
/** @internal */
|
|
187
124
|
export const OpenResponsesStreamEventResponseRefusalDelta$inboundSchema = z.object({
|
|
188
|
-
type:
|
|
125
|
+
type: z.literal("response.refusal.delta"),
|
|
189
126
|
output_index: z.number(),
|
|
190
127
|
item_id: z.string(),
|
|
191
128
|
content_index: z.number(),
|
|
@@ -203,10 +140,8 @@ export function openResponsesStreamEventResponseRefusalDeltaFromJSON(jsonString)
|
|
|
203
140
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseRefusalDelta$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseRefusalDelta' from JSON`);
|
|
204
141
|
}
|
|
205
142
|
/** @internal */
|
|
206
|
-
export const TypeResponseOutputTextDone$inboundSchema = z.enum(TypeResponseOutputTextDone);
|
|
207
|
-
/** @internal */
|
|
208
143
|
export const OpenResponsesStreamEventResponseOutputTextDone$inboundSchema = z.object({
|
|
209
|
-
type:
|
|
144
|
+
type: z.literal("response.output_text.done"),
|
|
210
145
|
output_index: z.number(),
|
|
211
146
|
item_id: z.string(),
|
|
212
147
|
content_index: z.number(),
|
|
@@ -225,11 +160,9 @@ export function openResponsesStreamEventResponseOutputTextDoneFromJSON(jsonStrin
|
|
|
225
160
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseOutputTextDone$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseOutputTextDone' from JSON`);
|
|
226
161
|
}
|
|
227
162
|
/** @internal */
|
|
228
|
-
export const TypeResponseOutputTextDelta$inboundSchema = z.enum(TypeResponseOutputTextDelta);
|
|
229
|
-
/** @internal */
|
|
230
163
|
export const OpenResponsesStreamEventResponseOutputTextDelta$inboundSchema = z
|
|
231
164
|
.object({
|
|
232
|
-
type:
|
|
165
|
+
type: z.literal("response.output_text.delta"),
|
|
233
166
|
logprobs: z.array(OpenResponsesLogProbs$inboundSchema),
|
|
234
167
|
output_index: z.number(),
|
|
235
168
|
item_id: z.string(),
|
|
@@ -248,11 +181,9 @@ export function openResponsesStreamEventResponseOutputTextDeltaFromJSON(jsonStri
|
|
|
248
181
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseOutputTextDelta$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseOutputTextDelta' from JSON`);
|
|
249
182
|
}
|
|
250
183
|
/** @internal */
|
|
251
|
-
export const TypeResponseContentPartDone$inboundSchema = z.enum(TypeResponseContentPartDone);
|
|
252
|
-
/** @internal */
|
|
253
184
|
export const Part2$inboundSchema = z.union([
|
|
254
185
|
ResponseOutputText$inboundSchema,
|
|
255
|
-
ReasoningTextContent$inboundSchema,
|
|
186
|
+
ReasoningTextContent$inboundSchema.and(z.object({ type: z.literal("reasoning_text") })),
|
|
256
187
|
OpenAIResponsesRefusalContent$inboundSchema,
|
|
257
188
|
]);
|
|
258
189
|
export function part2FromJSON(jsonString) {
|
|
@@ -261,13 +192,13 @@ export function part2FromJSON(jsonString) {
|
|
|
261
192
|
/** @internal */
|
|
262
193
|
export const OpenResponsesStreamEventResponseContentPartDone$inboundSchema = z
|
|
263
194
|
.object({
|
|
264
|
-
type:
|
|
195
|
+
type: z.literal("response.content_part.done"),
|
|
265
196
|
output_index: z.number(),
|
|
266
197
|
item_id: z.string(),
|
|
267
198
|
content_index: z.number(),
|
|
268
199
|
part: z.union([
|
|
269
200
|
ResponseOutputText$inboundSchema,
|
|
270
|
-
ReasoningTextContent$inboundSchema,
|
|
201
|
+
ReasoningTextContent$inboundSchema.and(z.object({ type: z.literal("reasoning_text") })),
|
|
271
202
|
OpenAIResponsesRefusalContent$inboundSchema,
|
|
272
203
|
]),
|
|
273
204
|
sequence_number: z.number(),
|
|
@@ -283,11 +214,9 @@ export function openResponsesStreamEventResponseContentPartDoneFromJSON(jsonStri
|
|
|
283
214
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseContentPartDone$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseContentPartDone' from JSON`);
|
|
284
215
|
}
|
|
285
216
|
/** @internal */
|
|
286
|
-
export const TypeResponseContentPartAdded$inboundSchema = z.enum(TypeResponseContentPartAdded);
|
|
287
|
-
/** @internal */
|
|
288
217
|
export const Part1$inboundSchema = z.union([
|
|
289
218
|
ResponseOutputText$inboundSchema,
|
|
290
|
-
ReasoningTextContent$inboundSchema,
|
|
219
|
+
ReasoningTextContent$inboundSchema.and(z.object({ type: z.literal("reasoning_text") })),
|
|
291
220
|
OpenAIResponsesRefusalContent$inboundSchema,
|
|
292
221
|
]);
|
|
293
222
|
export function part1FromJSON(jsonString) {
|
|
@@ -296,13 +225,13 @@ export function part1FromJSON(jsonString) {
|
|
|
296
225
|
/** @internal */
|
|
297
226
|
export const OpenResponsesStreamEventResponseContentPartAdded$inboundSchema = z
|
|
298
227
|
.object({
|
|
299
|
-
type:
|
|
228
|
+
type: z.literal("response.content_part.added"),
|
|
300
229
|
output_index: z.number(),
|
|
301
230
|
item_id: z.string(),
|
|
302
231
|
content_index: z.number(),
|
|
303
232
|
part: z.union([
|
|
304
233
|
ResponseOutputText$inboundSchema,
|
|
305
|
-
ReasoningTextContent$inboundSchema,
|
|
234
|
+
ReasoningTextContent$inboundSchema.and(z.object({ type: z.literal("reasoning_text") })),
|
|
306
235
|
OpenAIResponsesRefusalContent$inboundSchema,
|
|
307
236
|
]),
|
|
308
237
|
sequence_number: z.number(),
|
|
@@ -318,10 +247,8 @@ export function openResponsesStreamEventResponseContentPartAddedFromJSON(jsonStr
|
|
|
318
247
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseContentPartAdded$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseContentPartAdded' from JSON`);
|
|
319
248
|
}
|
|
320
249
|
/** @internal */
|
|
321
|
-
export const TypeResponseOutputItemDone$inboundSchema = z.enum(TypeResponseOutputItemDone);
|
|
322
|
-
/** @internal */
|
|
323
250
|
export const OpenResponsesStreamEventResponseOutputItemDone$inboundSchema = z.object({
|
|
324
|
-
type:
|
|
251
|
+
type: z.literal("response.output_item.done"),
|
|
325
252
|
output_index: z.number(),
|
|
326
253
|
item: ResponsesOutputItem$inboundSchema,
|
|
327
254
|
sequence_number: z.number(),
|
|
@@ -335,11 +262,9 @@ export function openResponsesStreamEventResponseOutputItemDoneFromJSON(jsonStrin
|
|
|
335
262
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseOutputItemDone$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseOutputItemDone' from JSON`);
|
|
336
263
|
}
|
|
337
264
|
/** @internal */
|
|
338
|
-
export const TypeResponseOutputItemAdded$inboundSchema = z.enum(TypeResponseOutputItemAdded);
|
|
339
|
-
/** @internal */
|
|
340
265
|
export const OpenResponsesStreamEventResponseOutputItemAdded$inboundSchema = z
|
|
341
266
|
.object({
|
|
342
|
-
type:
|
|
267
|
+
type: z.literal("response.output_item.added"),
|
|
343
268
|
output_index: z.number(),
|
|
344
269
|
item: ResponsesOutputItem$inboundSchema,
|
|
345
270
|
sequence_number: z.number(),
|
|
@@ -353,10 +278,8 @@ export function openResponsesStreamEventResponseOutputItemAddedFromJSON(jsonStri
|
|
|
353
278
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseOutputItemAdded$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseOutputItemAdded' from JSON`);
|
|
354
279
|
}
|
|
355
280
|
/** @internal */
|
|
356
|
-
export const TypeResponseFailed$inboundSchema = z.enum(TypeResponseFailed);
|
|
357
|
-
/** @internal */
|
|
358
281
|
export const OpenResponsesStreamEventResponseFailed$inboundSchema = z.object({
|
|
359
|
-
type:
|
|
282
|
+
type: z.literal("response.failed"),
|
|
360
283
|
response: OpenResponsesNonStreamingResponse$inboundSchema,
|
|
361
284
|
sequence_number: z.number(),
|
|
362
285
|
}).transform((v) => {
|
|
@@ -368,10 +291,8 @@ export function openResponsesStreamEventResponseFailedFromJSON(jsonString) {
|
|
|
368
291
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseFailed$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseFailed' from JSON`);
|
|
369
292
|
}
|
|
370
293
|
/** @internal */
|
|
371
|
-
export const TypeResponseIncomplete$inboundSchema = z.enum(TypeResponseIncomplete);
|
|
372
|
-
/** @internal */
|
|
373
294
|
export const OpenResponsesStreamEventResponseIncomplete$inboundSchema = z.object({
|
|
374
|
-
type:
|
|
295
|
+
type: z.literal("response.incomplete"),
|
|
375
296
|
response: OpenResponsesNonStreamingResponse$inboundSchema,
|
|
376
297
|
sequence_number: z.number(),
|
|
377
298
|
}).transform((v) => {
|
|
@@ -383,10 +304,8 @@ export function openResponsesStreamEventResponseIncompleteFromJSON(jsonString) {
|
|
|
383
304
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseIncomplete$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseIncomplete' from JSON`);
|
|
384
305
|
}
|
|
385
306
|
/** @internal */
|
|
386
|
-
export const TypeResponseCompleted$inboundSchema = z.enum(TypeResponseCompleted);
|
|
387
|
-
/** @internal */
|
|
388
307
|
export const OpenResponsesStreamEventResponseCompleted$inboundSchema = z.object({
|
|
389
|
-
type:
|
|
308
|
+
type: z.literal("response.completed"),
|
|
390
309
|
response: OpenResponsesNonStreamingResponse$inboundSchema,
|
|
391
310
|
sequence_number: z.number(),
|
|
392
311
|
}).transform((v) => {
|
|
@@ -398,10 +317,8 @@ export function openResponsesStreamEventResponseCompletedFromJSON(jsonString) {
|
|
|
398
317
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseCompleted$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseCompleted' from JSON`);
|
|
399
318
|
}
|
|
400
319
|
/** @internal */
|
|
401
|
-
export const TypeResponseInProgress$inboundSchema = z.enum(TypeResponseInProgress);
|
|
402
|
-
/** @internal */
|
|
403
320
|
export const OpenResponsesStreamEventResponseInProgress$inboundSchema = z.object({
|
|
404
|
-
type:
|
|
321
|
+
type: z.literal("response.in_progress"),
|
|
405
322
|
response: OpenResponsesNonStreamingResponse$inboundSchema,
|
|
406
323
|
sequence_number: z.number(),
|
|
407
324
|
}).transform((v) => {
|
|
@@ -413,10 +330,8 @@ export function openResponsesStreamEventResponseInProgressFromJSON(jsonString) {
|
|
|
413
330
|
return safeParse(jsonString, (x) => OpenResponsesStreamEventResponseInProgress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEventResponseInProgress' from JSON`);
|
|
414
331
|
}
|
|
415
332
|
/** @internal */
|
|
416
|
-
export const TypeResponseCreated$inboundSchema = z.enum(TypeResponseCreated);
|
|
417
|
-
/** @internal */
|
|
418
333
|
export const OpenResponsesStreamEventResponseCreated$inboundSchema = z.object({
|
|
419
|
-
type:
|
|
334
|
+
type: z.literal("response.created"),
|
|
420
335
|
response: OpenResponsesNonStreamingResponse$inboundSchema,
|
|
421
336
|
sequence_number: z.number(),
|
|
422
337
|
}).transform((v) => {
|
|
@@ -429,13 +344,22 @@ export function openResponsesStreamEventResponseCreatedFromJSON(jsonString) {
|
|
|
429
344
|
}
|
|
430
345
|
/** @internal */
|
|
431
346
|
export const OpenResponsesStreamEvent$inboundSchema = z.union([
|
|
432
|
-
z.lazy(() =>
|
|
433
|
-
z.lazy(() =>
|
|
434
|
-
z.lazy(() =>
|
|
347
|
+
z.lazy(() => OpenResponsesStreamEventResponseCreated$inboundSchema),
|
|
348
|
+
z.lazy(() => OpenResponsesStreamEventResponseInProgress$inboundSchema),
|
|
349
|
+
z.lazy(() => OpenResponsesStreamEventResponseCompleted$inboundSchema),
|
|
350
|
+
z.lazy(() => OpenResponsesStreamEventResponseIncomplete$inboundSchema),
|
|
351
|
+
z.lazy(() => OpenResponsesStreamEventResponseFailed$inboundSchema),
|
|
352
|
+
OpenResponsesErrorEvent$inboundSchema,
|
|
353
|
+
z.lazy(() => OpenResponsesStreamEventResponseOutputItemAdded$inboundSchema),
|
|
354
|
+
z.lazy(() => OpenResponsesStreamEventResponseOutputItemDone$inboundSchema),
|
|
435
355
|
z.lazy(() => OpenResponsesStreamEventResponseContentPartAdded$inboundSchema),
|
|
436
356
|
z.lazy(() => OpenResponsesStreamEventResponseContentPartDone$inboundSchema),
|
|
357
|
+
z.lazy(() => OpenResponsesStreamEventResponseOutputTextDelta$inboundSchema),
|
|
358
|
+
z.lazy(() => OpenResponsesStreamEventResponseOutputTextDone$inboundSchema),
|
|
437
359
|
z.lazy(() => OpenResponsesStreamEventResponseRefusalDelta$inboundSchema),
|
|
438
360
|
z.lazy(() => OpenResponsesStreamEventResponseRefusalDone$inboundSchema),
|
|
361
|
+
z.lazy(() => OpenResponsesStreamEventResponseOutputTextAnnotationAdded$inboundSchema),
|
|
362
|
+
z.lazy(() => OpenResponsesStreamEventResponseFunctionCallArgumentsDelta$inboundSchema),
|
|
439
363
|
z.lazy(() => OpenResponsesStreamEventResponseFunctionCallArgumentsDone$inboundSchema),
|
|
440
364
|
OpenResponsesReasoningDeltaEvent$inboundSchema,
|
|
441
365
|
OpenResponsesReasoningDoneEvent$inboundSchema,
|
|
@@ -443,19 +367,10 @@ export const OpenResponsesStreamEvent$inboundSchema = z.union([
|
|
|
443
367
|
z.lazy(() => OpenResponsesStreamEventResponseReasoningSummaryPartDone$inboundSchema),
|
|
444
368
|
OpenResponsesReasoningSummaryTextDeltaEvent$inboundSchema,
|
|
445
369
|
OpenResponsesReasoningSummaryTextDoneEvent$inboundSchema,
|
|
446
|
-
OpenResponsesImageGenCallPartialImage$inboundSchema,
|
|
447
|
-
OpenResponsesErrorEvent$inboundSchema,
|
|
448
|
-
z.lazy(() => OpenResponsesStreamEventResponseFunctionCallArgumentsDelta$inboundSchema),
|
|
449
|
-
z.lazy(() => OpenResponsesStreamEventResponseOutputItemAdded$inboundSchema),
|
|
450
|
-
z.lazy(() => OpenResponsesStreamEventResponseOutputItemDone$inboundSchema),
|
|
451
370
|
OpenResponsesImageGenCallInProgress$inboundSchema,
|
|
452
371
|
OpenResponsesImageGenCallGenerating$inboundSchema,
|
|
372
|
+
OpenResponsesImageGenCallPartialImage$inboundSchema,
|
|
453
373
|
OpenResponsesImageGenCallCompleted$inboundSchema,
|
|
454
|
-
z.lazy(() => OpenResponsesStreamEventResponseCreated$inboundSchema),
|
|
455
|
-
z.lazy(() => OpenResponsesStreamEventResponseInProgress$inboundSchema),
|
|
456
|
-
z.lazy(() => OpenResponsesStreamEventResponseCompleted$inboundSchema),
|
|
457
|
-
z.lazy(() => OpenResponsesStreamEventResponseIncomplete$inboundSchema),
|
|
458
|
-
z.lazy(() => OpenResponsesStreamEventResponseFailed$inboundSchema),
|
|
459
374
|
]);
|
|
460
375
|
export function openResponsesStreamEventFromJSON(jsonString) {
|
|
461
376
|
return safeParse(jsonString, (x) => OpenResponsesStreamEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesStreamEvent' from JSON`);
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
4
|
import { ResponsesSearchContextSize } from "./responsessearchcontextsize.js";
|
|
6
5
|
import { ResponsesWebSearchUserLocation, ResponsesWebSearchUserLocation$Outbound } from "./responseswebsearchuserlocation.js";
|
|
7
|
-
export declare const OpenResponsesWebSearch20250826ToolType: {
|
|
8
|
-
readonly WebSearch20250826: "web_search_2025_08_26";
|
|
9
|
-
};
|
|
10
|
-
export type OpenResponsesWebSearch20250826ToolType = ClosedEnum<typeof OpenResponsesWebSearch20250826ToolType>;
|
|
11
6
|
export type OpenResponsesWebSearch20250826ToolFilters = {
|
|
12
7
|
allowedDomains?: Array<string> | null | undefined;
|
|
13
8
|
};
|
|
@@ -15,7 +10,7 @@ export type OpenResponsesWebSearch20250826ToolFilters = {
|
|
|
15
10
|
* Web search tool configuration (2025-08-26 version)
|
|
16
11
|
*/
|
|
17
12
|
export type OpenResponsesWebSearch20250826Tool = {
|
|
18
|
-
type:
|
|
13
|
+
type: "web_search_2025_08_26";
|
|
19
14
|
filters?: OpenResponsesWebSearch20250826ToolFilters | null | undefined;
|
|
20
15
|
/**
|
|
21
16
|
* Size of the search context for web search tools
|
|
@@ -27,10 +22,6 @@ export type OpenResponsesWebSearch20250826Tool = {
|
|
|
27
22
|
userLocation?: ResponsesWebSearchUserLocation | null | undefined;
|
|
28
23
|
};
|
|
29
24
|
/** @internal */
|
|
30
|
-
export declare const OpenResponsesWebSearch20250826ToolType$inboundSchema: z.ZodEnum<typeof OpenResponsesWebSearch20250826ToolType>;
|
|
31
|
-
/** @internal */
|
|
32
|
-
export declare const OpenResponsesWebSearch20250826ToolType$outboundSchema: z.ZodEnum<typeof OpenResponsesWebSearch20250826ToolType>;
|
|
33
|
-
/** @internal */
|
|
34
25
|
export declare const OpenResponsesWebSearch20250826ToolFilters$inboundSchema: z.ZodType<OpenResponsesWebSearch20250826ToolFilters, unknown>;
|
|
35
26
|
/** @internal */
|
|
36
27
|
export type OpenResponsesWebSearch20250826ToolFilters$Outbound = {
|
|
@@ -44,7 +35,7 @@ export declare function openResponsesWebSearch20250826ToolFiltersFromJSON(jsonSt
|
|
|
44
35
|
export declare const OpenResponsesWebSearch20250826Tool$inboundSchema: z.ZodType<OpenResponsesWebSearch20250826Tool, unknown>;
|
|
45
36
|
/** @internal */
|
|
46
37
|
export type OpenResponsesWebSearch20250826Tool$Outbound = {
|
|
47
|
-
type:
|
|
38
|
+
type: "web_search_2025_08_26";
|
|
48
39
|
filters?: OpenResponsesWebSearch20250826ToolFilters$Outbound | null | undefined;
|
|
49
40
|
search_context_size?: string | undefined;
|
|
50
41
|
user_location?: ResponsesWebSearchUserLocation$Outbound | null | undefined;
|
|
@@ -6,13 +6,6 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { ResponsesSearchContextSize$inboundSchema, ResponsesSearchContextSize$outboundSchema, } from "./responsessearchcontextsize.js";
|
|
8
8
|
import { ResponsesWebSearchUserLocation$inboundSchema, ResponsesWebSearchUserLocation$outboundSchema, } from "./responseswebsearchuserlocation.js";
|
|
9
|
-
export const OpenResponsesWebSearch20250826ToolType = {
|
|
10
|
-
WebSearch20250826: "web_search_2025_08_26",
|
|
11
|
-
};
|
|
12
|
-
/** @internal */
|
|
13
|
-
export const OpenResponsesWebSearch20250826ToolType$inboundSchema = z.enum(OpenResponsesWebSearch20250826ToolType);
|
|
14
|
-
/** @internal */
|
|
15
|
-
export const OpenResponsesWebSearch20250826ToolType$outboundSchema = OpenResponsesWebSearch20250826ToolType$inboundSchema;
|
|
16
9
|
/** @internal */
|
|
17
10
|
export const OpenResponsesWebSearch20250826ToolFilters$inboundSchema = z.object({
|
|
18
11
|
allowed_domains: z.nullable(z.array(z.string())).optional(),
|
|
@@ -37,7 +30,7 @@ export function openResponsesWebSearch20250826ToolFiltersFromJSON(jsonString) {
|
|
|
37
30
|
}
|
|
38
31
|
/** @internal */
|
|
39
32
|
export const OpenResponsesWebSearch20250826Tool$inboundSchema = z.object({
|
|
40
|
-
type:
|
|
33
|
+
type: z.literal("web_search_2025_08_26"),
|
|
41
34
|
filters: z.nullable(z.lazy(() => OpenResponsesWebSearch20250826ToolFilters$inboundSchema)).optional(),
|
|
42
35
|
search_context_size: ResponsesSearchContextSize$inboundSchema.optional(),
|
|
43
36
|
user_location: z.nullable(ResponsesWebSearchUserLocation$inboundSchema)
|
|
@@ -50,7 +43,7 @@ export const OpenResponsesWebSearch20250826Tool$inboundSchema = z.object({
|
|
|
50
43
|
});
|
|
51
44
|
/** @internal */
|
|
52
45
|
export const OpenResponsesWebSearch20250826Tool$outboundSchema = z.object({
|
|
53
|
-
type:
|
|
46
|
+
type: z.literal("web_search_2025_08_26"),
|
|
54
47
|
filters: z.nullable(z.lazy(() => OpenResponsesWebSearch20250826ToolFilters$outboundSchema)).optional(),
|
|
55
48
|
searchContextSize: ResponsesSearchContextSize$outboundSchema.optional(),
|
|
56
49
|
userLocation: z.nullable(ResponsesWebSearchUserLocation$outboundSchema)
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
4
|
import { ResponsesSearchContextSize } from "./responsessearchcontextsize.js";
|
|
6
5
|
import { WebSearchPreviewToolUserLocation, WebSearchPreviewToolUserLocation$Outbound } from "./websearchpreviewtooluserlocation.js";
|
|
7
|
-
export declare const OpenResponsesWebSearchPreview20250311ToolType: {
|
|
8
|
-
readonly WebSearchPreview20250311: "web_search_preview_2025_03_11";
|
|
9
|
-
};
|
|
10
|
-
export type OpenResponsesWebSearchPreview20250311ToolType = ClosedEnum<typeof OpenResponsesWebSearchPreview20250311ToolType>;
|
|
11
6
|
/**
|
|
12
7
|
* Web search preview tool configuration (2025-03-11 version)
|
|
13
8
|
*/
|
|
14
9
|
export type OpenResponsesWebSearchPreview20250311Tool = {
|
|
15
|
-
type:
|
|
10
|
+
type: "web_search_preview_2025_03_11";
|
|
16
11
|
/**
|
|
17
12
|
* Size of the search context for web search tools
|
|
18
13
|
*/
|
|
@@ -20,14 +15,10 @@ export type OpenResponsesWebSearchPreview20250311Tool = {
|
|
|
20
15
|
userLocation?: WebSearchPreviewToolUserLocation | null | undefined;
|
|
21
16
|
};
|
|
22
17
|
/** @internal */
|
|
23
|
-
export declare const OpenResponsesWebSearchPreview20250311ToolType$inboundSchema: z.ZodEnum<typeof OpenResponsesWebSearchPreview20250311ToolType>;
|
|
24
|
-
/** @internal */
|
|
25
|
-
export declare const OpenResponsesWebSearchPreview20250311ToolType$outboundSchema: z.ZodEnum<typeof OpenResponsesWebSearchPreview20250311ToolType>;
|
|
26
|
-
/** @internal */
|
|
27
18
|
export declare const OpenResponsesWebSearchPreview20250311Tool$inboundSchema: z.ZodType<OpenResponsesWebSearchPreview20250311Tool, unknown>;
|
|
28
19
|
/** @internal */
|
|
29
20
|
export type OpenResponsesWebSearchPreview20250311Tool$Outbound = {
|
|
30
|
-
type:
|
|
21
|
+
type: "web_search_preview_2025_03_11";
|
|
31
22
|
search_context_size?: string | undefined;
|
|
32
23
|
user_location?: WebSearchPreviewToolUserLocation$Outbound | null | undefined;
|
|
33
24
|
};
|
|
@@ -6,16 +6,9 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { ResponsesSearchContextSize$inboundSchema, ResponsesSearchContextSize$outboundSchema, } from "./responsessearchcontextsize.js";
|
|
8
8
|
import { WebSearchPreviewToolUserLocation$inboundSchema, WebSearchPreviewToolUserLocation$outboundSchema, } from "./websearchpreviewtooluserlocation.js";
|
|
9
|
-
export const OpenResponsesWebSearchPreview20250311ToolType = {
|
|
10
|
-
WebSearchPreview20250311: "web_search_preview_2025_03_11",
|
|
11
|
-
};
|
|
12
|
-
/** @internal */
|
|
13
|
-
export const OpenResponsesWebSearchPreview20250311ToolType$inboundSchema = z.enum(OpenResponsesWebSearchPreview20250311ToolType);
|
|
14
|
-
/** @internal */
|
|
15
|
-
export const OpenResponsesWebSearchPreview20250311ToolType$outboundSchema = OpenResponsesWebSearchPreview20250311ToolType$inboundSchema;
|
|
16
9
|
/** @internal */
|
|
17
10
|
export const OpenResponsesWebSearchPreview20250311Tool$inboundSchema = z.object({
|
|
18
|
-
type:
|
|
11
|
+
type: z.literal("web_search_preview_2025_03_11"),
|
|
19
12
|
search_context_size: ResponsesSearchContextSize$inboundSchema.optional(),
|
|
20
13
|
user_location: z.nullable(WebSearchPreviewToolUserLocation$inboundSchema)
|
|
21
14
|
.optional(),
|
|
@@ -27,7 +20,7 @@ export const OpenResponsesWebSearchPreview20250311Tool$inboundSchema = z.object(
|
|
|
27
20
|
});
|
|
28
21
|
/** @internal */
|
|
29
22
|
export const OpenResponsesWebSearchPreview20250311Tool$outboundSchema = z.object({
|
|
30
|
-
type:
|
|
23
|
+
type: z.literal("web_search_preview_2025_03_11"),
|
|
31
24
|
searchContextSize: ResponsesSearchContextSize$outboundSchema.optional(),
|
|
32
25
|
userLocation: z.nullable(WebSearchPreviewToolUserLocation$outboundSchema)
|
|
33
26
|
.optional(),
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
4
|
import { ResponsesSearchContextSize } from "./responsessearchcontextsize.js";
|
|
6
5
|
import { WebSearchPreviewToolUserLocation, WebSearchPreviewToolUserLocation$Outbound } from "./websearchpreviewtooluserlocation.js";
|
|
7
|
-
export declare const OpenResponsesWebSearchPreviewToolType: {
|
|
8
|
-
readonly WebSearchPreview: "web_search_preview";
|
|
9
|
-
};
|
|
10
|
-
export type OpenResponsesWebSearchPreviewToolType = ClosedEnum<typeof OpenResponsesWebSearchPreviewToolType>;
|
|
11
6
|
/**
|
|
12
7
|
* Web search preview tool configuration
|
|
13
8
|
*/
|
|
14
9
|
export type OpenResponsesWebSearchPreviewTool = {
|
|
15
|
-
type:
|
|
10
|
+
type: "web_search_preview";
|
|
16
11
|
/**
|
|
17
12
|
* Size of the search context for web search tools
|
|
18
13
|
*/
|
|
@@ -20,14 +15,10 @@ export type OpenResponsesWebSearchPreviewTool = {
|
|
|
20
15
|
userLocation?: WebSearchPreviewToolUserLocation | null | undefined;
|
|
21
16
|
};
|
|
22
17
|
/** @internal */
|
|
23
|
-
export declare const OpenResponsesWebSearchPreviewToolType$inboundSchema: z.ZodEnum<typeof OpenResponsesWebSearchPreviewToolType>;
|
|
24
|
-
/** @internal */
|
|
25
|
-
export declare const OpenResponsesWebSearchPreviewToolType$outboundSchema: z.ZodEnum<typeof OpenResponsesWebSearchPreviewToolType>;
|
|
26
|
-
/** @internal */
|
|
27
18
|
export declare const OpenResponsesWebSearchPreviewTool$inboundSchema: z.ZodType<OpenResponsesWebSearchPreviewTool, unknown>;
|
|
28
19
|
/** @internal */
|
|
29
20
|
export type OpenResponsesWebSearchPreviewTool$Outbound = {
|
|
30
|
-
type:
|
|
21
|
+
type: "web_search_preview";
|
|
31
22
|
search_context_size?: string | undefined;
|
|
32
23
|
user_location?: WebSearchPreviewToolUserLocation$Outbound | null | undefined;
|
|
33
24
|
};
|
|
@@ -6,16 +6,9 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { ResponsesSearchContextSize$inboundSchema, ResponsesSearchContextSize$outboundSchema, } from "./responsessearchcontextsize.js";
|
|
8
8
|
import { WebSearchPreviewToolUserLocation$inboundSchema, WebSearchPreviewToolUserLocation$outboundSchema, } from "./websearchpreviewtooluserlocation.js";
|
|
9
|
-
export const OpenResponsesWebSearchPreviewToolType = {
|
|
10
|
-
WebSearchPreview: "web_search_preview",
|
|
11
|
-
};
|
|
12
|
-
/** @internal */
|
|
13
|
-
export const OpenResponsesWebSearchPreviewToolType$inboundSchema = z.enum(OpenResponsesWebSearchPreviewToolType);
|
|
14
|
-
/** @internal */
|
|
15
|
-
export const OpenResponsesWebSearchPreviewToolType$outboundSchema = OpenResponsesWebSearchPreviewToolType$inboundSchema;
|
|
16
9
|
/** @internal */
|
|
17
10
|
export const OpenResponsesWebSearchPreviewTool$inboundSchema = z.object({
|
|
18
|
-
type:
|
|
11
|
+
type: z.literal("web_search_preview"),
|
|
19
12
|
search_context_size: ResponsesSearchContextSize$inboundSchema.optional(),
|
|
20
13
|
user_location: z.nullable(WebSearchPreviewToolUserLocation$inboundSchema)
|
|
21
14
|
.optional(),
|
|
@@ -27,7 +20,7 @@ export const OpenResponsesWebSearchPreviewTool$inboundSchema = z.object({
|
|
|
27
20
|
});
|
|
28
21
|
/** @internal */
|
|
29
22
|
export const OpenResponsesWebSearchPreviewTool$outboundSchema = z.object({
|
|
30
|
-
type:
|
|
23
|
+
type: z.literal("web_search_preview"),
|
|
31
24
|
searchContextSize: ResponsesSearchContextSize$outboundSchema.optional(),
|
|
32
25
|
userLocation: z.nullable(WebSearchPreviewToolUserLocation$outboundSchema)
|
|
33
26
|
.optional(),
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
4
|
import { ResponsesSearchContextSize } from "./responsessearchcontextsize.js";
|
|
6
5
|
import { ResponsesWebSearchUserLocation, ResponsesWebSearchUserLocation$Outbound } from "./responseswebsearchuserlocation.js";
|
|
7
|
-
export declare const OpenResponsesWebSearchToolType: {
|
|
8
|
-
readonly WebSearch: "web_search";
|
|
9
|
-
};
|
|
10
|
-
export type OpenResponsesWebSearchToolType = ClosedEnum<typeof OpenResponsesWebSearchToolType>;
|
|
11
6
|
export type OpenResponsesWebSearchToolFilters = {
|
|
12
7
|
allowedDomains?: Array<string> | null | undefined;
|
|
13
8
|
};
|
|
@@ -15,7 +10,7 @@ export type OpenResponsesWebSearchToolFilters = {
|
|
|
15
10
|
* Web search tool configuration
|
|
16
11
|
*/
|
|
17
12
|
export type OpenResponsesWebSearchTool = {
|
|
18
|
-
type:
|
|
13
|
+
type: "web_search";
|
|
19
14
|
filters?: OpenResponsesWebSearchToolFilters | null | undefined;
|
|
20
15
|
/**
|
|
21
16
|
* Size of the search context for web search tools
|
|
@@ -27,10 +22,6 @@ export type OpenResponsesWebSearchTool = {
|
|
|
27
22
|
userLocation?: ResponsesWebSearchUserLocation | null | undefined;
|
|
28
23
|
};
|
|
29
24
|
/** @internal */
|
|
30
|
-
export declare const OpenResponsesWebSearchToolType$inboundSchema: z.ZodEnum<typeof OpenResponsesWebSearchToolType>;
|
|
31
|
-
/** @internal */
|
|
32
|
-
export declare const OpenResponsesWebSearchToolType$outboundSchema: z.ZodEnum<typeof OpenResponsesWebSearchToolType>;
|
|
33
|
-
/** @internal */
|
|
34
25
|
export declare const OpenResponsesWebSearchToolFilters$inboundSchema: z.ZodType<OpenResponsesWebSearchToolFilters, unknown>;
|
|
35
26
|
/** @internal */
|
|
36
27
|
export type OpenResponsesWebSearchToolFilters$Outbound = {
|
|
@@ -44,7 +35,7 @@ export declare function openResponsesWebSearchToolFiltersFromJSON(jsonString: st
|
|
|
44
35
|
export declare const OpenResponsesWebSearchTool$inboundSchema: z.ZodType<OpenResponsesWebSearchTool, unknown>;
|
|
45
36
|
/** @internal */
|
|
46
37
|
export type OpenResponsesWebSearchTool$Outbound = {
|
|
47
|
-
type:
|
|
38
|
+
type: "web_search";
|
|
48
39
|
filters?: OpenResponsesWebSearchToolFilters$Outbound | null | undefined;
|
|
49
40
|
search_context_size?: string | undefined;
|
|
50
41
|
user_location?: ResponsesWebSearchUserLocation$Outbound | null | undefined;
|
|
@@ -6,13 +6,6 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { ResponsesSearchContextSize$inboundSchema, ResponsesSearchContextSize$outboundSchema, } from "./responsessearchcontextsize.js";
|
|
8
8
|
import { ResponsesWebSearchUserLocation$inboundSchema, ResponsesWebSearchUserLocation$outboundSchema, } from "./responseswebsearchuserlocation.js";
|
|
9
|
-
export const OpenResponsesWebSearchToolType = {
|
|
10
|
-
WebSearch: "web_search",
|
|
11
|
-
};
|
|
12
|
-
/** @internal */
|
|
13
|
-
export const OpenResponsesWebSearchToolType$inboundSchema = z.enum(OpenResponsesWebSearchToolType);
|
|
14
|
-
/** @internal */
|
|
15
|
-
export const OpenResponsesWebSearchToolType$outboundSchema = OpenResponsesWebSearchToolType$inboundSchema;
|
|
16
9
|
/** @internal */
|
|
17
10
|
export const OpenResponsesWebSearchToolFilters$inboundSchema = z.object({
|
|
18
11
|
allowed_domains: z.nullable(z.array(z.string())).optional(),
|
|
@@ -37,7 +30,7 @@ export function openResponsesWebSearchToolFiltersFromJSON(jsonString) {
|
|
|
37
30
|
}
|
|
38
31
|
/** @internal */
|
|
39
32
|
export const OpenResponsesWebSearchTool$inboundSchema = z.object({
|
|
40
|
-
type:
|
|
33
|
+
type: z.literal("web_search"),
|
|
41
34
|
filters: z.nullable(z.lazy(() => OpenResponsesWebSearchToolFilters$inboundSchema)).optional(),
|
|
42
35
|
search_context_size: ResponsesSearchContextSize$inboundSchema.optional(),
|
|
43
36
|
user_location: z.nullable(ResponsesWebSearchUserLocation$inboundSchema)
|
|
@@ -50,7 +43,7 @@ export const OpenResponsesWebSearchTool$inboundSchema = z.object({
|
|
|
50
43
|
});
|
|
51
44
|
/** @internal */
|
|
52
45
|
export const OpenResponsesWebSearchTool$outboundSchema = z.object({
|
|
53
|
-
type:
|
|
46
|
+
type: z.literal("web_search"),
|
|
54
47
|
filters: z.nullable(z.lazy(() => OpenResponsesWebSearchToolFilters$outboundSchema)).optional(),
|
|
55
48
|
searchContextSize: ResponsesSearchContextSize$outboundSchema.optional(),
|
|
56
49
|
userLocation: z.nullable(ResponsesWebSearchUserLocation$outboundSchema)
|