@openrouter/sdk 0.0.1 → 0.1.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/FUNCTIONS.md +1 -109
- package/REACT_QUERY.md +4 -121
- package/esm/funcs/embeddingsGenerate.d.ts +18 -0
- package/esm/funcs/embeddingsGenerate.js +97 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/chaterror.d.ts +4 -4
- package/esm/models/chaterror.js +4 -4
- package/esm/models/chatgenerationparams.d.ts +4 -2
- package/esm/models/chatgenerationparams.js +4 -2
- package/esm/models/chatmessagecontentitemaudio.d.ts +15 -15
- package/esm/models/chatmessagecontentitemaudio.js +15 -16
- package/esm/models/completioncreateparams.d.ts +4 -2
- package/esm/models/completioncreateparams.js +4 -2
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/openairesponsesinputunion.d.ts +21 -0
- package/esm/models/openairesponsesinputunion.js +31 -0
- package/esm/models/openairesponsesprompt.d.ts +4 -28
- package/esm/models/openairesponsesprompt.js +16 -36
- package/esm/models/openresponseseasyinputmessage.d.ts +13 -0
- package/esm/models/openresponseseasyinputmessage.js +19 -0
- package/esm/models/openresponsesinputmessageitem.d.ts +9 -0
- package/esm/models/openresponsesinputmessageitem.js +13 -0
- package/esm/models/operations/createembeddings.d.ts +582 -0
- package/esm/models/operations/createembeddings.js +608 -0
- package/esm/models/operations/getgeneration.d.ts +5 -0
- package/esm/models/operations/getgeneration.js +4 -0
- package/esm/models/operations/getparameters.d.ts +10 -10
- package/esm/models/operations/getparameters.js +14 -14
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/responseinputaudio.d.ts +103 -0
- package/esm/models/responseinputaudio.js +114 -0
- package/esm/react-query/embeddingsGenerate.d.ts +23 -0
- package/esm/react-query/embeddingsGenerate.js +42 -0
- package/esm/react-query/index.d.ts +1 -0
- package/esm/react-query/index.js +1 -0
- package/esm/react-query/parametersGetParameters.d.ts +3 -3
- package/esm/sdk/embeddings.d.ts +12 -0
- package/esm/sdk/embeddings.js +18 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/.devcontainer/README.md +0 -35
- package/examples/README.md +0 -31
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { catchUnrecognizedEnum, } from "../../types/enums.js";
|
|
8
|
+
import * as models from "../index.js";
|
|
9
|
+
/**
|
|
10
|
+
* Data collection setting. If no available model provider meets the requirement, your request will return an error.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* - allow: (default) allow providers which store user data non-transiently and may train on it
|
|
14
|
+
* - deny: use only providers which do not collect user data.
|
|
15
|
+
*/
|
|
16
|
+
export const DataCollection = {
|
|
17
|
+
Deny: "deny",
|
|
18
|
+
Allow: "allow",
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
22
|
+
*/
|
|
23
|
+
export const Sort = {
|
|
24
|
+
Price: "price",
|
|
25
|
+
Throughput: "throughput",
|
|
26
|
+
Latency: "latency",
|
|
27
|
+
};
|
|
28
|
+
export const EncodingFormatBase64 = {
|
|
29
|
+
Base64: "base64",
|
|
30
|
+
};
|
|
31
|
+
export const EncodingFormatFloat = {
|
|
32
|
+
Float: "float",
|
|
33
|
+
};
|
|
34
|
+
export const ObjectT = {
|
|
35
|
+
List: "list",
|
|
36
|
+
};
|
|
37
|
+
export const ObjectEmbedding = {
|
|
38
|
+
Embedding: "embedding",
|
|
39
|
+
};
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const Input$inboundSchema = z.union([
|
|
42
|
+
z.string(),
|
|
43
|
+
z.array(z.string()),
|
|
44
|
+
z.array(z.number()),
|
|
45
|
+
z.array(z.array(z.number())),
|
|
46
|
+
]);
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const Input$outboundSchema = z.union([
|
|
49
|
+
z.string(),
|
|
50
|
+
z.array(z.string()),
|
|
51
|
+
z.array(z.number()),
|
|
52
|
+
z.array(z.array(z.number())),
|
|
53
|
+
]);
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
57
|
+
*/
|
|
58
|
+
export var Input$;
|
|
59
|
+
(function (Input$) {
|
|
60
|
+
/** @deprecated use `Input$inboundSchema` instead. */
|
|
61
|
+
Input$.inboundSchema = Input$inboundSchema;
|
|
62
|
+
/** @deprecated use `Input$outboundSchema` instead. */
|
|
63
|
+
Input$.outboundSchema = Input$outboundSchema;
|
|
64
|
+
})(Input$ || (Input$ = {}));
|
|
65
|
+
export function inputToJSON(input) {
|
|
66
|
+
return JSON.stringify(Input$outboundSchema.parse(input));
|
|
67
|
+
}
|
|
68
|
+
export function inputFromJSON(jsonString) {
|
|
69
|
+
return safeParse(jsonString, (x) => Input$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Input' from JSON`);
|
|
70
|
+
}
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const DataCollection$inboundSchema = z
|
|
73
|
+
.union([
|
|
74
|
+
z.enum(DataCollection),
|
|
75
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
76
|
+
]);
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const DataCollection$outboundSchema = z.union([
|
|
79
|
+
z.enum(DataCollection),
|
|
80
|
+
z.string().and(z.custom()),
|
|
81
|
+
]);
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
85
|
+
*/
|
|
86
|
+
export var DataCollection$;
|
|
87
|
+
(function (DataCollection$) {
|
|
88
|
+
/** @deprecated use `DataCollection$inboundSchema` instead. */
|
|
89
|
+
DataCollection$.inboundSchema = DataCollection$inboundSchema;
|
|
90
|
+
/** @deprecated use `DataCollection$outboundSchema` instead. */
|
|
91
|
+
DataCollection$.outboundSchema = DataCollection$outboundSchema;
|
|
92
|
+
})(DataCollection$ || (DataCollection$ = {}));
|
|
93
|
+
/** @internal */
|
|
94
|
+
export const Order$inboundSchema = z.union([
|
|
95
|
+
models.ProviderName$inboundSchema,
|
|
96
|
+
z.string(),
|
|
97
|
+
]);
|
|
98
|
+
/** @internal */
|
|
99
|
+
export const Order$outboundSchema = z.union([
|
|
100
|
+
models.ProviderName$outboundSchema,
|
|
101
|
+
z.string(),
|
|
102
|
+
]);
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
106
|
+
*/
|
|
107
|
+
export var Order$;
|
|
108
|
+
(function (Order$) {
|
|
109
|
+
/** @deprecated use `Order$inboundSchema` instead. */
|
|
110
|
+
Order$.inboundSchema = Order$inboundSchema;
|
|
111
|
+
/** @deprecated use `Order$outboundSchema` instead. */
|
|
112
|
+
Order$.outboundSchema = Order$outboundSchema;
|
|
113
|
+
})(Order$ || (Order$ = {}));
|
|
114
|
+
export function orderToJSON(order) {
|
|
115
|
+
return JSON.stringify(Order$outboundSchema.parse(order));
|
|
116
|
+
}
|
|
117
|
+
export function orderFromJSON(jsonString) {
|
|
118
|
+
return safeParse(jsonString, (x) => Order$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Order' from JSON`);
|
|
119
|
+
}
|
|
120
|
+
/** @internal */
|
|
121
|
+
export const Only$inboundSchema = z.union([
|
|
122
|
+
models.ProviderName$inboundSchema,
|
|
123
|
+
z.string(),
|
|
124
|
+
]);
|
|
125
|
+
/** @internal */
|
|
126
|
+
export const Only$outboundSchema = z.union([
|
|
127
|
+
models.ProviderName$outboundSchema,
|
|
128
|
+
z.string(),
|
|
129
|
+
]);
|
|
130
|
+
/**
|
|
131
|
+
* @internal
|
|
132
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
133
|
+
*/
|
|
134
|
+
export var Only$;
|
|
135
|
+
(function (Only$) {
|
|
136
|
+
/** @deprecated use `Only$inboundSchema` instead. */
|
|
137
|
+
Only$.inboundSchema = Only$inboundSchema;
|
|
138
|
+
/** @deprecated use `Only$outboundSchema` instead. */
|
|
139
|
+
Only$.outboundSchema = Only$outboundSchema;
|
|
140
|
+
})(Only$ || (Only$ = {}));
|
|
141
|
+
export function onlyToJSON(only) {
|
|
142
|
+
return JSON.stringify(Only$outboundSchema.parse(only));
|
|
143
|
+
}
|
|
144
|
+
export function onlyFromJSON(jsonString) {
|
|
145
|
+
return safeParse(jsonString, (x) => Only$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Only' from JSON`);
|
|
146
|
+
}
|
|
147
|
+
/** @internal */
|
|
148
|
+
export const Ignore$inboundSchema = z.union([
|
|
149
|
+
models.ProviderName$inboundSchema,
|
|
150
|
+
z.string(),
|
|
151
|
+
]);
|
|
152
|
+
/** @internal */
|
|
153
|
+
export const Ignore$outboundSchema = z
|
|
154
|
+
.union([models.ProviderName$outboundSchema, z.string()]);
|
|
155
|
+
/**
|
|
156
|
+
* @internal
|
|
157
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
158
|
+
*/
|
|
159
|
+
export var Ignore$;
|
|
160
|
+
(function (Ignore$) {
|
|
161
|
+
/** @deprecated use `Ignore$inboundSchema` instead. */
|
|
162
|
+
Ignore$.inboundSchema = Ignore$inboundSchema;
|
|
163
|
+
/** @deprecated use `Ignore$outboundSchema` instead. */
|
|
164
|
+
Ignore$.outboundSchema = Ignore$outboundSchema;
|
|
165
|
+
})(Ignore$ || (Ignore$ = {}));
|
|
166
|
+
export function ignoreToJSON(ignore) {
|
|
167
|
+
return JSON.stringify(Ignore$outboundSchema.parse(ignore));
|
|
168
|
+
}
|
|
169
|
+
export function ignoreFromJSON(jsonString) {
|
|
170
|
+
return safeParse(jsonString, (x) => Ignore$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Ignore' from JSON`);
|
|
171
|
+
}
|
|
172
|
+
/** @internal */
|
|
173
|
+
export const Sort$inboundSchema = z
|
|
174
|
+
.union([
|
|
175
|
+
z.enum(Sort),
|
|
176
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
177
|
+
]);
|
|
178
|
+
/** @internal */
|
|
179
|
+
export const Sort$outboundSchema = z.union([
|
|
180
|
+
z.enum(Sort),
|
|
181
|
+
z.string().and(z.custom()),
|
|
182
|
+
]);
|
|
183
|
+
/**
|
|
184
|
+
* @internal
|
|
185
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
186
|
+
*/
|
|
187
|
+
export var Sort$;
|
|
188
|
+
(function (Sort$) {
|
|
189
|
+
/** @deprecated use `Sort$inboundSchema` instead. */
|
|
190
|
+
Sort$.inboundSchema = Sort$inboundSchema;
|
|
191
|
+
/** @deprecated use `Sort$outboundSchema` instead. */
|
|
192
|
+
Sort$.outboundSchema = Sort$outboundSchema;
|
|
193
|
+
})(Sort$ || (Sort$ = {}));
|
|
194
|
+
/** @internal */
|
|
195
|
+
export const MaxPrice$inboundSchema = z.object({
|
|
196
|
+
prompt: z.any().optional(),
|
|
197
|
+
completion: z.any().optional(),
|
|
198
|
+
image: z.any().optional(),
|
|
199
|
+
audio: z.any().optional(),
|
|
200
|
+
request: z.any().optional(),
|
|
201
|
+
});
|
|
202
|
+
/** @internal */
|
|
203
|
+
export const MaxPrice$outboundSchema = z
|
|
204
|
+
.object({
|
|
205
|
+
prompt: z.any().optional(),
|
|
206
|
+
completion: z.any().optional(),
|
|
207
|
+
image: z.any().optional(),
|
|
208
|
+
audio: z.any().optional(),
|
|
209
|
+
request: z.any().optional(),
|
|
210
|
+
});
|
|
211
|
+
/**
|
|
212
|
+
* @internal
|
|
213
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
214
|
+
*/
|
|
215
|
+
export var MaxPrice$;
|
|
216
|
+
(function (MaxPrice$) {
|
|
217
|
+
/** @deprecated use `MaxPrice$inboundSchema` instead. */
|
|
218
|
+
MaxPrice$.inboundSchema = MaxPrice$inboundSchema;
|
|
219
|
+
/** @deprecated use `MaxPrice$outboundSchema` instead. */
|
|
220
|
+
MaxPrice$.outboundSchema = MaxPrice$outboundSchema;
|
|
221
|
+
})(MaxPrice$ || (MaxPrice$ = {}));
|
|
222
|
+
export function maxPriceToJSON(maxPrice) {
|
|
223
|
+
return JSON.stringify(MaxPrice$outboundSchema.parse(maxPrice));
|
|
224
|
+
}
|
|
225
|
+
export function maxPriceFromJSON(jsonString) {
|
|
226
|
+
return safeParse(jsonString, (x) => MaxPrice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MaxPrice' from JSON`);
|
|
227
|
+
}
|
|
228
|
+
/** @internal */
|
|
229
|
+
export const Experimental$inboundSchema = z
|
|
230
|
+
.object({});
|
|
231
|
+
/** @internal */
|
|
232
|
+
export const Experimental$outboundSchema = z.object({});
|
|
233
|
+
/**
|
|
234
|
+
* @internal
|
|
235
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
236
|
+
*/
|
|
237
|
+
export var Experimental$;
|
|
238
|
+
(function (Experimental$) {
|
|
239
|
+
/** @deprecated use `Experimental$inboundSchema` instead. */
|
|
240
|
+
Experimental$.inboundSchema = Experimental$inboundSchema;
|
|
241
|
+
/** @deprecated use `Experimental$outboundSchema` instead. */
|
|
242
|
+
Experimental$.outboundSchema = Experimental$outboundSchema;
|
|
243
|
+
})(Experimental$ || (Experimental$ = {}));
|
|
244
|
+
export function experimentalToJSON(experimental) {
|
|
245
|
+
return JSON.stringify(Experimental$outboundSchema.parse(experimental));
|
|
246
|
+
}
|
|
247
|
+
export function experimentalFromJSON(jsonString) {
|
|
248
|
+
return safeParse(jsonString, (x) => Experimental$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Experimental' from JSON`);
|
|
249
|
+
}
|
|
250
|
+
/** @internal */
|
|
251
|
+
export const CreateEmbeddingsProvider$inboundSchema = z.object({
|
|
252
|
+
allow_fallbacks: z.nullable(z.boolean()).optional(),
|
|
253
|
+
require_parameters: z.nullable(z.boolean()).optional(),
|
|
254
|
+
data_collection: z.nullable(DataCollection$inboundSchema).optional(),
|
|
255
|
+
zdr: z.nullable(z.boolean()).optional(),
|
|
256
|
+
order: z.nullable(z.array(z.union([models.ProviderName$inboundSchema, z.string()]))).optional(),
|
|
257
|
+
only: z.nullable(z.array(z.union([models.ProviderName$inboundSchema, z.string()]))).optional(),
|
|
258
|
+
ignore: z.nullable(z.array(z.union([models.ProviderName$inboundSchema, z.string()]))).optional(),
|
|
259
|
+
quantizations: z.nullable(z.array(models.Quantization$inboundSchema))
|
|
260
|
+
.optional(),
|
|
261
|
+
sort: z.nullable(Sort$inboundSchema).optional(),
|
|
262
|
+
max_price: z.lazy(() => MaxPrice$inboundSchema).optional(),
|
|
263
|
+
experimental: z.nullable(z.lazy(() => Experimental$inboundSchema)).optional(),
|
|
264
|
+
}).transform((v) => {
|
|
265
|
+
return remap$(v, {
|
|
266
|
+
"allow_fallbacks": "allowFallbacks",
|
|
267
|
+
"require_parameters": "requireParameters",
|
|
268
|
+
"data_collection": "dataCollection",
|
|
269
|
+
"max_price": "maxPrice",
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
/** @internal */
|
|
273
|
+
export const CreateEmbeddingsProvider$outboundSchema = z.object({
|
|
274
|
+
allowFallbacks: z.nullable(z.boolean()).optional(),
|
|
275
|
+
requireParameters: z.nullable(z.boolean()).optional(),
|
|
276
|
+
dataCollection: z.nullable(DataCollection$outboundSchema).optional(),
|
|
277
|
+
zdr: z.nullable(z.boolean()).optional(),
|
|
278
|
+
order: z.nullable(z.array(z.union([models.ProviderName$outboundSchema, z.string()]))).optional(),
|
|
279
|
+
only: z.nullable(z.array(z.union([models.ProviderName$outboundSchema, z.string()]))).optional(),
|
|
280
|
+
ignore: z.nullable(z.array(z.union([models.ProviderName$outboundSchema, z.string()]))).optional(),
|
|
281
|
+
quantizations: z.nullable(z.array(models.Quantization$outboundSchema))
|
|
282
|
+
.optional(),
|
|
283
|
+
sort: z.nullable(Sort$outboundSchema).optional(),
|
|
284
|
+
maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(),
|
|
285
|
+
experimental: z.nullable(z.lazy(() => Experimental$outboundSchema))
|
|
286
|
+
.optional(),
|
|
287
|
+
}).transform((v) => {
|
|
288
|
+
return remap$(v, {
|
|
289
|
+
allowFallbacks: "allow_fallbacks",
|
|
290
|
+
requireParameters: "require_parameters",
|
|
291
|
+
dataCollection: "data_collection",
|
|
292
|
+
maxPrice: "max_price",
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
/**
|
|
296
|
+
* @internal
|
|
297
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
298
|
+
*/
|
|
299
|
+
export var CreateEmbeddingsProvider$;
|
|
300
|
+
(function (CreateEmbeddingsProvider$) {
|
|
301
|
+
/** @deprecated use `CreateEmbeddingsProvider$inboundSchema` instead. */
|
|
302
|
+
CreateEmbeddingsProvider$.inboundSchema = CreateEmbeddingsProvider$inboundSchema;
|
|
303
|
+
/** @deprecated use `CreateEmbeddingsProvider$outboundSchema` instead. */
|
|
304
|
+
CreateEmbeddingsProvider$.outboundSchema = CreateEmbeddingsProvider$outboundSchema;
|
|
305
|
+
})(CreateEmbeddingsProvider$ || (CreateEmbeddingsProvider$ = {}));
|
|
306
|
+
export function createEmbeddingsProviderToJSON(createEmbeddingsProvider) {
|
|
307
|
+
return JSON.stringify(CreateEmbeddingsProvider$outboundSchema.parse(createEmbeddingsProvider));
|
|
308
|
+
}
|
|
309
|
+
export function createEmbeddingsProviderFromJSON(jsonString) {
|
|
310
|
+
return safeParse(jsonString, (x) => CreateEmbeddingsProvider$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingsProvider' from JSON`);
|
|
311
|
+
}
|
|
312
|
+
/** @internal */
|
|
313
|
+
export const EncodingFormatBase64$inboundSchema = z.enum(EncodingFormatBase64);
|
|
314
|
+
/** @internal */
|
|
315
|
+
export const EncodingFormatBase64$outboundSchema = EncodingFormatBase64$inboundSchema;
|
|
316
|
+
/**
|
|
317
|
+
* @internal
|
|
318
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
319
|
+
*/
|
|
320
|
+
export var EncodingFormatBase64$;
|
|
321
|
+
(function (EncodingFormatBase64$) {
|
|
322
|
+
/** @deprecated use `EncodingFormatBase64$inboundSchema` instead. */
|
|
323
|
+
EncodingFormatBase64$.inboundSchema = EncodingFormatBase64$inboundSchema;
|
|
324
|
+
/** @deprecated use `EncodingFormatBase64$outboundSchema` instead. */
|
|
325
|
+
EncodingFormatBase64$.outboundSchema = EncodingFormatBase64$outboundSchema;
|
|
326
|
+
})(EncodingFormatBase64$ || (EncodingFormatBase64$ = {}));
|
|
327
|
+
/** @internal */
|
|
328
|
+
export const EncodingFormatFloat$inboundSchema = z.enum(EncodingFormatFloat);
|
|
329
|
+
/** @internal */
|
|
330
|
+
export const EncodingFormatFloat$outboundSchema = EncodingFormatFloat$inboundSchema;
|
|
331
|
+
/**
|
|
332
|
+
* @internal
|
|
333
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
334
|
+
*/
|
|
335
|
+
export var EncodingFormatFloat$;
|
|
336
|
+
(function (EncodingFormatFloat$) {
|
|
337
|
+
/** @deprecated use `EncodingFormatFloat$inboundSchema` instead. */
|
|
338
|
+
EncodingFormatFloat$.inboundSchema = EncodingFormatFloat$inboundSchema;
|
|
339
|
+
/** @deprecated use `EncodingFormatFloat$outboundSchema` instead. */
|
|
340
|
+
EncodingFormatFloat$.outboundSchema = EncodingFormatFloat$outboundSchema;
|
|
341
|
+
})(EncodingFormatFloat$ || (EncodingFormatFloat$ = {}));
|
|
342
|
+
/** @internal */
|
|
343
|
+
export const EncodingFormat$inboundSchema = z.union([
|
|
344
|
+
EncodingFormatFloat$inboundSchema,
|
|
345
|
+
EncodingFormatBase64$inboundSchema,
|
|
346
|
+
]);
|
|
347
|
+
/** @internal */
|
|
348
|
+
export const EncodingFormat$outboundSchema = z.union([
|
|
349
|
+
EncodingFormatFloat$outboundSchema,
|
|
350
|
+
EncodingFormatBase64$outboundSchema,
|
|
351
|
+
]);
|
|
352
|
+
/**
|
|
353
|
+
* @internal
|
|
354
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
355
|
+
*/
|
|
356
|
+
export var EncodingFormat$;
|
|
357
|
+
(function (EncodingFormat$) {
|
|
358
|
+
/** @deprecated use `EncodingFormat$inboundSchema` instead. */
|
|
359
|
+
EncodingFormat$.inboundSchema = EncodingFormat$inboundSchema;
|
|
360
|
+
/** @deprecated use `EncodingFormat$outboundSchema` instead. */
|
|
361
|
+
EncodingFormat$.outboundSchema = EncodingFormat$outboundSchema;
|
|
362
|
+
})(EncodingFormat$ || (EncodingFormat$ = {}));
|
|
363
|
+
export function encodingFormatToJSON(encodingFormat) {
|
|
364
|
+
return JSON.stringify(EncodingFormat$outboundSchema.parse(encodingFormat));
|
|
365
|
+
}
|
|
366
|
+
export function encodingFormatFromJSON(jsonString) {
|
|
367
|
+
return safeParse(jsonString, (x) => EncodingFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EncodingFormat' from JSON`);
|
|
368
|
+
}
|
|
369
|
+
/** @internal */
|
|
370
|
+
export const CreateEmbeddingsRequest$inboundSchema = z.object({
|
|
371
|
+
input: z.union([
|
|
372
|
+
z.string(),
|
|
373
|
+
z.array(z.string()),
|
|
374
|
+
z.array(z.number()),
|
|
375
|
+
z.array(z.array(z.number())),
|
|
376
|
+
]),
|
|
377
|
+
model: z.string(),
|
|
378
|
+
provider: z.lazy(() => CreateEmbeddingsProvider$inboundSchema).optional(),
|
|
379
|
+
encoding_format: z.union([
|
|
380
|
+
EncodingFormatFloat$inboundSchema,
|
|
381
|
+
EncodingFormatBase64$inboundSchema,
|
|
382
|
+
]).optional(),
|
|
383
|
+
user: z.string().optional(),
|
|
384
|
+
}).transform((v) => {
|
|
385
|
+
return remap$(v, {
|
|
386
|
+
"encoding_format": "encodingFormat",
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
/** @internal */
|
|
390
|
+
export const CreateEmbeddingsRequest$outboundSchema = z.object({
|
|
391
|
+
input: z.union([
|
|
392
|
+
z.string(),
|
|
393
|
+
z.array(z.string()),
|
|
394
|
+
z.array(z.number()),
|
|
395
|
+
z.array(z.array(z.number())),
|
|
396
|
+
]),
|
|
397
|
+
model: z.string(),
|
|
398
|
+
provider: z.lazy(() => CreateEmbeddingsProvider$outboundSchema).optional(),
|
|
399
|
+
encodingFormat: z.union([
|
|
400
|
+
EncodingFormatFloat$outboundSchema,
|
|
401
|
+
EncodingFormatBase64$outboundSchema,
|
|
402
|
+
]).optional(),
|
|
403
|
+
user: z.string().optional(),
|
|
404
|
+
}).transform((v) => {
|
|
405
|
+
return remap$(v, {
|
|
406
|
+
encodingFormat: "encoding_format",
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
/**
|
|
410
|
+
* @internal
|
|
411
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
412
|
+
*/
|
|
413
|
+
export var CreateEmbeddingsRequest$;
|
|
414
|
+
(function (CreateEmbeddingsRequest$) {
|
|
415
|
+
/** @deprecated use `CreateEmbeddingsRequest$inboundSchema` instead. */
|
|
416
|
+
CreateEmbeddingsRequest$.inboundSchema = CreateEmbeddingsRequest$inboundSchema;
|
|
417
|
+
/** @deprecated use `CreateEmbeddingsRequest$outboundSchema` instead. */
|
|
418
|
+
CreateEmbeddingsRequest$.outboundSchema = CreateEmbeddingsRequest$outboundSchema;
|
|
419
|
+
})(CreateEmbeddingsRequest$ || (CreateEmbeddingsRequest$ = {}));
|
|
420
|
+
export function createEmbeddingsRequestToJSON(createEmbeddingsRequest) {
|
|
421
|
+
return JSON.stringify(CreateEmbeddingsRequest$outboundSchema.parse(createEmbeddingsRequest));
|
|
422
|
+
}
|
|
423
|
+
export function createEmbeddingsRequestFromJSON(jsonString) {
|
|
424
|
+
return safeParse(jsonString, (x) => CreateEmbeddingsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingsRequest' from JSON`);
|
|
425
|
+
}
|
|
426
|
+
/** @internal */
|
|
427
|
+
export const ObjectT$inboundSchema = z.enum(ObjectT);
|
|
428
|
+
/** @internal */
|
|
429
|
+
export const ObjectT$outboundSchema = ObjectT$inboundSchema;
|
|
430
|
+
/**
|
|
431
|
+
* @internal
|
|
432
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
433
|
+
*/
|
|
434
|
+
export var ObjectT$;
|
|
435
|
+
(function (ObjectT$) {
|
|
436
|
+
/** @deprecated use `ObjectT$inboundSchema` instead. */
|
|
437
|
+
ObjectT$.inboundSchema = ObjectT$inboundSchema;
|
|
438
|
+
/** @deprecated use `ObjectT$outboundSchema` instead. */
|
|
439
|
+
ObjectT$.outboundSchema = ObjectT$outboundSchema;
|
|
440
|
+
})(ObjectT$ || (ObjectT$ = {}));
|
|
441
|
+
/** @internal */
|
|
442
|
+
export const ObjectEmbedding$inboundSchema = z.enum(ObjectEmbedding);
|
|
443
|
+
/** @internal */
|
|
444
|
+
export const ObjectEmbedding$outboundSchema = ObjectEmbedding$inboundSchema;
|
|
445
|
+
/**
|
|
446
|
+
* @internal
|
|
447
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
448
|
+
*/
|
|
449
|
+
export var ObjectEmbedding$;
|
|
450
|
+
(function (ObjectEmbedding$) {
|
|
451
|
+
/** @deprecated use `ObjectEmbedding$inboundSchema` instead. */
|
|
452
|
+
ObjectEmbedding$.inboundSchema = ObjectEmbedding$inboundSchema;
|
|
453
|
+
/** @deprecated use `ObjectEmbedding$outboundSchema` instead. */
|
|
454
|
+
ObjectEmbedding$.outboundSchema = ObjectEmbedding$outboundSchema;
|
|
455
|
+
})(ObjectEmbedding$ || (ObjectEmbedding$ = {}));
|
|
456
|
+
/** @internal */
|
|
457
|
+
export const Embedding$inboundSchema = z.union([
|
|
458
|
+
z.array(z.number()),
|
|
459
|
+
z.string(),
|
|
460
|
+
]);
|
|
461
|
+
/** @internal */
|
|
462
|
+
export const Embedding$outboundSchema = z.union([z.array(z.number()), z.string()]);
|
|
463
|
+
/**
|
|
464
|
+
* @internal
|
|
465
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
466
|
+
*/
|
|
467
|
+
export var Embedding$;
|
|
468
|
+
(function (Embedding$) {
|
|
469
|
+
/** @deprecated use `Embedding$inboundSchema` instead. */
|
|
470
|
+
Embedding$.inboundSchema = Embedding$inboundSchema;
|
|
471
|
+
/** @deprecated use `Embedding$outboundSchema` instead. */
|
|
472
|
+
Embedding$.outboundSchema = Embedding$outboundSchema;
|
|
473
|
+
})(Embedding$ || (Embedding$ = {}));
|
|
474
|
+
export function embeddingToJSON(embedding) {
|
|
475
|
+
return JSON.stringify(Embedding$outboundSchema.parse(embedding));
|
|
476
|
+
}
|
|
477
|
+
export function embeddingFromJSON(jsonString) {
|
|
478
|
+
return safeParse(jsonString, (x) => Embedding$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Embedding' from JSON`);
|
|
479
|
+
}
|
|
480
|
+
/** @internal */
|
|
481
|
+
export const CreateEmbeddingsData$inboundSchema = z.object({
|
|
482
|
+
object: ObjectEmbedding$inboundSchema,
|
|
483
|
+
embedding: z.union([z.array(z.number()), z.string()]),
|
|
484
|
+
index: z.number().optional(),
|
|
485
|
+
});
|
|
486
|
+
/** @internal */
|
|
487
|
+
export const CreateEmbeddingsData$outboundSchema = z.object({
|
|
488
|
+
object: ObjectEmbedding$outboundSchema,
|
|
489
|
+
embedding: z.union([z.array(z.number()), z.string()]),
|
|
490
|
+
index: z.number().optional(),
|
|
491
|
+
});
|
|
492
|
+
/**
|
|
493
|
+
* @internal
|
|
494
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
495
|
+
*/
|
|
496
|
+
export var CreateEmbeddingsData$;
|
|
497
|
+
(function (CreateEmbeddingsData$) {
|
|
498
|
+
/** @deprecated use `CreateEmbeddingsData$inboundSchema` instead. */
|
|
499
|
+
CreateEmbeddingsData$.inboundSchema = CreateEmbeddingsData$inboundSchema;
|
|
500
|
+
/** @deprecated use `CreateEmbeddingsData$outboundSchema` instead. */
|
|
501
|
+
CreateEmbeddingsData$.outboundSchema = CreateEmbeddingsData$outboundSchema;
|
|
502
|
+
})(CreateEmbeddingsData$ || (CreateEmbeddingsData$ = {}));
|
|
503
|
+
export function createEmbeddingsDataToJSON(createEmbeddingsData) {
|
|
504
|
+
return JSON.stringify(CreateEmbeddingsData$outboundSchema.parse(createEmbeddingsData));
|
|
505
|
+
}
|
|
506
|
+
export function createEmbeddingsDataFromJSON(jsonString) {
|
|
507
|
+
return safeParse(jsonString, (x) => CreateEmbeddingsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingsData' from JSON`);
|
|
508
|
+
}
|
|
509
|
+
/** @internal */
|
|
510
|
+
export const Usage$inboundSchema = z.object({
|
|
511
|
+
prompt_tokens: z.number(),
|
|
512
|
+
total_tokens: z.number(),
|
|
513
|
+
cost: z.number().optional(),
|
|
514
|
+
}).transform((v) => {
|
|
515
|
+
return remap$(v, {
|
|
516
|
+
"prompt_tokens": "promptTokens",
|
|
517
|
+
"total_tokens": "totalTokens",
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
/** @internal */
|
|
521
|
+
export const Usage$outboundSchema = z.object({
|
|
522
|
+
promptTokens: z.number(),
|
|
523
|
+
totalTokens: z.number(),
|
|
524
|
+
cost: z.number().optional(),
|
|
525
|
+
}).transform((v) => {
|
|
526
|
+
return remap$(v, {
|
|
527
|
+
promptTokens: "prompt_tokens",
|
|
528
|
+
totalTokens: "total_tokens",
|
|
529
|
+
});
|
|
530
|
+
});
|
|
531
|
+
/**
|
|
532
|
+
* @internal
|
|
533
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
534
|
+
*/
|
|
535
|
+
export var Usage$;
|
|
536
|
+
(function (Usage$) {
|
|
537
|
+
/** @deprecated use `Usage$inboundSchema` instead. */
|
|
538
|
+
Usage$.inboundSchema = Usage$inboundSchema;
|
|
539
|
+
/** @deprecated use `Usage$outboundSchema` instead. */
|
|
540
|
+
Usage$.outboundSchema = Usage$outboundSchema;
|
|
541
|
+
})(Usage$ || (Usage$ = {}));
|
|
542
|
+
export function usageToJSON(usage) {
|
|
543
|
+
return JSON.stringify(Usage$outboundSchema.parse(usage));
|
|
544
|
+
}
|
|
545
|
+
export function usageFromJSON(jsonString) {
|
|
546
|
+
return safeParse(jsonString, (x) => Usage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Usage' from JSON`);
|
|
547
|
+
}
|
|
548
|
+
/** @internal */
|
|
549
|
+
export const CreateEmbeddingsResponseBody$inboundSchema = z.object({
|
|
550
|
+
id: z.string().optional(),
|
|
551
|
+
object: ObjectT$inboundSchema,
|
|
552
|
+
data: z.array(z.lazy(() => CreateEmbeddingsData$inboundSchema)),
|
|
553
|
+
model: z.string(),
|
|
554
|
+
usage: z.lazy(() => Usage$inboundSchema).optional(),
|
|
555
|
+
});
|
|
556
|
+
/** @internal */
|
|
557
|
+
export const CreateEmbeddingsResponseBody$outboundSchema = z.object({
|
|
558
|
+
id: z.string().optional(),
|
|
559
|
+
object: ObjectT$outboundSchema,
|
|
560
|
+
data: z.array(z.lazy(() => CreateEmbeddingsData$outboundSchema)),
|
|
561
|
+
model: z.string(),
|
|
562
|
+
usage: z.lazy(() => Usage$outboundSchema).optional(),
|
|
563
|
+
});
|
|
564
|
+
/**
|
|
565
|
+
* @internal
|
|
566
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
567
|
+
*/
|
|
568
|
+
export var CreateEmbeddingsResponseBody$;
|
|
569
|
+
(function (CreateEmbeddingsResponseBody$) {
|
|
570
|
+
/** @deprecated use `CreateEmbeddingsResponseBody$inboundSchema` instead. */
|
|
571
|
+
CreateEmbeddingsResponseBody$.inboundSchema = CreateEmbeddingsResponseBody$inboundSchema;
|
|
572
|
+
/** @deprecated use `CreateEmbeddingsResponseBody$outboundSchema` instead. */
|
|
573
|
+
CreateEmbeddingsResponseBody$.outboundSchema = CreateEmbeddingsResponseBody$outboundSchema;
|
|
574
|
+
})(CreateEmbeddingsResponseBody$ || (CreateEmbeddingsResponseBody$ = {}));
|
|
575
|
+
export function createEmbeddingsResponseBodyToJSON(createEmbeddingsResponseBody) {
|
|
576
|
+
return JSON.stringify(CreateEmbeddingsResponseBody$outboundSchema.parse(createEmbeddingsResponseBody));
|
|
577
|
+
}
|
|
578
|
+
export function createEmbeddingsResponseBodyFromJSON(jsonString) {
|
|
579
|
+
return safeParse(jsonString, (x) => CreateEmbeddingsResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingsResponseBody' from JSON`);
|
|
580
|
+
}
|
|
581
|
+
/** @internal */
|
|
582
|
+
export const CreateEmbeddingsResponse$inboundSchema = z.union([
|
|
583
|
+
z.lazy(() => CreateEmbeddingsResponseBody$inboundSchema),
|
|
584
|
+
z.string(),
|
|
585
|
+
]);
|
|
586
|
+
/** @internal */
|
|
587
|
+
export const CreateEmbeddingsResponse$outboundSchema = z.union([
|
|
588
|
+
z.lazy(() => CreateEmbeddingsResponseBody$outboundSchema),
|
|
589
|
+
z.string(),
|
|
590
|
+
]);
|
|
591
|
+
/**
|
|
592
|
+
* @internal
|
|
593
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
594
|
+
*/
|
|
595
|
+
export var CreateEmbeddingsResponse$;
|
|
596
|
+
(function (CreateEmbeddingsResponse$) {
|
|
597
|
+
/** @deprecated use `CreateEmbeddingsResponse$inboundSchema` instead. */
|
|
598
|
+
CreateEmbeddingsResponse$.inboundSchema = CreateEmbeddingsResponse$inboundSchema;
|
|
599
|
+
/** @deprecated use `CreateEmbeddingsResponse$outboundSchema` instead. */
|
|
600
|
+
CreateEmbeddingsResponse$.outboundSchema = CreateEmbeddingsResponse$outboundSchema;
|
|
601
|
+
})(CreateEmbeddingsResponse$ || (CreateEmbeddingsResponse$ = {}));
|
|
602
|
+
export function createEmbeddingsResponseToJSON(createEmbeddingsResponse) {
|
|
603
|
+
return JSON.stringify(CreateEmbeddingsResponse$outboundSchema.parse(createEmbeddingsResponse));
|
|
604
|
+
}
|
|
605
|
+
export function createEmbeddingsResponseFromJSON(jsonString) {
|
|
606
|
+
return safeParse(jsonString, (x) => CreateEmbeddingsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingsResponse' from JSON`);
|
|
607
|
+
}
|
|
608
|
+
//# sourceMappingURL=createembeddings.js.map
|
|
@@ -116,6 +116,10 @@ export type GetGenerationData = {
|
|
|
116
116
|
* Number of audio inputs in the prompt
|
|
117
117
|
*/
|
|
118
118
|
numInputAudioPrompt: number | null;
|
|
119
|
+
/**
|
|
120
|
+
* Number of video inputs in the prompt
|
|
121
|
+
*/
|
|
122
|
+
numVideoPrompt: number | null;
|
|
119
123
|
/**
|
|
120
124
|
* Number of media items in the completion
|
|
121
125
|
*/
|
|
@@ -222,6 +226,7 @@ export type GetGenerationData$Outbound = {
|
|
|
222
226
|
native_tokens_cached: number | null;
|
|
223
227
|
num_media_prompt: number | null;
|
|
224
228
|
num_input_audio_prompt: number | null;
|
|
229
|
+
num_video_prompt: number | null;
|
|
225
230
|
num_media_completion: number | null;
|
|
226
231
|
num_search_results: number | null;
|
|
227
232
|
origin: string;
|
|
@@ -85,6 +85,7 @@ export const GetGenerationData$inboundSchema = z.object({
|
|
|
85
85
|
native_tokens_cached: z.nullable(z.number()),
|
|
86
86
|
num_media_prompt: z.nullable(z.number()),
|
|
87
87
|
num_input_audio_prompt: z.nullable(z.number()),
|
|
88
|
+
num_video_prompt: z.nullable(z.number()),
|
|
88
89
|
num_media_completion: z.nullable(z.number()),
|
|
89
90
|
num_search_results: z.nullable(z.number()),
|
|
90
91
|
origin: z.string(),
|
|
@@ -114,6 +115,7 @@ export const GetGenerationData$inboundSchema = z.object({
|
|
|
114
115
|
"native_tokens_cached": "nativeTokensCached",
|
|
115
116
|
"num_media_prompt": "numMediaPrompt",
|
|
116
117
|
"num_input_audio_prompt": "numInputAudioPrompt",
|
|
118
|
+
"num_video_prompt": "numVideoPrompt",
|
|
117
119
|
"num_media_completion": "numMediaCompletion",
|
|
118
120
|
"num_search_results": "numSearchResults",
|
|
119
121
|
"is_byok": "isByok",
|
|
@@ -148,6 +150,7 @@ export const GetGenerationData$outboundSchema = z.object({
|
|
|
148
150
|
nativeTokensCached: z.nullable(z.number()),
|
|
149
151
|
numMediaPrompt: z.nullable(z.number()),
|
|
150
152
|
numInputAudioPrompt: z.nullable(z.number()),
|
|
153
|
+
numVideoPrompt: z.nullable(z.number()),
|
|
151
154
|
numMediaCompletion: z.nullable(z.number()),
|
|
152
155
|
numSearchResults: z.nullable(z.number()),
|
|
153
156
|
origin: z.string(),
|
|
@@ -177,6 +180,7 @@ export const GetGenerationData$outboundSchema = z.object({
|
|
|
177
180
|
nativeTokensCached: "native_tokens_cached",
|
|
178
181
|
numMediaPrompt: "num_media_prompt",
|
|
179
182
|
numInputAudioPrompt: "num_input_audio_prompt",
|
|
183
|
+
numVideoPrompt: "num_video_prompt",
|
|
180
184
|
numMediaCompletion: "num_media_completion",
|
|
181
185
|
numSearchResults: "num_search_results",
|
|
182
186
|
isByok: "is_byok",
|