@openrouter/sdk 0.2.9 → 0.2.11
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 +244 -2
- package/esm/models/chatgenerationparams.js +163 -1
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/openairesponsesreasoningeffort.d.ts +1 -0
- package/esm/models/openairesponsesreasoningeffort.js +1 -0
- package/esm/models/openresponsesrequest.d.ts +111 -63
- package/esm/models/openresponsesrequest.js +70 -53
- package/esm/models/operations/createembeddings.d.ts +30 -16
- package/esm/models/operations/createembeddings.js +18 -6
- package/esm/models/operations/getparameters.d.ts +3 -0
- package/esm/models/operations/getparameters.js +3 -0
- package/esm/models/providername.d.ts +3 -0
- package/esm/models/providername.js +3 -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/jsr.json +1 -1
- package/package.json +1 -1
|
@@ -42,32 +42,32 @@ export type Ignore = ProviderName | string;
|
|
|
42
42
|
/**
|
|
43
43
|
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
44
44
|
*/
|
|
45
|
-
export type
|
|
45
|
+
export type OpenResponsesRequestMaxPrice = {
|
|
46
46
|
/**
|
|
47
|
-
* A value in string
|
|
47
|
+
* A value in string format that is a large number
|
|
48
48
|
*/
|
|
49
|
-
prompt?:
|
|
49
|
+
prompt?: string | undefined;
|
|
50
50
|
/**
|
|
51
|
-
* A value in string
|
|
51
|
+
* A value in string format that is a large number
|
|
52
52
|
*/
|
|
53
|
-
completion?:
|
|
53
|
+
completion?: string | undefined;
|
|
54
54
|
/**
|
|
55
|
-
* A value in string
|
|
55
|
+
* A value in string format that is a large number
|
|
56
56
|
*/
|
|
57
|
-
image?:
|
|
57
|
+
image?: string | undefined;
|
|
58
58
|
/**
|
|
59
|
-
* A value in string
|
|
59
|
+
* A value in string format that is a large number
|
|
60
60
|
*/
|
|
61
|
-
audio?:
|
|
61
|
+
audio?: string | undefined;
|
|
62
62
|
/**
|
|
63
|
-
* A value in string
|
|
63
|
+
* A value in string format that is a large number
|
|
64
64
|
*/
|
|
65
|
-
request?:
|
|
65
|
+
request?: string | undefined;
|
|
66
66
|
};
|
|
67
67
|
/**
|
|
68
68
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
69
69
|
*/
|
|
70
|
-
export type
|
|
70
|
+
export type OpenResponsesRequestProvider = {
|
|
71
71
|
/**
|
|
72
72
|
* Whether to allow backup providers to serve requests
|
|
73
73
|
*
|
|
@@ -120,40 +120,71 @@ export type Provider = {
|
|
|
120
120
|
/**
|
|
121
121
|
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
122
122
|
*/
|
|
123
|
-
maxPrice?:
|
|
123
|
+
maxPrice?: OpenResponsesRequestMaxPrice | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used.
|
|
126
|
+
*/
|
|
127
|
+
minThroughput?: number | null | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used.
|
|
130
|
+
*/
|
|
131
|
+
maxLatency?: number | null | undefined;
|
|
124
132
|
};
|
|
125
|
-
export type
|
|
133
|
+
export type OpenResponsesRequestPluginResponseHealing = {
|
|
126
134
|
id: "response-healing";
|
|
135
|
+
/**
|
|
136
|
+
* Set to false to disable the response-healing plugin for this request. Defaults to true.
|
|
137
|
+
*/
|
|
138
|
+
enabled?: boolean | undefined;
|
|
127
139
|
};
|
|
128
|
-
export declare const
|
|
140
|
+
export declare const OpenResponsesRequestPdfEngine: {
|
|
129
141
|
readonly MistralOcr: "mistral-ocr";
|
|
130
142
|
readonly PdfText: "pdf-text";
|
|
131
143
|
readonly Native: "native";
|
|
132
144
|
};
|
|
133
|
-
export type
|
|
134
|
-
export type
|
|
135
|
-
engine?:
|
|
145
|
+
export type OpenResponsesRequestPdfEngine = OpenEnum<typeof OpenResponsesRequestPdfEngine>;
|
|
146
|
+
export type OpenResponsesRequestPdf = {
|
|
147
|
+
engine?: OpenResponsesRequestPdfEngine | undefined;
|
|
136
148
|
};
|
|
137
|
-
export type
|
|
149
|
+
export type OpenResponsesRequestPluginFileParser = {
|
|
138
150
|
id: "file-parser";
|
|
151
|
+
/**
|
|
152
|
+
* Set to false to disable the file-parser plugin for this request. Defaults to true.
|
|
153
|
+
*/
|
|
154
|
+
enabled?: boolean | undefined;
|
|
139
155
|
maxFiles?: number | undefined;
|
|
140
|
-
pdf?:
|
|
156
|
+
pdf?: OpenResponsesRequestPdf | undefined;
|
|
141
157
|
};
|
|
142
|
-
export declare const
|
|
158
|
+
export declare const OpenResponsesRequestEngine: {
|
|
143
159
|
readonly Native: "native";
|
|
144
160
|
readonly Exa: "exa";
|
|
145
161
|
};
|
|
146
|
-
export type
|
|
147
|
-
export type
|
|
162
|
+
export type OpenResponsesRequestEngine = OpenEnum<typeof OpenResponsesRequestEngine>;
|
|
163
|
+
export type OpenResponsesRequestPluginWeb = {
|
|
148
164
|
id: "web";
|
|
165
|
+
/**
|
|
166
|
+
* Set to false to disable the web-search plugin for this request. Defaults to true.
|
|
167
|
+
*/
|
|
168
|
+
enabled?: boolean | undefined;
|
|
149
169
|
maxResults?: number | undefined;
|
|
150
170
|
searchPrompt?: string | undefined;
|
|
151
|
-
engine?:
|
|
171
|
+
engine?: OpenResponsesRequestEngine | undefined;
|
|
152
172
|
};
|
|
153
|
-
export type
|
|
173
|
+
export type OpenResponsesRequestPluginModeration = {
|
|
154
174
|
id: "moderation";
|
|
155
175
|
};
|
|
156
|
-
export type
|
|
176
|
+
export type OpenResponsesRequestPluginUnion = OpenResponsesRequestPluginModeration | OpenResponsesRequestPluginWeb | OpenResponsesRequestPluginFileParser | OpenResponsesRequestPluginResponseHealing;
|
|
177
|
+
/**
|
|
178
|
+
* Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria.
|
|
179
|
+
*/
|
|
180
|
+
export declare const OpenResponsesRequestRoute: {
|
|
181
|
+
readonly Fallback: "fallback";
|
|
182
|
+
readonly Sort: "sort";
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria.
|
|
186
|
+
*/
|
|
187
|
+
export type OpenResponsesRequestRoute = OpenEnum<typeof OpenResponsesRequestRoute>;
|
|
157
188
|
/**
|
|
158
189
|
* Request schema for Responses endpoint
|
|
159
190
|
*/
|
|
@@ -199,15 +230,23 @@ export type OpenResponsesRequest = {
|
|
|
199
230
|
/**
|
|
200
231
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
201
232
|
*/
|
|
202
|
-
provider?:
|
|
233
|
+
provider?: OpenResponsesRequestProvider | null | undefined;
|
|
203
234
|
/**
|
|
204
235
|
* Plugins you want to enable for this request, including their settings.
|
|
205
236
|
*/
|
|
206
|
-
plugins?: Array<
|
|
237
|
+
plugins?: Array<OpenResponsesRequestPluginModeration | OpenResponsesRequestPluginWeb | OpenResponsesRequestPluginFileParser | OpenResponsesRequestPluginResponseHealing> | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria.
|
|
240
|
+
*/
|
|
241
|
+
route?: OpenResponsesRequestRoute | null | undefined;
|
|
207
242
|
/**
|
|
208
243
|
* 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
244
|
*/
|
|
210
245
|
user?: string | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* 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.
|
|
248
|
+
*/
|
|
249
|
+
sessionId?: string | undefined;
|
|
211
250
|
};
|
|
212
251
|
/** @internal */
|
|
213
252
|
export type OpenResponsesRequestToolFunction$Outbound = {
|
|
@@ -247,18 +286,18 @@ export type Ignore$Outbound = string | string;
|
|
|
247
286
|
export declare const Ignore$outboundSchema: z.ZodType<Ignore$Outbound, Ignore>;
|
|
248
287
|
export declare function ignoreToJSON(ignore: Ignore): string;
|
|
249
288
|
/** @internal */
|
|
250
|
-
export type
|
|
251
|
-
prompt?:
|
|
252
|
-
completion?:
|
|
253
|
-
image?:
|
|
254
|
-
audio?:
|
|
255
|
-
request?:
|
|
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;
|
|
@@ -269,60 +308,67 @@ export type Provider$Outbound = {
|
|
|
269
308
|
ignore?: Array<string | string> | null | undefined;
|
|
270
309
|
quantizations?: Array<string> | null | undefined;
|
|
271
310
|
sort?: string | null | undefined;
|
|
272
|
-
max_price?:
|
|
311
|
+
max_price?: OpenResponsesRequestMaxPrice$Outbound | undefined;
|
|
312
|
+
min_throughput?: number | null | undefined;
|
|
313
|
+
max_latency?: number | null | undefined;
|
|
273
314
|
};
|
|
274
315
|
/** @internal */
|
|
275
|
-
export declare const
|
|
276
|
-
export declare function
|
|
316
|
+
export declare const OpenResponsesRequestProvider$outboundSchema: z.ZodType<OpenResponsesRequestProvider$Outbound, OpenResponsesRequestProvider>;
|
|
317
|
+
export declare function openResponsesRequestProviderToJSON(openResponsesRequestProvider: OpenResponsesRequestProvider): string;
|
|
277
318
|
/** @internal */
|
|
278
|
-
export type
|
|
319
|
+
export type OpenResponsesRequestPluginResponseHealing$Outbound = {
|
|
279
320
|
id: "response-healing";
|
|
321
|
+
enabled?: boolean | undefined;
|
|
280
322
|
};
|
|
281
323
|
/** @internal */
|
|
282
|
-
export declare const
|
|
283
|
-
export declare function
|
|
324
|
+
export declare const OpenResponsesRequestPluginResponseHealing$outboundSchema: z.ZodType<OpenResponsesRequestPluginResponseHealing$Outbound, OpenResponsesRequestPluginResponseHealing>;
|
|
325
|
+
export declare function openResponsesRequestPluginResponseHealingToJSON(openResponsesRequestPluginResponseHealing: OpenResponsesRequestPluginResponseHealing): string;
|
|
284
326
|
/** @internal */
|
|
285
|
-
export declare const
|
|
327
|
+
export declare const OpenResponsesRequestPdfEngine$outboundSchema: z.ZodType<string, OpenResponsesRequestPdfEngine>;
|
|
286
328
|
/** @internal */
|
|
287
|
-
export type
|
|
329
|
+
export type OpenResponsesRequestPdf$Outbound = {
|
|
288
330
|
engine?: string | undefined;
|
|
289
331
|
};
|
|
290
332
|
/** @internal */
|
|
291
|
-
export declare const
|
|
292
|
-
export declare function
|
|
333
|
+
export declare const OpenResponsesRequestPdf$outboundSchema: z.ZodType<OpenResponsesRequestPdf$Outbound, OpenResponsesRequestPdf>;
|
|
334
|
+
export declare function openResponsesRequestPdfToJSON(openResponsesRequestPdf: OpenResponsesRequestPdf): string;
|
|
293
335
|
/** @internal */
|
|
294
|
-
export type
|
|
336
|
+
export type OpenResponsesRequestPluginFileParser$Outbound = {
|
|
295
337
|
id: "file-parser";
|
|
338
|
+
enabled?: boolean | undefined;
|
|
296
339
|
max_files?: number | undefined;
|
|
297
|
-
pdf?:
|
|
340
|
+
pdf?: OpenResponsesRequestPdf$Outbound | undefined;
|
|
298
341
|
};
|
|
299
342
|
/** @internal */
|
|
300
|
-
export declare const
|
|
301
|
-
export declare function
|
|
343
|
+
export declare const OpenResponsesRequestPluginFileParser$outboundSchema: z.ZodType<OpenResponsesRequestPluginFileParser$Outbound, OpenResponsesRequestPluginFileParser>;
|
|
344
|
+
export declare function openResponsesRequestPluginFileParserToJSON(openResponsesRequestPluginFileParser: OpenResponsesRequestPluginFileParser): string;
|
|
302
345
|
/** @internal */
|
|
303
|
-
export declare const
|
|
346
|
+
export declare const OpenResponsesRequestEngine$outboundSchema: z.ZodType<string, OpenResponsesRequestEngine>;
|
|
304
347
|
/** @internal */
|
|
305
|
-
export type
|
|
348
|
+
export type OpenResponsesRequestPluginWeb$Outbound = {
|
|
306
349
|
id: "web";
|
|
350
|
+
enabled?: boolean | undefined;
|
|
307
351
|
max_results?: number | undefined;
|
|
308
352
|
search_prompt?: string | undefined;
|
|
309
353
|
engine?: string | undefined;
|
|
310
354
|
};
|
|
311
355
|
/** @internal */
|
|
312
|
-
export declare const
|
|
313
|
-
export declare function
|
|
356
|
+
export declare const OpenResponsesRequestPluginWeb$outboundSchema: z.ZodType<OpenResponsesRequestPluginWeb$Outbound, OpenResponsesRequestPluginWeb>;
|
|
357
|
+
export declare function openResponsesRequestPluginWebToJSON(openResponsesRequestPluginWeb: OpenResponsesRequestPluginWeb): string;
|
|
314
358
|
/** @internal */
|
|
315
|
-
export type
|
|
359
|
+
export type OpenResponsesRequestPluginModeration$Outbound = {
|
|
316
360
|
id: "moderation";
|
|
317
361
|
};
|
|
318
362
|
/** @internal */
|
|
319
|
-
export declare const
|
|
320
|
-
export declare function
|
|
363
|
+
export declare const OpenResponsesRequestPluginModeration$outboundSchema: z.ZodType<OpenResponsesRequestPluginModeration$Outbound, OpenResponsesRequestPluginModeration>;
|
|
364
|
+
export declare function openResponsesRequestPluginModerationToJSON(openResponsesRequestPluginModeration: OpenResponsesRequestPluginModeration): string;
|
|
365
|
+
/** @internal */
|
|
366
|
+
export type OpenResponsesRequestPluginUnion$Outbound = OpenResponsesRequestPluginModeration$Outbound | OpenResponsesRequestPluginWeb$Outbound | OpenResponsesRequestPluginFileParser$Outbound | OpenResponsesRequestPluginResponseHealing$Outbound;
|
|
321
367
|
/** @internal */
|
|
322
|
-
export
|
|
368
|
+
export declare const OpenResponsesRequestPluginUnion$outboundSchema: z.ZodType<OpenResponsesRequestPluginUnion$Outbound, OpenResponsesRequestPluginUnion>;
|
|
369
|
+
export declare function openResponsesRequestPluginUnionToJSON(openResponsesRequestPluginUnion: OpenResponsesRequestPluginUnion): string;
|
|
323
370
|
/** @internal */
|
|
324
|
-
export declare const
|
|
325
|
-
export declare function pluginToJSON(plugin: Plugin): string;
|
|
371
|
+
export declare const OpenResponsesRequestRoute$outboundSchema: z.ZodType<string, OpenResponsesRequestRoute>;
|
|
326
372
|
/** @internal */
|
|
327
373
|
export type OpenResponsesRequest$Outbound = {
|
|
328
374
|
input?: OpenResponsesInput$Outbound | undefined;
|
|
@@ -351,9 +397,11 @@ export type OpenResponsesRequest$Outbound = {
|
|
|
351
397
|
service_tier: string;
|
|
352
398
|
truncation?: string | null | undefined;
|
|
353
399
|
stream: boolean;
|
|
354
|
-
provider?:
|
|
355
|
-
plugins?: Array<
|
|
400
|
+
provider?: OpenResponsesRequestProvider$Outbound | null | undefined;
|
|
401
|
+
plugins?: Array<OpenResponsesRequestPluginModeration$Outbound | OpenResponsesRequestPluginWeb$Outbound | OpenResponsesRequestPluginFileParser$Outbound | OpenResponsesRequestPluginResponseHealing$Outbound> | undefined;
|
|
402
|
+
route?: string | null | undefined;
|
|
356
403
|
user?: string | undefined;
|
|
404
|
+
session_id?: string | undefined;
|
|
357
405
|
};
|
|
358
406
|
/** @internal */
|
|
359
407
|
export declare const OpenResponsesRequest$outboundSchema: z.ZodType<OpenResponsesRequest$Outbound, OpenResponsesRequest>;
|
|
@@ -25,15 +25,22 @@ export const Truncation = {
|
|
|
25
25
|
Auto: "auto",
|
|
26
26
|
Disabled: "disabled",
|
|
27
27
|
};
|
|
28
|
-
export const
|
|
28
|
+
export const OpenResponsesRequestPdfEngine = {
|
|
29
29
|
MistralOcr: "mistral-ocr",
|
|
30
30
|
PdfText: "pdf-text",
|
|
31
31
|
Native: "native",
|
|
32
32
|
};
|
|
33
|
-
export const
|
|
33
|
+
export const OpenResponsesRequestEngine = {
|
|
34
34
|
Native: "native",
|
|
35
35
|
Exa: "exa",
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria.
|
|
39
|
+
*/
|
|
40
|
+
export const OpenResponsesRequestRoute = {
|
|
41
|
+
Fallback: "fallback",
|
|
42
|
+
Sort: "sort",
|
|
43
|
+
};
|
|
37
44
|
/** @internal */
|
|
38
45
|
export const OpenResponsesRequestToolFunction$outboundSchema = z.object({
|
|
39
46
|
type: z.literal("function"),
|
|
@@ -83,31 +90,34 @@ export function ignoreToJSON(ignore) {
|
|
|
83
90
|
return JSON.stringify(Ignore$outboundSchema.parse(ignore));
|
|
84
91
|
}
|
|
85
92
|
/** @internal */
|
|
86
|
-
export const
|
|
87
|
-
.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
request: z.any().optional(),
|
|
93
|
+
export const OpenResponsesRequestMaxPrice$outboundSchema = z.object({
|
|
94
|
+
prompt: z.string().optional(),
|
|
95
|
+
completion: z.string().optional(),
|
|
96
|
+
image: z.string().optional(),
|
|
97
|
+
audio: z.string().optional(),
|
|
98
|
+
request: z.string().optional(),
|
|
93
99
|
});
|
|
94
|
-
export function
|
|
95
|
-
return JSON.stringify(
|
|
100
|
+
export function openResponsesRequestMaxPriceToJSON(openResponsesRequestMaxPrice) {
|
|
101
|
+
return JSON.stringify(OpenResponsesRequestMaxPrice$outboundSchema.parse(openResponsesRequestMaxPrice));
|
|
96
102
|
}
|
|
97
103
|
/** @internal */
|
|
98
|
-
export const
|
|
99
|
-
.object({
|
|
104
|
+
export const OpenResponsesRequestProvider$outboundSchema = z.object({
|
|
100
105
|
allowFallbacks: z.nullable(z.boolean()).optional(),
|
|
101
106
|
requireParameters: z.nullable(z.boolean()).optional(),
|
|
102
107
|
dataCollection: z.nullable(DataCollection$outboundSchema).optional(),
|
|
103
108
|
zdr: z.nullable(z.boolean()).optional(),
|
|
104
109
|
enforceDistillableText: z.nullable(z.boolean()).optional(),
|
|
105
|
-
order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
106
|
-
|
|
110
|
+
order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
111
|
+
.optional(),
|
|
112
|
+
only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
113
|
+
.optional(),
|
|
107
114
|
ignore: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))).optional(),
|
|
108
115
|
quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(),
|
|
109
116
|
sort: z.nullable(ProviderSort$outboundSchema).optional(),
|
|
110
|
-
maxPrice: z.lazy(() =>
|
|
117
|
+
maxPrice: z.lazy(() => OpenResponsesRequestMaxPrice$outboundSchema)
|
|
118
|
+
.optional(),
|
|
119
|
+
minThroughput: z.nullable(z.number()).optional(),
|
|
120
|
+
maxLatency: z.nullable(z.number()).optional(),
|
|
111
121
|
}).transform((v) => {
|
|
112
122
|
return remap$(v, {
|
|
113
123
|
allowFallbacks: "allow_fallbacks",
|
|
@@ -115,78 +125,82 @@ export const Provider$outboundSchema = z
|
|
|
115
125
|
dataCollection: "data_collection",
|
|
116
126
|
enforceDistillableText: "enforce_distillable_text",
|
|
117
127
|
maxPrice: "max_price",
|
|
128
|
+
minThroughput: "min_throughput",
|
|
129
|
+
maxLatency: "max_latency",
|
|
118
130
|
});
|
|
119
131
|
});
|
|
120
|
-
export function
|
|
121
|
-
return JSON.stringify(
|
|
132
|
+
export function openResponsesRequestProviderToJSON(openResponsesRequestProvider) {
|
|
133
|
+
return JSON.stringify(OpenResponsesRequestProvider$outboundSchema.parse(openResponsesRequestProvider));
|
|
122
134
|
}
|
|
123
135
|
/** @internal */
|
|
124
|
-
export const
|
|
136
|
+
export const OpenResponsesRequestPluginResponseHealing$outboundSchema = z.object({
|
|
125
137
|
id: z.literal("response-healing"),
|
|
138
|
+
enabled: z.boolean().optional(),
|
|
126
139
|
});
|
|
127
|
-
export function
|
|
128
|
-
return JSON.stringify(
|
|
140
|
+
export function openResponsesRequestPluginResponseHealingToJSON(openResponsesRequestPluginResponseHealing) {
|
|
141
|
+
return JSON.stringify(OpenResponsesRequestPluginResponseHealing$outboundSchema.parse(openResponsesRequestPluginResponseHealing));
|
|
129
142
|
}
|
|
130
143
|
/** @internal */
|
|
131
|
-
export const
|
|
132
|
-
.outboundSchema(PdfEngine);
|
|
144
|
+
export const OpenResponsesRequestPdfEngine$outboundSchema = openEnums.outboundSchema(OpenResponsesRequestPdfEngine);
|
|
133
145
|
/** @internal */
|
|
134
|
-
export const
|
|
135
|
-
engine:
|
|
146
|
+
export const OpenResponsesRequestPdf$outboundSchema = z.object({
|
|
147
|
+
engine: OpenResponsesRequestPdfEngine$outboundSchema.optional(),
|
|
136
148
|
});
|
|
137
|
-
export function
|
|
138
|
-
return JSON.stringify(
|
|
149
|
+
export function openResponsesRequestPdfToJSON(openResponsesRequestPdf) {
|
|
150
|
+
return JSON.stringify(OpenResponsesRequestPdf$outboundSchema.parse(openResponsesRequestPdf));
|
|
139
151
|
}
|
|
140
152
|
/** @internal */
|
|
141
|
-
export const
|
|
153
|
+
export const OpenResponsesRequestPluginFileParser$outboundSchema = z.object({
|
|
142
154
|
id: z.literal("file-parser"),
|
|
155
|
+
enabled: z.boolean().optional(),
|
|
143
156
|
maxFiles: z.number().optional(),
|
|
144
|
-
pdf: z.lazy(() =>
|
|
157
|
+
pdf: z.lazy(() => OpenResponsesRequestPdf$outboundSchema).optional(),
|
|
145
158
|
}).transform((v) => {
|
|
146
159
|
return remap$(v, {
|
|
147
160
|
maxFiles: "max_files",
|
|
148
161
|
});
|
|
149
162
|
});
|
|
150
|
-
export function
|
|
151
|
-
return JSON.stringify(
|
|
163
|
+
export function openResponsesRequestPluginFileParserToJSON(openResponsesRequestPluginFileParser) {
|
|
164
|
+
return JSON.stringify(OpenResponsesRequestPluginFileParser$outboundSchema.parse(openResponsesRequestPluginFileParser));
|
|
152
165
|
}
|
|
153
166
|
/** @internal */
|
|
154
|
-
export const
|
|
155
|
-
.outboundSchema(Engine);
|
|
167
|
+
export const OpenResponsesRequestEngine$outboundSchema = openEnums.outboundSchema(OpenResponsesRequestEngine);
|
|
156
168
|
/** @internal */
|
|
157
|
-
export const
|
|
169
|
+
export const OpenResponsesRequestPluginWeb$outboundSchema = z.object({
|
|
158
170
|
id: z.literal("web"),
|
|
171
|
+
enabled: z.boolean().optional(),
|
|
159
172
|
maxResults: z.number().optional(),
|
|
160
173
|
searchPrompt: z.string().optional(),
|
|
161
|
-
engine:
|
|
174
|
+
engine: OpenResponsesRequestEngine$outboundSchema.optional(),
|
|
162
175
|
}).transform((v) => {
|
|
163
176
|
return remap$(v, {
|
|
164
177
|
maxResults: "max_results",
|
|
165
178
|
searchPrompt: "search_prompt",
|
|
166
179
|
});
|
|
167
180
|
});
|
|
168
|
-
export function
|
|
169
|
-
return JSON.stringify(
|
|
181
|
+
export function openResponsesRequestPluginWebToJSON(openResponsesRequestPluginWeb) {
|
|
182
|
+
return JSON.stringify(OpenResponsesRequestPluginWeb$outboundSchema.parse(openResponsesRequestPluginWeb));
|
|
170
183
|
}
|
|
171
184
|
/** @internal */
|
|
172
|
-
export const
|
|
185
|
+
export const OpenResponsesRequestPluginModeration$outboundSchema = z.object({
|
|
173
186
|
id: z.literal("moderation"),
|
|
174
187
|
});
|
|
175
|
-
export function
|
|
176
|
-
return JSON.stringify(
|
|
188
|
+
export function openResponsesRequestPluginModerationToJSON(openResponsesRequestPluginModeration) {
|
|
189
|
+
return JSON.stringify(OpenResponsesRequestPluginModeration$outboundSchema.parse(openResponsesRequestPluginModeration));
|
|
177
190
|
}
|
|
178
191
|
/** @internal */
|
|
179
|
-
export const
|
|
180
|
-
.
|
|
181
|
-
z.lazy(() =>
|
|
182
|
-
z.lazy(() =>
|
|
183
|
-
z.lazy(() =>
|
|
184
|
-
z.lazy(() => PluginResponseHealing$outboundSchema),
|
|
192
|
+
export const OpenResponsesRequestPluginUnion$outboundSchema = z.union([
|
|
193
|
+
z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema),
|
|
194
|
+
z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema),
|
|
195
|
+
z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema),
|
|
196
|
+
z.lazy(() => OpenResponsesRequestPluginResponseHealing$outboundSchema),
|
|
185
197
|
]);
|
|
186
|
-
export function
|
|
187
|
-
return JSON.stringify(
|
|
198
|
+
export function openResponsesRequestPluginUnionToJSON(openResponsesRequestPluginUnion) {
|
|
199
|
+
return JSON.stringify(OpenResponsesRequestPluginUnion$outboundSchema.parse(openResponsesRequestPluginUnion));
|
|
188
200
|
}
|
|
189
201
|
/** @internal */
|
|
202
|
+
export const OpenResponsesRequestRoute$outboundSchema = openEnums.outboundSchema(OpenResponsesRequestRoute);
|
|
203
|
+
/** @internal */
|
|
190
204
|
export const OpenResponsesRequest$outboundSchema = z.object({
|
|
191
205
|
input: OpenResponsesInput$outboundSchema.optional(),
|
|
192
206
|
instructions: z.nullable(z.string()).optional(),
|
|
@@ -219,14 +233,16 @@ export const OpenResponsesRequest$outboundSchema = z.object({
|
|
|
219
233
|
serviceTier: ServiceTier$outboundSchema.default("auto"),
|
|
220
234
|
truncation: z.nullable(Truncation$outboundSchema).optional(),
|
|
221
235
|
stream: z.boolean().default(false),
|
|
222
|
-
provider: z.nullable(z.lazy(() =>
|
|
236
|
+
provider: z.nullable(z.lazy(() => OpenResponsesRequestProvider$outboundSchema)).optional(),
|
|
223
237
|
plugins: z.array(z.union([
|
|
224
|
-
z.lazy(() =>
|
|
225
|
-
z.lazy(() =>
|
|
226
|
-
z.lazy(() =>
|
|
227
|
-
z.lazy(() =>
|
|
238
|
+
z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema),
|
|
239
|
+
z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema),
|
|
240
|
+
z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema),
|
|
241
|
+
z.lazy(() => OpenResponsesRequestPluginResponseHealing$outboundSchema),
|
|
228
242
|
])).optional(),
|
|
243
|
+
route: z.nullable(OpenResponsesRequestRoute$outboundSchema).optional(),
|
|
229
244
|
user: z.string().optional(),
|
|
245
|
+
sessionId: z.string().optional(),
|
|
230
246
|
}).transform((v) => {
|
|
231
247
|
return remap$(v, {
|
|
232
248
|
toolChoice: "tool_choice",
|
|
@@ -238,6 +254,7 @@ export const OpenResponsesRequest$outboundSchema = z.object({
|
|
|
238
254
|
previousResponseId: "previous_response_id",
|
|
239
255
|
safetyIdentifier: "safety_identifier",
|
|
240
256
|
serviceTier: "service_tier",
|
|
257
|
+
sessionId: "session_id",
|
|
241
258
|
});
|
|
242
259
|
});
|
|
243
260
|
export function openResponsesRequestToJSON(openResponsesRequest) {
|
|
@@ -32,25 +32,25 @@ export type Ignore = models.ProviderName | string;
|
|
|
32
32
|
*/
|
|
33
33
|
export type MaxPrice = {
|
|
34
34
|
/**
|
|
35
|
-
* A value in string
|
|
35
|
+
* A value in string format that is a large number
|
|
36
36
|
*/
|
|
37
|
-
prompt?:
|
|
37
|
+
prompt?: string | undefined;
|
|
38
38
|
/**
|
|
39
|
-
* A value in string
|
|
39
|
+
* A value in string format that is a large number
|
|
40
40
|
*/
|
|
41
|
-
completion?:
|
|
41
|
+
completion?: string | undefined;
|
|
42
42
|
/**
|
|
43
|
-
* A value in string
|
|
43
|
+
* A value in string format that is a large number
|
|
44
44
|
*/
|
|
45
|
-
image?:
|
|
45
|
+
image?: string | undefined;
|
|
46
46
|
/**
|
|
47
|
-
* A value in string
|
|
47
|
+
* A value in string format that is a large number
|
|
48
48
|
*/
|
|
49
|
-
audio?:
|
|
49
|
+
audio?: string | undefined;
|
|
50
50
|
/**
|
|
51
|
-
* A value in string
|
|
51
|
+
* A value in string format that is a large number
|
|
52
52
|
*/
|
|
53
|
-
request?:
|
|
53
|
+
request?: string | undefined;
|
|
54
54
|
};
|
|
55
55
|
export type CreateEmbeddingsProvider = {
|
|
56
56
|
/**
|
|
@@ -106,6 +106,14 @@ export type CreateEmbeddingsProvider = {
|
|
|
106
106
|
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
107
107
|
*/
|
|
108
108
|
maxPrice?: MaxPrice | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used.
|
|
111
|
+
*/
|
|
112
|
+
minThroughput?: number | null | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used.
|
|
115
|
+
*/
|
|
116
|
+
maxLatency?: number | null | undefined;
|
|
109
117
|
};
|
|
110
118
|
export type CreateEmbeddingsRequest = {
|
|
111
119
|
input: string | Array<string> | Array<number> | Array<Array<number>> | Array<Input>;
|
|
@@ -138,13 +146,14 @@ export type Usage = {
|
|
|
138
146
|
/**
|
|
139
147
|
* Embedding response
|
|
140
148
|
*/
|
|
141
|
-
export type
|
|
149
|
+
export type CreateEmbeddingsResponseBody = {
|
|
142
150
|
id?: string | undefined;
|
|
143
151
|
object: ObjectT;
|
|
144
152
|
data: Array<CreateEmbeddingsData>;
|
|
145
153
|
model: string;
|
|
146
154
|
usage?: Usage | undefined;
|
|
147
155
|
};
|
|
156
|
+
export type CreateEmbeddingsResponse = CreateEmbeddingsResponseBody | string;
|
|
148
157
|
/** @internal */
|
|
149
158
|
export type ImageUrl$Outbound = {
|
|
150
159
|
url: string;
|
|
@@ -204,11 +213,11 @@ export declare const Ignore$outboundSchema: z.ZodType<Ignore$Outbound, Ignore>;
|
|
|
204
213
|
export declare function ignoreToJSON(ignore: Ignore): string;
|
|
205
214
|
/** @internal */
|
|
206
215
|
export type MaxPrice$Outbound = {
|
|
207
|
-
prompt?:
|
|
208
|
-
completion?:
|
|
209
|
-
image?:
|
|
210
|
-
audio?:
|
|
211
|
-
request?:
|
|
216
|
+
prompt?: string | undefined;
|
|
217
|
+
completion?: string | undefined;
|
|
218
|
+
image?: string | undefined;
|
|
219
|
+
audio?: string | undefined;
|
|
220
|
+
request?: string | undefined;
|
|
212
221
|
};
|
|
213
222
|
/** @internal */
|
|
214
223
|
export declare const MaxPrice$outboundSchema: z.ZodType<MaxPrice$Outbound, MaxPrice>;
|
|
@@ -226,6 +235,8 @@ export type CreateEmbeddingsProvider$Outbound = {
|
|
|
226
235
|
quantizations?: Array<string> | null | undefined;
|
|
227
236
|
sort?: string | null | undefined;
|
|
228
237
|
max_price?: MaxPrice$Outbound | undefined;
|
|
238
|
+
min_throughput?: number | null | undefined;
|
|
239
|
+
max_latency?: number | null | undefined;
|
|
229
240
|
};
|
|
230
241
|
/** @internal */
|
|
231
242
|
export declare const CreateEmbeddingsProvider$outboundSchema: z.ZodType<CreateEmbeddingsProvider$Outbound, CreateEmbeddingsProvider>;
|
|
@@ -257,6 +268,9 @@ export declare function createEmbeddingsDataFromJSON(jsonString: string): SafePa
|
|
|
257
268
|
export declare const Usage$inboundSchema: z.ZodType<Usage, unknown>;
|
|
258
269
|
export declare function usageFromJSON(jsonString: string): SafeParseResult<Usage, SDKValidationError>;
|
|
259
270
|
/** @internal */
|
|
271
|
+
export declare const CreateEmbeddingsResponseBody$inboundSchema: z.ZodType<CreateEmbeddingsResponseBody, unknown>;
|
|
272
|
+
export declare function createEmbeddingsResponseBodyFromJSON(jsonString: string): SafeParseResult<CreateEmbeddingsResponseBody, SDKValidationError>;
|
|
273
|
+
/** @internal */
|
|
260
274
|
export declare const CreateEmbeddingsResponse$inboundSchema: z.ZodType<CreateEmbeddingsResponse, unknown>;
|
|
261
275
|
export declare function createEmbeddingsResponseFromJSON(jsonString: string): SafeParseResult<CreateEmbeddingsResponse, SDKValidationError>;
|
|
262
276
|
//# sourceMappingURL=createembeddings.d.ts.map
|