@openrouter/sdk 0.1.25 → 0.2.6
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/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 +5 -5
- package/esm/lib/response-wrapper.js +76 -55
- 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 +6 -8
- 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 +4 -4
- package/esm/models/chatgenerationparams.js +4 -4
- package/esm/models/chatmessagecontentitem.d.ts +2 -19
- package/esm/models/chatmessagecontentitem.js +6 -9
- 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 +4 -16
- package/esm/models/operations/createembeddings.js +2 -13
- 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
|
@@ -14,15 +14,11 @@ import { OpenResponsesWebSearchTool, OpenResponsesWebSearchTool$Outbound } from
|
|
|
14
14
|
import { ProviderName } from "./providername.js";
|
|
15
15
|
import { ProviderSort } from "./providersort.js";
|
|
16
16
|
import { Quantization } from "./quantization.js";
|
|
17
|
-
export declare const OpenResponsesRequestType: {
|
|
18
|
-
readonly Function: "function";
|
|
19
|
-
};
|
|
20
|
-
export type OpenResponsesRequestType = ClosedEnum<typeof OpenResponsesRequestType>;
|
|
21
17
|
/**
|
|
22
18
|
* Function tool definition
|
|
23
19
|
*/
|
|
24
20
|
export type OpenResponsesRequestToolFunction = {
|
|
25
|
-
type:
|
|
21
|
+
type: "function";
|
|
26
22
|
name: string;
|
|
27
23
|
description?: string | null | undefined;
|
|
28
24
|
strict?: boolean | null | undefined;
|
|
@@ -33,12 +29,8 @@ export type OpenResponsesRequestToolFunction = {
|
|
|
33
29
|
export type OpenResponsesRequestToolUnion = OpenResponsesRequestToolFunction | OpenResponsesWebSearchPreviewTool | OpenResponsesWebSearchPreview20250311Tool | OpenResponsesWebSearchTool | OpenResponsesWebSearch20250826Tool;
|
|
34
30
|
export declare const ServiceTier: {
|
|
35
31
|
readonly Auto: "auto";
|
|
36
|
-
readonly Default: "default";
|
|
37
|
-
readonly Flex: "flex";
|
|
38
|
-
readonly Priority: "priority";
|
|
39
|
-
readonly Scale: "scale";
|
|
40
32
|
};
|
|
41
|
-
export type ServiceTier =
|
|
33
|
+
export type ServiceTier = ClosedEnum<typeof ServiceTier>;
|
|
42
34
|
export declare const Truncation: {
|
|
43
35
|
readonly Auto: "auto";
|
|
44
36
|
readonly Disabled: "disabled";
|
|
@@ -130,10 +122,9 @@ export type Provider = {
|
|
|
130
122
|
*/
|
|
131
123
|
maxPrice?: MaxPrice | undefined;
|
|
132
124
|
};
|
|
133
|
-
export
|
|
134
|
-
|
|
125
|
+
export type PluginResponseHealing = {
|
|
126
|
+
id: "response-healing";
|
|
135
127
|
};
|
|
136
|
-
export type IdFileParser = ClosedEnum<typeof IdFileParser>;
|
|
137
128
|
export declare const PdfEngine: {
|
|
138
129
|
readonly MistralOcr: "mistral-ocr";
|
|
139
130
|
readonly PdfText: "pdf-text";
|
|
@@ -144,33 +135,25 @@ export type Pdf = {
|
|
|
144
135
|
engine?: PdfEngine | undefined;
|
|
145
136
|
};
|
|
146
137
|
export type PluginFileParser = {
|
|
147
|
-
id:
|
|
138
|
+
id: "file-parser";
|
|
148
139
|
maxFiles?: number | undefined;
|
|
149
140
|
pdf?: Pdf | undefined;
|
|
150
141
|
};
|
|
151
|
-
export declare const IdWeb: {
|
|
152
|
-
readonly Web: "web";
|
|
153
|
-
};
|
|
154
|
-
export type IdWeb = ClosedEnum<typeof IdWeb>;
|
|
155
142
|
export declare const Engine: {
|
|
156
143
|
readonly Native: "native";
|
|
157
144
|
readonly Exa: "exa";
|
|
158
145
|
};
|
|
159
146
|
export type Engine = OpenEnum<typeof Engine>;
|
|
160
147
|
export type PluginWeb = {
|
|
161
|
-
id:
|
|
148
|
+
id: "web";
|
|
162
149
|
maxResults?: number | undefined;
|
|
163
150
|
searchPrompt?: string | undefined;
|
|
164
151
|
engine?: Engine | undefined;
|
|
165
152
|
};
|
|
166
|
-
export declare const IdModeration: {
|
|
167
|
-
readonly Moderation: "moderation";
|
|
168
|
-
};
|
|
169
|
-
export type IdModeration = ClosedEnum<typeof IdModeration>;
|
|
170
153
|
export type PluginModeration = {
|
|
171
|
-
id:
|
|
154
|
+
id: "moderation";
|
|
172
155
|
};
|
|
173
|
-
export type Plugin = PluginModeration | PluginWeb | PluginFileParser;
|
|
156
|
+
export type Plugin = PluginModeration | PluginWeb | PluginFileParser | PluginResponseHealing;
|
|
174
157
|
/**
|
|
175
158
|
* Request schema for Responses endpoint
|
|
176
159
|
*/
|
|
@@ -209,8 +192,8 @@ export type OpenResponsesRequest = {
|
|
|
209
192
|
include?: Array<OpenAIResponsesIncludable> | null | undefined;
|
|
210
193
|
background?: boolean | null | undefined;
|
|
211
194
|
safetyIdentifier?: string | null | undefined;
|
|
212
|
-
store?:
|
|
213
|
-
serviceTier?: ServiceTier |
|
|
195
|
+
store?: false | undefined;
|
|
196
|
+
serviceTier?: ServiceTier | undefined;
|
|
214
197
|
truncation?: Truncation | null | undefined;
|
|
215
198
|
stream?: boolean | undefined;
|
|
216
199
|
/**
|
|
@@ -220,17 +203,15 @@ export type OpenResponsesRequest = {
|
|
|
220
203
|
/**
|
|
221
204
|
* Plugins you want to enable for this request, including their settings.
|
|
222
205
|
*/
|
|
223
|
-
plugins?: Array<PluginModeration | PluginWeb | PluginFileParser> | undefined;
|
|
206
|
+
plugins?: Array<PluginModeration | PluginWeb | PluginFileParser | PluginResponseHealing> | undefined;
|
|
224
207
|
/**
|
|
225
208
|
* A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
|
|
226
209
|
*/
|
|
227
210
|
user?: string | undefined;
|
|
228
211
|
};
|
|
229
212
|
/** @internal */
|
|
230
|
-
export declare const OpenResponsesRequestType$outboundSchema: z.ZodEnum<typeof OpenResponsesRequestType>;
|
|
231
|
-
/** @internal */
|
|
232
213
|
export type OpenResponsesRequestToolFunction$Outbound = {
|
|
233
|
-
type:
|
|
214
|
+
type: "function";
|
|
234
215
|
name: string;
|
|
235
216
|
description?: string | null | undefined;
|
|
236
217
|
strict?: boolean | null | undefined;
|
|
@@ -247,7 +228,7 @@ export type OpenResponsesRequestToolUnion$Outbound = OpenResponsesRequestToolFun
|
|
|
247
228
|
export declare const OpenResponsesRequestToolUnion$outboundSchema: z.ZodType<OpenResponsesRequestToolUnion$Outbound, OpenResponsesRequestToolUnion>;
|
|
248
229
|
export declare function openResponsesRequestToolUnionToJSON(openResponsesRequestToolUnion: OpenResponsesRequestToolUnion): string;
|
|
249
230
|
/** @internal */
|
|
250
|
-
export declare const ServiceTier$outboundSchema: z.
|
|
231
|
+
export declare const ServiceTier$outboundSchema: z.ZodEnum<typeof ServiceTier>;
|
|
251
232
|
/** @internal */
|
|
252
233
|
export declare const Truncation$outboundSchema: z.ZodType<string, Truncation>;
|
|
253
234
|
/** @internal */
|
|
@@ -294,7 +275,12 @@ export type Provider$Outbound = {
|
|
|
294
275
|
export declare const Provider$outboundSchema: z.ZodType<Provider$Outbound, Provider>;
|
|
295
276
|
export declare function providerToJSON(provider: Provider): string;
|
|
296
277
|
/** @internal */
|
|
297
|
-
export
|
|
278
|
+
export type PluginResponseHealing$Outbound = {
|
|
279
|
+
id: "response-healing";
|
|
280
|
+
};
|
|
281
|
+
/** @internal */
|
|
282
|
+
export declare const PluginResponseHealing$outboundSchema: z.ZodType<PluginResponseHealing$Outbound, PluginResponseHealing>;
|
|
283
|
+
export declare function pluginResponseHealingToJSON(pluginResponseHealing: PluginResponseHealing): string;
|
|
298
284
|
/** @internal */
|
|
299
285
|
export declare const PdfEngine$outboundSchema: z.ZodType<string, PdfEngine>;
|
|
300
286
|
/** @internal */
|
|
@@ -306,7 +292,7 @@ export declare const Pdf$outboundSchema: z.ZodType<Pdf$Outbound, Pdf>;
|
|
|
306
292
|
export declare function pdfToJSON(pdf: Pdf): string;
|
|
307
293
|
/** @internal */
|
|
308
294
|
export type PluginFileParser$Outbound = {
|
|
309
|
-
id:
|
|
295
|
+
id: "file-parser";
|
|
310
296
|
max_files?: number | undefined;
|
|
311
297
|
pdf?: Pdf$Outbound | undefined;
|
|
312
298
|
};
|
|
@@ -314,12 +300,10 @@ export type PluginFileParser$Outbound = {
|
|
|
314
300
|
export declare const PluginFileParser$outboundSchema: z.ZodType<PluginFileParser$Outbound, PluginFileParser>;
|
|
315
301
|
export declare function pluginFileParserToJSON(pluginFileParser: PluginFileParser): string;
|
|
316
302
|
/** @internal */
|
|
317
|
-
export declare const IdWeb$outboundSchema: z.ZodEnum<typeof IdWeb>;
|
|
318
|
-
/** @internal */
|
|
319
303
|
export declare const Engine$outboundSchema: z.ZodType<string, Engine>;
|
|
320
304
|
/** @internal */
|
|
321
305
|
export type PluginWeb$Outbound = {
|
|
322
|
-
id:
|
|
306
|
+
id: "web";
|
|
323
307
|
max_results?: number | undefined;
|
|
324
308
|
search_prompt?: string | undefined;
|
|
325
309
|
engine?: string | undefined;
|
|
@@ -328,16 +312,14 @@ export type PluginWeb$Outbound = {
|
|
|
328
312
|
export declare const PluginWeb$outboundSchema: z.ZodType<PluginWeb$Outbound, PluginWeb>;
|
|
329
313
|
export declare function pluginWebToJSON(pluginWeb: PluginWeb): string;
|
|
330
314
|
/** @internal */
|
|
331
|
-
export declare const IdModeration$outboundSchema: z.ZodEnum<typeof IdModeration>;
|
|
332
|
-
/** @internal */
|
|
333
315
|
export type PluginModeration$Outbound = {
|
|
334
|
-
id:
|
|
316
|
+
id: "moderation";
|
|
335
317
|
};
|
|
336
318
|
/** @internal */
|
|
337
319
|
export declare const PluginModeration$outboundSchema: z.ZodType<PluginModeration$Outbound, PluginModeration>;
|
|
338
320
|
export declare function pluginModerationToJSON(pluginModeration: PluginModeration): string;
|
|
339
321
|
/** @internal */
|
|
340
|
-
export type Plugin$Outbound = PluginModeration$Outbound | PluginWeb$Outbound | PluginFileParser$Outbound;
|
|
322
|
+
export type Plugin$Outbound = PluginModeration$Outbound | PluginWeb$Outbound | PluginFileParser$Outbound | PluginResponseHealing$Outbound;
|
|
341
323
|
/** @internal */
|
|
342
324
|
export declare const Plugin$outboundSchema: z.ZodType<Plugin$Outbound, Plugin>;
|
|
343
325
|
export declare function pluginToJSON(plugin: Plugin): string;
|
|
@@ -365,12 +347,12 @@ export type OpenResponsesRequest$Outbound = {
|
|
|
365
347
|
include?: Array<string> | null | undefined;
|
|
366
348
|
background?: boolean | null | undefined;
|
|
367
349
|
safety_identifier?: string | null | undefined;
|
|
368
|
-
store
|
|
369
|
-
service_tier
|
|
350
|
+
store: false;
|
|
351
|
+
service_tier: string;
|
|
370
352
|
truncation?: string | null | undefined;
|
|
371
353
|
stream: boolean;
|
|
372
354
|
provider?: Provider$Outbound | null | undefined;
|
|
373
|
-
plugins?: Array<PluginModeration$Outbound | PluginWeb$Outbound | PluginFileParser$Outbound> | undefined;
|
|
355
|
+
plugins?: Array<PluginModeration$Outbound | PluginWeb$Outbound | PluginFileParser$Outbound | PluginResponseHealing$Outbound> | undefined;
|
|
374
356
|
user?: string | undefined;
|
|
375
357
|
};
|
|
376
358
|
/** @internal */
|
|
@@ -18,43 +18,25 @@ import { OpenResponsesWebSearchTool$outboundSchema, } from "./openresponseswebse
|
|
|
18
18
|
import { ProviderName$outboundSchema } from "./providername.js";
|
|
19
19
|
import { ProviderSort$outboundSchema } from "./providersort.js";
|
|
20
20
|
import { Quantization$outboundSchema } from "./quantization.js";
|
|
21
|
-
export const OpenResponsesRequestType = {
|
|
22
|
-
Function: "function",
|
|
23
|
-
};
|
|
24
21
|
export const ServiceTier = {
|
|
25
22
|
Auto: "auto",
|
|
26
|
-
Default: "default",
|
|
27
|
-
Flex: "flex",
|
|
28
|
-
Priority: "priority",
|
|
29
|
-
Scale: "scale",
|
|
30
23
|
};
|
|
31
24
|
export const Truncation = {
|
|
32
25
|
Auto: "auto",
|
|
33
26
|
Disabled: "disabled",
|
|
34
27
|
};
|
|
35
|
-
export const IdFileParser = {
|
|
36
|
-
FileParser: "file-parser",
|
|
37
|
-
};
|
|
38
28
|
export const PdfEngine = {
|
|
39
29
|
MistralOcr: "mistral-ocr",
|
|
40
30
|
PdfText: "pdf-text",
|
|
41
31
|
Native: "native",
|
|
42
32
|
};
|
|
43
|
-
export const IdWeb = {
|
|
44
|
-
Web: "web",
|
|
45
|
-
};
|
|
46
33
|
export const Engine = {
|
|
47
34
|
Native: "native",
|
|
48
35
|
Exa: "exa",
|
|
49
36
|
};
|
|
50
|
-
export const IdModeration = {
|
|
51
|
-
Moderation: "moderation",
|
|
52
|
-
};
|
|
53
|
-
/** @internal */
|
|
54
|
-
export const OpenResponsesRequestType$outboundSchema = z.enum(OpenResponsesRequestType);
|
|
55
37
|
/** @internal */
|
|
56
38
|
export const OpenResponsesRequestToolFunction$outboundSchema = z.object({
|
|
57
|
-
type:
|
|
39
|
+
type: z.literal("function"),
|
|
58
40
|
name: z.string(),
|
|
59
41
|
description: z.nullable(z.string()).optional(),
|
|
60
42
|
strict: z.nullable(z.boolean()).optional(),
|
|
@@ -75,7 +57,7 @@ export function openResponsesRequestToolUnionToJSON(openResponsesRequestToolUnio
|
|
|
75
57
|
return JSON.stringify(OpenResponsesRequestToolUnion$outboundSchema.parse(openResponsesRequestToolUnion));
|
|
76
58
|
}
|
|
77
59
|
/** @internal */
|
|
78
|
-
export const ServiceTier$outboundSchema =
|
|
60
|
+
export const ServiceTier$outboundSchema = z.enum(ServiceTier);
|
|
79
61
|
/** @internal */
|
|
80
62
|
export const Truncation$outboundSchema = openEnums.outboundSchema(Truncation);
|
|
81
63
|
/** @internal */
|
|
@@ -139,8 +121,12 @@ export function providerToJSON(provider) {
|
|
|
139
121
|
return JSON.stringify(Provider$outboundSchema.parse(provider));
|
|
140
122
|
}
|
|
141
123
|
/** @internal */
|
|
142
|
-
export const
|
|
143
|
-
.
|
|
124
|
+
export const PluginResponseHealing$outboundSchema = z.object({
|
|
125
|
+
id: z.literal("response-healing"),
|
|
126
|
+
});
|
|
127
|
+
export function pluginResponseHealingToJSON(pluginResponseHealing) {
|
|
128
|
+
return JSON.stringify(PluginResponseHealing$outboundSchema.parse(pluginResponseHealing));
|
|
129
|
+
}
|
|
144
130
|
/** @internal */
|
|
145
131
|
export const PdfEngine$outboundSchema = openEnums
|
|
146
132
|
.outboundSchema(PdfEngine);
|
|
@@ -153,7 +139,7 @@ export function pdfToJSON(pdf) {
|
|
|
153
139
|
}
|
|
154
140
|
/** @internal */
|
|
155
141
|
export const PluginFileParser$outboundSchema = z.object({
|
|
156
|
-
id:
|
|
142
|
+
id: z.literal("file-parser"),
|
|
157
143
|
maxFiles: z.number().optional(),
|
|
158
144
|
pdf: z.lazy(() => Pdf$outboundSchema).optional(),
|
|
159
145
|
}).transform((v) => {
|
|
@@ -165,13 +151,11 @@ export function pluginFileParserToJSON(pluginFileParser) {
|
|
|
165
151
|
return JSON.stringify(PluginFileParser$outboundSchema.parse(pluginFileParser));
|
|
166
152
|
}
|
|
167
153
|
/** @internal */
|
|
168
|
-
export const IdWeb$outboundSchema = z.enum(IdWeb);
|
|
169
|
-
/** @internal */
|
|
170
154
|
export const Engine$outboundSchema = openEnums
|
|
171
155
|
.outboundSchema(Engine);
|
|
172
156
|
/** @internal */
|
|
173
157
|
export const PluginWeb$outboundSchema = z.object({
|
|
174
|
-
id:
|
|
158
|
+
id: z.literal("web"),
|
|
175
159
|
maxResults: z.number().optional(),
|
|
176
160
|
searchPrompt: z.string().optional(),
|
|
177
161
|
engine: Engine$outboundSchema.optional(),
|
|
@@ -185,11 +169,8 @@ export function pluginWebToJSON(pluginWeb) {
|
|
|
185
169
|
return JSON.stringify(PluginWeb$outboundSchema.parse(pluginWeb));
|
|
186
170
|
}
|
|
187
171
|
/** @internal */
|
|
188
|
-
export const IdModeration$outboundSchema = z
|
|
189
|
-
.enum(IdModeration);
|
|
190
|
-
/** @internal */
|
|
191
172
|
export const PluginModeration$outboundSchema = z.object({
|
|
192
|
-
id:
|
|
173
|
+
id: z.literal("moderation"),
|
|
193
174
|
});
|
|
194
175
|
export function pluginModerationToJSON(pluginModeration) {
|
|
195
176
|
return JSON.stringify(PluginModeration$outboundSchema.parse(pluginModeration));
|
|
@@ -200,6 +181,7 @@ export const Plugin$outboundSchema = z
|
|
|
200
181
|
z.lazy(() => PluginModeration$outboundSchema),
|
|
201
182
|
z.lazy(() => PluginWeb$outboundSchema),
|
|
202
183
|
z.lazy(() => PluginFileParser$outboundSchema),
|
|
184
|
+
z.lazy(() => PluginResponseHealing$outboundSchema),
|
|
203
185
|
]);
|
|
204
186
|
export function pluginToJSON(plugin) {
|
|
205
187
|
return JSON.stringify(Plugin$outboundSchema.parse(plugin));
|
|
@@ -233,8 +215,8 @@ export const OpenResponsesRequest$outboundSchema = z.object({
|
|
|
233
215
|
.optional(),
|
|
234
216
|
background: z.nullable(z.boolean()).optional(),
|
|
235
217
|
safetyIdentifier: z.nullable(z.string()).optional(),
|
|
236
|
-
store: z.
|
|
237
|
-
serviceTier:
|
|
218
|
+
store: z.literal(false).default(false),
|
|
219
|
+
serviceTier: ServiceTier$outboundSchema.default("auto"),
|
|
238
220
|
truncation: z.nullable(Truncation$outboundSchema).optional(),
|
|
239
221
|
stream: z.boolean().default(false),
|
|
240
222
|
provider: z.nullable(z.lazy(() => Provider$outboundSchema)).optional(),
|
|
@@ -242,6 +224,7 @@ export const OpenResponsesRequest$outboundSchema = z.object({
|
|
|
242
224
|
z.lazy(() => PluginModeration$outboundSchema),
|
|
243
225
|
z.lazy(() => PluginWeb$outboundSchema),
|
|
244
226
|
z.lazy(() => PluginFileParser$outboundSchema),
|
|
227
|
+
z.lazy(() => PluginResponseHealing$outboundSchema),
|
|
245
228
|
])).optional(),
|
|
246
229
|
user: z.string().optional(),
|
|
247
230
|
}).transform((v) => {
|