@openrouter/sdk 0.2.9 → 0.3.1
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/funcs/embeddingsGenerate.js +4 -2
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/chatgenerationparams.d.ts +234 -6
- package/esm/models/chatgenerationparams.js +162 -5
- package/esm/models/chatresponsechoice.d.ts +2 -0
- package/esm/models/chatresponsechoice.js +3 -0
- package/esm/models/chatstreamingmessagechunk.d.ts +2 -0
- package/esm/models/chatstreamingmessagechunk.js +3 -0
- package/esm/models/index.d.ts +8 -0
- package/esm/models/index.js +8 -0
- package/esm/models/openairesponsesreasoningeffort.d.ts +1 -0
- package/esm/models/openairesponsesreasoningeffort.js +1 -0
- package/esm/models/openresponsesrequest.d.ts +128 -93
- package/esm/models/openresponsesrequest.js +82 -87
- package/esm/models/operations/createembeddings.d.ts +10 -129
- package/esm/models/operations/createembeddings.js +10 -62
- package/esm/models/operations/getparameters.d.ts +3 -72
- package/esm/models/operations/getparameters.js +3 -71
- package/esm/models/parameter.d.ts +1 -0
- package/esm/models/parameter.js +1 -0
- package/esm/models/pdfparserengine.d.ts +17 -0
- package/esm/models/pdfparserengine.js +15 -0
- package/esm/models/pdfparseroptions.d.ts +19 -0
- package/esm/models/pdfparseroptions.js +13 -0
- package/esm/models/providername.d.ts +3 -0
- package/esm/models/providername.js +3 -0
- package/esm/models/providerpreferences.d.ts +215 -0
- package/esm/models/providerpreferences.js +135 -0
- package/esm/models/providersort.d.ts +0 -6
- package/esm/models/providersort.js +0 -3
- package/esm/models/providersortconfig.d.ts +23 -0
- package/esm/models/providersortconfig.js +22 -0
- package/esm/models/providersortunion.d.ts +10 -0
- package/esm/models/providersortunion.js +12 -0
- package/esm/models/publicendpoint.d.ts +24 -24
- package/esm/models/publicendpoint.js +12 -12
- package/esm/models/publicpricing.d.ts +24 -24
- package/esm/models/publicpricing.js +12 -12
- package/esm/models/schema0.d.ts +83 -0
- package/esm/models/schema0.js +85 -0
- package/esm/models/schema3.d.ts +50 -0
- package/esm/models/schema3.js +60 -0
- package/esm/models/websearchengine.d.ts +16 -0
- package/esm/models/websearchengine.js +14 -0
- package/esm/types/discriminatedUnion.d.ts +25 -0
- package/esm/types/discriminatedUnion.js +57 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
|
@@ -11,9 +11,12 @@ import { OpenResponsesWebSearch20250826Tool, OpenResponsesWebSearch20250826Tool$
|
|
|
11
11
|
import { OpenResponsesWebSearchPreview20250311Tool, OpenResponsesWebSearchPreview20250311Tool$Outbound } from "./openresponseswebsearchpreview20250311tool.js";
|
|
12
12
|
import { OpenResponsesWebSearchPreviewTool, OpenResponsesWebSearchPreviewTool$Outbound } from "./openresponseswebsearchpreviewtool.js";
|
|
13
13
|
import { OpenResponsesWebSearchTool, OpenResponsesWebSearchTool$Outbound } from "./openresponseswebsearchtool.js";
|
|
14
|
+
import { PDFParserOptions, PDFParserOptions$Outbound } from "./pdfparseroptions.js";
|
|
14
15
|
import { ProviderName } from "./providername.js";
|
|
15
16
|
import { ProviderSort } from "./providersort.js";
|
|
17
|
+
import { ProviderSortConfig, ProviderSortConfig$Outbound } from "./providersortconfig.js";
|
|
16
18
|
import { Quantization } from "./quantization.js";
|
|
19
|
+
import { WebSearchEngine } from "./websearchengine.js";
|
|
17
20
|
/**
|
|
18
21
|
* Function tool definition
|
|
19
22
|
*/
|
|
@@ -36,38 +39,42 @@ export declare const Truncation: {
|
|
|
36
39
|
readonly Disabled: "disabled";
|
|
37
40
|
};
|
|
38
41
|
export type Truncation = OpenEnum<typeof Truncation>;
|
|
39
|
-
export type
|
|
40
|
-
export type
|
|
41
|
-
export type
|
|
42
|
+
export type OpenResponsesRequestOrder = ProviderName | string;
|
|
43
|
+
export type OpenResponsesRequestOnly = ProviderName | string;
|
|
44
|
+
export type OpenResponsesRequestIgnore = ProviderName | string;
|
|
45
|
+
/**
|
|
46
|
+
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
47
|
+
*/
|
|
48
|
+
export type OpenResponsesRequestSort = ProviderSort | ProviderSortConfig | any;
|
|
42
49
|
/**
|
|
43
50
|
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
44
51
|
*/
|
|
45
|
-
export type
|
|
52
|
+
export type OpenResponsesRequestMaxPrice = {
|
|
46
53
|
/**
|
|
47
|
-
* A value in string
|
|
54
|
+
* A value in string format that is a large number
|
|
48
55
|
*/
|
|
49
|
-
prompt?:
|
|
56
|
+
prompt?: string | undefined;
|
|
50
57
|
/**
|
|
51
|
-
* A value in string
|
|
58
|
+
* A value in string format that is a large number
|
|
52
59
|
*/
|
|
53
|
-
completion?:
|
|
60
|
+
completion?: string | undefined;
|
|
54
61
|
/**
|
|
55
|
-
* A value in string
|
|
62
|
+
* A value in string format that is a large number
|
|
56
63
|
*/
|
|
57
|
-
image?:
|
|
64
|
+
image?: string | undefined;
|
|
58
65
|
/**
|
|
59
|
-
* A value in string
|
|
66
|
+
* A value in string format that is a large number
|
|
60
67
|
*/
|
|
61
|
-
audio?:
|
|
68
|
+
audio?: string | undefined;
|
|
62
69
|
/**
|
|
63
|
-
* A value in string
|
|
70
|
+
* A value in string format that is a large number
|
|
64
71
|
*/
|
|
65
|
-
request?:
|
|
72
|
+
request?: string | undefined;
|
|
66
73
|
};
|
|
67
74
|
/**
|
|
68
75
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
69
76
|
*/
|
|
70
|
-
export type
|
|
77
|
+
export type OpenResponsesRequestProvider = {
|
|
71
78
|
/**
|
|
72
79
|
* Whether to allow backup providers to serve requests
|
|
73
80
|
*
|
|
@@ -116,44 +123,67 @@ export type Provider = {
|
|
|
116
123
|
/**
|
|
117
124
|
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
118
125
|
*/
|
|
119
|
-
sort?: ProviderSort | null | undefined;
|
|
126
|
+
sort?: ProviderSort | ProviderSortConfig | any | null | undefined;
|
|
120
127
|
/**
|
|
121
128
|
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
122
129
|
*/
|
|
123
|
-
maxPrice?:
|
|
130
|
+
maxPrice?: OpenResponsesRequestMaxPrice | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
|
|
133
|
+
*/
|
|
134
|
+
preferredMinThroughput?: number | null | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
|
|
137
|
+
*/
|
|
138
|
+
preferredMaxLatency?: number | null | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* **DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput.
|
|
141
|
+
*
|
|
142
|
+
* @deprecated field: Use preferred_min_throughput instead..
|
|
143
|
+
*/
|
|
144
|
+
minThroughput?: number | null | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* **DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.
|
|
147
|
+
*
|
|
148
|
+
* @deprecated field: Use preferred_max_latency instead..
|
|
149
|
+
*/
|
|
150
|
+
maxLatency?: number | null | undefined;
|
|
124
151
|
};
|
|
125
|
-
export type
|
|
152
|
+
export type OpenResponsesRequestPluginResponseHealing = {
|
|
126
153
|
id: "response-healing";
|
|
154
|
+
/**
|
|
155
|
+
* Set to false to disable the response-healing plugin for this request. Defaults to true.
|
|
156
|
+
*/
|
|
157
|
+
enabled?: boolean | undefined;
|
|
127
158
|
};
|
|
128
|
-
export
|
|
129
|
-
readonly MistralOcr: "mistral-ocr";
|
|
130
|
-
readonly PdfText: "pdf-text";
|
|
131
|
-
readonly Native: "native";
|
|
132
|
-
};
|
|
133
|
-
export type PdfEngine = OpenEnum<typeof PdfEngine>;
|
|
134
|
-
export type Pdf = {
|
|
135
|
-
engine?: PdfEngine | undefined;
|
|
136
|
-
};
|
|
137
|
-
export type PluginFileParser = {
|
|
159
|
+
export type OpenResponsesRequestPluginFileParser = {
|
|
138
160
|
id: "file-parser";
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
161
|
+
/**
|
|
162
|
+
* Set to false to disable the file-parser plugin for this request. Defaults to true.
|
|
163
|
+
*/
|
|
164
|
+
enabled?: boolean | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Options for PDF parsing.
|
|
167
|
+
*/
|
|
168
|
+
pdf?: PDFParserOptions | undefined;
|
|
145
169
|
};
|
|
146
|
-
export type
|
|
147
|
-
export type PluginWeb = {
|
|
170
|
+
export type OpenResponsesRequestPluginWeb = {
|
|
148
171
|
id: "web";
|
|
172
|
+
/**
|
|
173
|
+
* Set to false to disable the web-search plugin for this request. Defaults to true.
|
|
174
|
+
*/
|
|
175
|
+
enabled?: boolean | undefined;
|
|
149
176
|
maxResults?: number | undefined;
|
|
150
177
|
searchPrompt?: string | undefined;
|
|
151
|
-
|
|
178
|
+
/**
|
|
179
|
+
* The search engine to use for web search.
|
|
180
|
+
*/
|
|
181
|
+
engine?: WebSearchEngine | undefined;
|
|
152
182
|
};
|
|
153
|
-
export type
|
|
183
|
+
export type OpenResponsesRequestPluginModeration = {
|
|
154
184
|
id: "moderation";
|
|
155
185
|
};
|
|
156
|
-
export type
|
|
186
|
+
export type OpenResponsesRequestPluginUnion = OpenResponsesRequestPluginModeration | OpenResponsesRequestPluginWeb | OpenResponsesRequestPluginFileParser | OpenResponsesRequestPluginResponseHealing;
|
|
157
187
|
/**
|
|
158
188
|
* Request schema for Responses endpoint
|
|
159
189
|
*/
|
|
@@ -199,15 +229,19 @@ export type OpenResponsesRequest = {
|
|
|
199
229
|
/**
|
|
200
230
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
201
231
|
*/
|
|
202
|
-
provider?:
|
|
232
|
+
provider?: OpenResponsesRequestProvider | null | undefined;
|
|
203
233
|
/**
|
|
204
234
|
* Plugins you want to enable for this request, including their settings.
|
|
205
235
|
*/
|
|
206
|
-
plugins?: Array<
|
|
236
|
+
plugins?: Array<OpenResponsesRequestPluginModeration | OpenResponsesRequestPluginWeb | OpenResponsesRequestPluginFileParser | OpenResponsesRequestPluginResponseHealing> | undefined;
|
|
207
237
|
/**
|
|
208
238
|
* 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.
|
|
209
239
|
*/
|
|
210
240
|
user?: string | undefined;
|
|
241
|
+
/**
|
|
242
|
+
* A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
|
|
243
|
+
*/
|
|
244
|
+
sessionId?: string | undefined;
|
|
211
245
|
};
|
|
212
246
|
/** @internal */
|
|
213
247
|
export type OpenResponsesRequestToolFunction$Outbound = {
|
|
@@ -232,33 +266,38 @@ export declare const ServiceTier$outboundSchema: z.ZodEnum<typeof ServiceTier>;
|
|
|
232
266
|
/** @internal */
|
|
233
267
|
export declare const Truncation$outboundSchema: z.ZodType<string, Truncation>;
|
|
234
268
|
/** @internal */
|
|
235
|
-
export type
|
|
269
|
+
export type OpenResponsesRequestOrder$Outbound = string | string;
|
|
236
270
|
/** @internal */
|
|
237
|
-
export declare const
|
|
238
|
-
export declare function
|
|
271
|
+
export declare const OpenResponsesRequestOrder$outboundSchema: z.ZodType<OpenResponsesRequestOrder$Outbound, OpenResponsesRequestOrder>;
|
|
272
|
+
export declare function openResponsesRequestOrderToJSON(openResponsesRequestOrder: OpenResponsesRequestOrder): string;
|
|
239
273
|
/** @internal */
|
|
240
|
-
export type
|
|
274
|
+
export type OpenResponsesRequestOnly$Outbound = string | string;
|
|
241
275
|
/** @internal */
|
|
242
|
-
export declare const
|
|
243
|
-
export declare function
|
|
276
|
+
export declare const OpenResponsesRequestOnly$outboundSchema: z.ZodType<OpenResponsesRequestOnly$Outbound, OpenResponsesRequestOnly>;
|
|
277
|
+
export declare function openResponsesRequestOnlyToJSON(openResponsesRequestOnly: OpenResponsesRequestOnly): string;
|
|
244
278
|
/** @internal */
|
|
245
|
-
export type
|
|
279
|
+
export type OpenResponsesRequestIgnore$Outbound = string | string;
|
|
246
280
|
/** @internal */
|
|
247
|
-
export declare const
|
|
248
|
-
export declare function
|
|
281
|
+
export declare const OpenResponsesRequestIgnore$outboundSchema: z.ZodType<OpenResponsesRequestIgnore$Outbound, OpenResponsesRequestIgnore>;
|
|
282
|
+
export declare function openResponsesRequestIgnoreToJSON(openResponsesRequestIgnore: OpenResponsesRequestIgnore): string;
|
|
249
283
|
/** @internal */
|
|
250
|
-
export type
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
284
|
+
export type OpenResponsesRequestSort$Outbound = string | ProviderSortConfig$Outbound | any;
|
|
285
|
+
/** @internal */
|
|
286
|
+
export declare const OpenResponsesRequestSort$outboundSchema: z.ZodType<OpenResponsesRequestSort$Outbound, OpenResponsesRequestSort>;
|
|
287
|
+
export declare function openResponsesRequestSortToJSON(openResponsesRequestSort: OpenResponsesRequestSort): string;
|
|
288
|
+
/** @internal */
|
|
289
|
+
export type OpenResponsesRequestMaxPrice$Outbound = {
|
|
290
|
+
prompt?: string | undefined;
|
|
291
|
+
completion?: string | undefined;
|
|
292
|
+
image?: string | undefined;
|
|
293
|
+
audio?: string | undefined;
|
|
294
|
+
request?: string | undefined;
|
|
256
295
|
};
|
|
257
296
|
/** @internal */
|
|
258
|
-
export declare const
|
|
259
|
-
export declare function
|
|
297
|
+
export declare const OpenResponsesRequestMaxPrice$outboundSchema: z.ZodType<OpenResponsesRequestMaxPrice$Outbound, OpenResponsesRequestMaxPrice>;
|
|
298
|
+
export declare function openResponsesRequestMaxPriceToJSON(openResponsesRequestMaxPrice: OpenResponsesRequestMaxPrice): string;
|
|
260
299
|
/** @internal */
|
|
261
|
-
export type
|
|
300
|
+
export type OpenResponsesRequestProvider$Outbound = {
|
|
262
301
|
allow_fallbacks?: boolean | null | undefined;
|
|
263
302
|
require_parameters?: boolean | null | undefined;
|
|
264
303
|
data_collection?: string | null | undefined;
|
|
@@ -268,61 +307,56 @@ export type Provider$Outbound = {
|
|
|
268
307
|
only?: Array<string | string> | null | undefined;
|
|
269
308
|
ignore?: Array<string | string> | null | undefined;
|
|
270
309
|
quantizations?: Array<string> | null | undefined;
|
|
271
|
-
sort?: string | null | undefined;
|
|
272
|
-
max_price?:
|
|
310
|
+
sort?: string | ProviderSortConfig$Outbound | any | null | undefined;
|
|
311
|
+
max_price?: OpenResponsesRequestMaxPrice$Outbound | undefined;
|
|
312
|
+
preferred_min_throughput?: number | null | undefined;
|
|
313
|
+
preferred_max_latency?: number | null | undefined;
|
|
314
|
+
min_throughput?: number | null | undefined;
|
|
315
|
+
max_latency?: number | null | undefined;
|
|
273
316
|
};
|
|
274
317
|
/** @internal */
|
|
275
|
-
export declare const
|
|
276
|
-
export declare function
|
|
318
|
+
export declare const OpenResponsesRequestProvider$outboundSchema: z.ZodType<OpenResponsesRequestProvider$Outbound, OpenResponsesRequestProvider>;
|
|
319
|
+
export declare function openResponsesRequestProviderToJSON(openResponsesRequestProvider: OpenResponsesRequestProvider): string;
|
|
277
320
|
/** @internal */
|
|
278
|
-
export type
|
|
321
|
+
export type OpenResponsesRequestPluginResponseHealing$Outbound = {
|
|
279
322
|
id: "response-healing";
|
|
323
|
+
enabled?: boolean | undefined;
|
|
280
324
|
};
|
|
281
325
|
/** @internal */
|
|
282
|
-
export declare const
|
|
283
|
-
export declare function
|
|
284
|
-
/** @internal */
|
|
285
|
-
export declare const PdfEngine$outboundSchema: z.ZodType<string, PdfEngine>;
|
|
286
|
-
/** @internal */
|
|
287
|
-
export type Pdf$Outbound = {
|
|
288
|
-
engine?: string | undefined;
|
|
289
|
-
};
|
|
290
|
-
/** @internal */
|
|
291
|
-
export declare const Pdf$outboundSchema: z.ZodType<Pdf$Outbound, Pdf>;
|
|
292
|
-
export declare function pdfToJSON(pdf: Pdf): string;
|
|
326
|
+
export declare const OpenResponsesRequestPluginResponseHealing$outboundSchema: z.ZodType<OpenResponsesRequestPluginResponseHealing$Outbound, OpenResponsesRequestPluginResponseHealing>;
|
|
327
|
+
export declare function openResponsesRequestPluginResponseHealingToJSON(openResponsesRequestPluginResponseHealing: OpenResponsesRequestPluginResponseHealing): string;
|
|
293
328
|
/** @internal */
|
|
294
|
-
export type
|
|
329
|
+
export type OpenResponsesRequestPluginFileParser$Outbound = {
|
|
295
330
|
id: "file-parser";
|
|
296
|
-
|
|
297
|
-
pdf?:
|
|
331
|
+
enabled?: boolean | undefined;
|
|
332
|
+
pdf?: PDFParserOptions$Outbound | undefined;
|
|
298
333
|
};
|
|
299
334
|
/** @internal */
|
|
300
|
-
export declare const
|
|
301
|
-
export declare function
|
|
302
|
-
/** @internal */
|
|
303
|
-
export declare const Engine$outboundSchema: z.ZodType<string, Engine>;
|
|
335
|
+
export declare const OpenResponsesRequestPluginFileParser$outboundSchema: z.ZodType<OpenResponsesRequestPluginFileParser$Outbound, OpenResponsesRequestPluginFileParser>;
|
|
336
|
+
export declare function openResponsesRequestPluginFileParserToJSON(openResponsesRequestPluginFileParser: OpenResponsesRequestPluginFileParser): string;
|
|
304
337
|
/** @internal */
|
|
305
|
-
export type
|
|
338
|
+
export type OpenResponsesRequestPluginWeb$Outbound = {
|
|
306
339
|
id: "web";
|
|
340
|
+
enabled?: boolean | undefined;
|
|
307
341
|
max_results?: number | undefined;
|
|
308
342
|
search_prompt?: string | undefined;
|
|
309
343
|
engine?: string | undefined;
|
|
310
344
|
};
|
|
311
345
|
/** @internal */
|
|
312
|
-
export declare const
|
|
313
|
-
export declare function
|
|
346
|
+
export declare const OpenResponsesRequestPluginWeb$outboundSchema: z.ZodType<OpenResponsesRequestPluginWeb$Outbound, OpenResponsesRequestPluginWeb>;
|
|
347
|
+
export declare function openResponsesRequestPluginWebToJSON(openResponsesRequestPluginWeb: OpenResponsesRequestPluginWeb): string;
|
|
314
348
|
/** @internal */
|
|
315
|
-
export type
|
|
349
|
+
export type OpenResponsesRequestPluginModeration$Outbound = {
|
|
316
350
|
id: "moderation";
|
|
317
351
|
};
|
|
318
352
|
/** @internal */
|
|
319
|
-
export declare const
|
|
320
|
-
export declare function
|
|
353
|
+
export declare const OpenResponsesRequestPluginModeration$outboundSchema: z.ZodType<OpenResponsesRequestPluginModeration$Outbound, OpenResponsesRequestPluginModeration>;
|
|
354
|
+
export declare function openResponsesRequestPluginModerationToJSON(openResponsesRequestPluginModeration: OpenResponsesRequestPluginModeration): string;
|
|
321
355
|
/** @internal */
|
|
322
|
-
export type
|
|
356
|
+
export type OpenResponsesRequestPluginUnion$Outbound = OpenResponsesRequestPluginModeration$Outbound | OpenResponsesRequestPluginWeb$Outbound | OpenResponsesRequestPluginFileParser$Outbound | OpenResponsesRequestPluginResponseHealing$Outbound;
|
|
323
357
|
/** @internal */
|
|
324
|
-
export declare const
|
|
325
|
-
export declare function
|
|
358
|
+
export declare const OpenResponsesRequestPluginUnion$outboundSchema: z.ZodType<OpenResponsesRequestPluginUnion$Outbound, OpenResponsesRequestPluginUnion>;
|
|
359
|
+
export declare function openResponsesRequestPluginUnionToJSON(openResponsesRequestPluginUnion: OpenResponsesRequestPluginUnion): string;
|
|
326
360
|
/** @internal */
|
|
327
361
|
export type OpenResponsesRequest$Outbound = {
|
|
328
362
|
input?: OpenResponsesInput$Outbound | undefined;
|
|
@@ -351,9 +385,10 @@ export type OpenResponsesRequest$Outbound = {
|
|
|
351
385
|
service_tier: string;
|
|
352
386
|
truncation?: string | null | undefined;
|
|
353
387
|
stream: boolean;
|
|
354
|
-
provider?:
|
|
355
|
-
plugins?: Array<
|
|
388
|
+
provider?: OpenResponsesRequestProvider$Outbound | null | undefined;
|
|
389
|
+
plugins?: Array<OpenResponsesRequestPluginModeration$Outbound | OpenResponsesRequestPluginWeb$Outbound | OpenResponsesRequestPluginFileParser$Outbound | OpenResponsesRequestPluginResponseHealing$Outbound> | undefined;
|
|
356
390
|
user?: string | undefined;
|
|
391
|
+
session_id?: string | undefined;
|
|
357
392
|
};
|
|
358
393
|
/** @internal */
|
|
359
394
|
export declare const OpenResponsesRequest$outboundSchema: z.ZodType<OpenResponsesRequest$Outbound, OpenResponsesRequest>;
|
|
@@ -15,9 +15,12 @@ import { OpenResponsesWebSearch20250826Tool$outboundSchema, } from "./openrespon
|
|
|
15
15
|
import { OpenResponsesWebSearchPreview20250311Tool$outboundSchema, } from "./openresponseswebsearchpreview20250311tool.js";
|
|
16
16
|
import { OpenResponsesWebSearchPreviewTool$outboundSchema, } from "./openresponseswebsearchpreviewtool.js";
|
|
17
17
|
import { OpenResponsesWebSearchTool$outboundSchema, } from "./openresponseswebsearchtool.js";
|
|
18
|
+
import { PDFParserOptions$outboundSchema, } from "./pdfparseroptions.js";
|
|
18
19
|
import { ProviderName$outboundSchema } from "./providername.js";
|
|
19
20
|
import { ProviderSort$outboundSchema } from "./providersort.js";
|
|
21
|
+
import { ProviderSortConfig$outboundSchema, } from "./providersortconfig.js";
|
|
20
22
|
import { Quantization$outboundSchema } from "./quantization.js";
|
|
23
|
+
import { WebSearchEngine$outboundSchema, } from "./websearchengine.js";
|
|
21
24
|
export const ServiceTier = {
|
|
22
25
|
Auto: "auto",
|
|
23
26
|
};
|
|
@@ -25,15 +28,6 @@ export const Truncation = {
|
|
|
25
28
|
Auto: "auto",
|
|
26
29
|
Disabled: "disabled",
|
|
27
30
|
};
|
|
28
|
-
export const PdfEngine = {
|
|
29
|
-
MistralOcr: "mistral-ocr",
|
|
30
|
-
PdfText: "pdf-text",
|
|
31
|
-
Native: "native",
|
|
32
|
-
};
|
|
33
|
-
export const Engine = {
|
|
34
|
-
Native: "native",
|
|
35
|
-
Exa: "exa",
|
|
36
|
-
};
|
|
37
31
|
/** @internal */
|
|
38
32
|
export const OpenResponsesRequestToolFunction$outboundSchema = z.object({
|
|
39
33
|
type: z.literal("function"),
|
|
@@ -61,53 +55,64 @@ export const ServiceTier$outboundSchema = z.enum(ServiceTier);
|
|
|
61
55
|
/** @internal */
|
|
62
56
|
export const Truncation$outboundSchema = openEnums.outboundSchema(Truncation);
|
|
63
57
|
/** @internal */
|
|
64
|
-
export const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
]);
|
|
68
|
-
export function orderToJSON(order) {
|
|
69
|
-
return JSON.stringify(Order$outboundSchema.parse(order));
|
|
58
|
+
export const OpenResponsesRequestOrder$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
59
|
+
export function openResponsesRequestOrderToJSON(openResponsesRequestOrder) {
|
|
60
|
+
return JSON.stringify(OpenResponsesRequestOrder$outboundSchema.parse(openResponsesRequestOrder));
|
|
70
61
|
}
|
|
71
62
|
/** @internal */
|
|
72
|
-
export const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
63
|
+
export const OpenResponsesRequestOnly$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
64
|
+
export function openResponsesRequestOnlyToJSON(openResponsesRequestOnly) {
|
|
65
|
+
return JSON.stringify(OpenResponsesRequestOnly$outboundSchema.parse(openResponsesRequestOnly));
|
|
66
|
+
}
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const OpenResponsesRequestIgnore$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
69
|
+
export function openResponsesRequestIgnoreToJSON(openResponsesRequestIgnore) {
|
|
70
|
+
return JSON.stringify(OpenResponsesRequestIgnore$outboundSchema.parse(openResponsesRequestIgnore));
|
|
78
71
|
}
|
|
79
72
|
/** @internal */
|
|
80
|
-
export const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
export const OpenResponsesRequestSort$outboundSchema = z.union([
|
|
74
|
+
ProviderSort$outboundSchema,
|
|
75
|
+
ProviderSortConfig$outboundSchema,
|
|
76
|
+
z.any(),
|
|
77
|
+
]);
|
|
78
|
+
export function openResponsesRequestSortToJSON(openResponsesRequestSort) {
|
|
79
|
+
return JSON.stringify(OpenResponsesRequestSort$outboundSchema.parse(openResponsesRequestSort));
|
|
84
80
|
}
|
|
85
81
|
/** @internal */
|
|
86
|
-
export const
|
|
87
|
-
.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
request: z.any().optional(),
|
|
82
|
+
export const OpenResponsesRequestMaxPrice$outboundSchema = z.object({
|
|
83
|
+
prompt: z.string().optional(),
|
|
84
|
+
completion: z.string().optional(),
|
|
85
|
+
image: z.string().optional(),
|
|
86
|
+
audio: z.string().optional(),
|
|
87
|
+
request: z.string().optional(),
|
|
93
88
|
});
|
|
94
|
-
export function
|
|
95
|
-
return JSON.stringify(
|
|
89
|
+
export function openResponsesRequestMaxPriceToJSON(openResponsesRequestMaxPrice) {
|
|
90
|
+
return JSON.stringify(OpenResponsesRequestMaxPrice$outboundSchema.parse(openResponsesRequestMaxPrice));
|
|
96
91
|
}
|
|
97
92
|
/** @internal */
|
|
98
|
-
export const
|
|
99
|
-
.object({
|
|
93
|
+
export const OpenResponsesRequestProvider$outboundSchema = z.object({
|
|
100
94
|
allowFallbacks: z.nullable(z.boolean()).optional(),
|
|
101
95
|
requireParameters: z.nullable(z.boolean()).optional(),
|
|
102
96
|
dataCollection: z.nullable(DataCollection$outboundSchema).optional(),
|
|
103
97
|
zdr: z.nullable(z.boolean()).optional(),
|
|
104
98
|
enforceDistillableText: z.nullable(z.boolean()).optional(),
|
|
105
|
-
order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
106
|
-
|
|
99
|
+
order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
100
|
+
.optional(),
|
|
101
|
+
only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
102
|
+
.optional(),
|
|
107
103
|
ignore: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))).optional(),
|
|
108
104
|
quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(),
|
|
109
|
-
sort: z.nullable(
|
|
110
|
-
|
|
105
|
+
sort: z.nullable(z.union([
|
|
106
|
+
ProviderSort$outboundSchema,
|
|
107
|
+
ProviderSortConfig$outboundSchema,
|
|
108
|
+
z.any(),
|
|
109
|
+
])).optional(),
|
|
110
|
+
maxPrice: z.lazy(() => OpenResponsesRequestMaxPrice$outboundSchema)
|
|
111
|
+
.optional(),
|
|
112
|
+
preferredMinThroughput: z.nullable(z.number()).optional(),
|
|
113
|
+
preferredMaxLatency: z.nullable(z.number()).optional(),
|
|
114
|
+
minThroughput: z.nullable(z.number()).optional(),
|
|
115
|
+
maxLatency: z.nullable(z.number()).optional(),
|
|
111
116
|
}).transform((v) => {
|
|
112
117
|
return remap$(v, {
|
|
113
118
|
allowFallbacks: "allow_fallbacks",
|
|
@@ -115,76 +120,64 @@ export const Provider$outboundSchema = z
|
|
|
115
120
|
dataCollection: "data_collection",
|
|
116
121
|
enforceDistillableText: "enforce_distillable_text",
|
|
117
122
|
maxPrice: "max_price",
|
|
123
|
+
preferredMinThroughput: "preferred_min_throughput",
|
|
124
|
+
preferredMaxLatency: "preferred_max_latency",
|
|
125
|
+
minThroughput: "min_throughput",
|
|
126
|
+
maxLatency: "max_latency",
|
|
118
127
|
});
|
|
119
128
|
});
|
|
120
|
-
export function
|
|
121
|
-
return JSON.stringify(
|
|
129
|
+
export function openResponsesRequestProviderToJSON(openResponsesRequestProvider) {
|
|
130
|
+
return JSON.stringify(OpenResponsesRequestProvider$outboundSchema.parse(openResponsesRequestProvider));
|
|
122
131
|
}
|
|
123
132
|
/** @internal */
|
|
124
|
-
export const
|
|
133
|
+
export const OpenResponsesRequestPluginResponseHealing$outboundSchema = z.object({
|
|
125
134
|
id: z.literal("response-healing"),
|
|
135
|
+
enabled: z.boolean().optional(),
|
|
126
136
|
});
|
|
127
|
-
export function
|
|
128
|
-
return JSON.stringify(
|
|
129
|
-
}
|
|
130
|
-
/** @internal */
|
|
131
|
-
export const PdfEngine$outboundSchema = openEnums
|
|
132
|
-
.outboundSchema(PdfEngine);
|
|
133
|
-
/** @internal */
|
|
134
|
-
export const Pdf$outboundSchema = z.object({
|
|
135
|
-
engine: PdfEngine$outboundSchema.optional(),
|
|
136
|
-
});
|
|
137
|
-
export function pdfToJSON(pdf) {
|
|
138
|
-
return JSON.stringify(Pdf$outboundSchema.parse(pdf));
|
|
137
|
+
export function openResponsesRequestPluginResponseHealingToJSON(openResponsesRequestPluginResponseHealing) {
|
|
138
|
+
return JSON.stringify(OpenResponsesRequestPluginResponseHealing$outboundSchema.parse(openResponsesRequestPluginResponseHealing));
|
|
139
139
|
}
|
|
140
140
|
/** @internal */
|
|
141
|
-
export const
|
|
141
|
+
export const OpenResponsesRequestPluginFileParser$outboundSchema = z.object({
|
|
142
142
|
id: z.literal("file-parser"),
|
|
143
|
-
|
|
144
|
-
pdf:
|
|
145
|
-
}).transform((v) => {
|
|
146
|
-
return remap$(v, {
|
|
147
|
-
maxFiles: "max_files",
|
|
148
|
-
});
|
|
143
|
+
enabled: z.boolean().optional(),
|
|
144
|
+
pdf: PDFParserOptions$outboundSchema.optional(),
|
|
149
145
|
});
|
|
150
|
-
export function
|
|
151
|
-
return JSON.stringify(
|
|
146
|
+
export function openResponsesRequestPluginFileParserToJSON(openResponsesRequestPluginFileParser) {
|
|
147
|
+
return JSON.stringify(OpenResponsesRequestPluginFileParser$outboundSchema.parse(openResponsesRequestPluginFileParser));
|
|
152
148
|
}
|
|
153
149
|
/** @internal */
|
|
154
|
-
export const
|
|
155
|
-
.outboundSchema(Engine);
|
|
156
|
-
/** @internal */
|
|
157
|
-
export const PluginWeb$outboundSchema = z.object({
|
|
150
|
+
export const OpenResponsesRequestPluginWeb$outboundSchema = z.object({
|
|
158
151
|
id: z.literal("web"),
|
|
152
|
+
enabled: z.boolean().optional(),
|
|
159
153
|
maxResults: z.number().optional(),
|
|
160
154
|
searchPrompt: z.string().optional(),
|
|
161
|
-
engine:
|
|
155
|
+
engine: WebSearchEngine$outboundSchema.optional(),
|
|
162
156
|
}).transform((v) => {
|
|
163
157
|
return remap$(v, {
|
|
164
158
|
maxResults: "max_results",
|
|
165
159
|
searchPrompt: "search_prompt",
|
|
166
160
|
});
|
|
167
161
|
});
|
|
168
|
-
export function
|
|
169
|
-
return JSON.stringify(
|
|
162
|
+
export function openResponsesRequestPluginWebToJSON(openResponsesRequestPluginWeb) {
|
|
163
|
+
return JSON.stringify(OpenResponsesRequestPluginWeb$outboundSchema.parse(openResponsesRequestPluginWeb));
|
|
170
164
|
}
|
|
171
165
|
/** @internal */
|
|
172
|
-
export const
|
|
166
|
+
export const OpenResponsesRequestPluginModeration$outboundSchema = z.object({
|
|
173
167
|
id: z.literal("moderation"),
|
|
174
168
|
});
|
|
175
|
-
export function
|
|
176
|
-
return JSON.stringify(
|
|
169
|
+
export function openResponsesRequestPluginModerationToJSON(openResponsesRequestPluginModeration) {
|
|
170
|
+
return JSON.stringify(OpenResponsesRequestPluginModeration$outboundSchema.parse(openResponsesRequestPluginModeration));
|
|
177
171
|
}
|
|
178
172
|
/** @internal */
|
|
179
|
-
export const
|
|
180
|
-
.
|
|
181
|
-
z.lazy(() =>
|
|
182
|
-
z.lazy(() =>
|
|
183
|
-
z.lazy(() =>
|
|
184
|
-
z.lazy(() => PluginResponseHealing$outboundSchema),
|
|
173
|
+
export const OpenResponsesRequestPluginUnion$outboundSchema = z.union([
|
|
174
|
+
z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema),
|
|
175
|
+
z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema),
|
|
176
|
+
z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema),
|
|
177
|
+
z.lazy(() => OpenResponsesRequestPluginResponseHealing$outboundSchema),
|
|
185
178
|
]);
|
|
186
|
-
export function
|
|
187
|
-
return JSON.stringify(
|
|
179
|
+
export function openResponsesRequestPluginUnionToJSON(openResponsesRequestPluginUnion) {
|
|
180
|
+
return JSON.stringify(OpenResponsesRequestPluginUnion$outboundSchema.parse(openResponsesRequestPluginUnion));
|
|
188
181
|
}
|
|
189
182
|
/** @internal */
|
|
190
183
|
export const OpenResponsesRequest$outboundSchema = z.object({
|
|
@@ -219,14 +212,15 @@ export const OpenResponsesRequest$outboundSchema = z.object({
|
|
|
219
212
|
serviceTier: ServiceTier$outboundSchema.default("auto"),
|
|
220
213
|
truncation: z.nullable(Truncation$outboundSchema).optional(),
|
|
221
214
|
stream: z.boolean().default(false),
|
|
222
|
-
provider: z.nullable(z.lazy(() =>
|
|
215
|
+
provider: z.nullable(z.lazy(() => OpenResponsesRequestProvider$outboundSchema)).optional(),
|
|
223
216
|
plugins: z.array(z.union([
|
|
224
|
-
z.lazy(() =>
|
|
225
|
-
z.lazy(() =>
|
|
226
|
-
z.lazy(() =>
|
|
227
|
-
z.lazy(() =>
|
|
217
|
+
z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema),
|
|
218
|
+
z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema),
|
|
219
|
+
z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema),
|
|
220
|
+
z.lazy(() => OpenResponsesRequestPluginResponseHealing$outboundSchema),
|
|
228
221
|
])).optional(),
|
|
229
222
|
user: z.string().optional(),
|
|
223
|
+
sessionId: z.string().optional(),
|
|
230
224
|
}).transform((v) => {
|
|
231
225
|
return remap$(v, {
|
|
232
226
|
toolChoice: "tool_choice",
|
|
@@ -238,6 +232,7 @@ export const OpenResponsesRequest$outboundSchema = z.object({
|
|
|
238
232
|
previousResponseId: "previous_response_id",
|
|
239
233
|
safetyIdentifier: "safety_identifier",
|
|
240
234
|
serviceTier: "service_tier",
|
|
235
|
+
sessionId: "session_id",
|
|
241
236
|
});
|
|
242
237
|
});
|
|
243
238
|
export function openResponsesRequestToJSON(openResponsesRequest) {
|