@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
|
@@ -29,7 +29,7 @@ async function $do(client, request, options) {
|
|
|
29
29
|
const path = pathToFunc("/embeddings")();
|
|
30
30
|
const headers = new Headers(compactMap({
|
|
31
31
|
"Content-Type": "application/json",
|
|
32
|
-
Accept: "application/json",
|
|
32
|
+
Accept: "application/json;q=1, text/event-stream;q=0",
|
|
33
33
|
}));
|
|
34
34
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
35
35
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -86,7 +86,9 @@ async function $do(client, request, options) {
|
|
|
86
86
|
const responseFields = {
|
|
87
87
|
HttpMeta: { Response: response, Request: req },
|
|
88
88
|
};
|
|
89
|
-
const [result] = await M.match(M.json(200, operations.CreateEmbeddingsResponse$inboundSchema), M.
|
|
89
|
+
const [result] = await M.match(M.json(200, operations.CreateEmbeddingsResponse$inboundSchema), M.text(200, operations.CreateEmbeddingsResponse$inboundSchema, {
|
|
90
|
+
ctype: "text/event-stream",
|
|
91
|
+
}), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(524, errors.EdgeNetworkTimeoutResponseError$inboundSchema), M.jsonErr(529, errors.ProviderOverloadedResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
90
92
|
if (!result.ok) {
|
|
91
93
|
return [result, { status: "complete", request: req, response }];
|
|
92
94
|
}
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -45,8 +45,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
45
45
|
export declare const SDK_METADATA: {
|
|
46
46
|
readonly language: "typescript";
|
|
47
47
|
readonly openapiDocVersion: "1.0.0";
|
|
48
|
-
readonly sdkVersion: "0.2.
|
|
48
|
+
readonly sdkVersion: "0.2.11";
|
|
49
49
|
readonly genVersion: "2.768.0";
|
|
50
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.2.
|
|
50
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.2.11 2.768.0 1.0.0 @openrouter/sdk";
|
|
51
51
|
};
|
|
52
52
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -25,8 +25,8 @@ export function serverURLFromOptions(options) {
|
|
|
25
25
|
export const SDK_METADATA = {
|
|
26
26
|
language: "typescript",
|
|
27
27
|
openapiDocVersion: "1.0.0",
|
|
28
|
-
sdkVersion: "0.2.
|
|
28
|
+
sdkVersion: "0.2.11",
|
|
29
29
|
genVersion: "2.768.0",
|
|
30
|
-
userAgent: "speakeasy-sdk/typescript 0.2.
|
|
30
|
+
userAgent: "speakeasy-sdk/typescript 0.2.11 2.768.0 1.0.0 @openrouter/sdk",
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=config.js.map
|
|
@@ -5,13 +5,145 @@ import { Message, Message$Outbound } from "./message.js";
|
|
|
5
5
|
import { ReasoningSummaryVerbosity } from "./reasoningsummaryverbosity.js";
|
|
6
6
|
import { ResponseFormatJSONSchema, ResponseFormatJSONSchema$Outbound } from "./responseformatjsonschema.js";
|
|
7
7
|
import { ResponseFormatTextGrammar, ResponseFormatTextGrammar$Outbound } from "./responseformattextgrammar.js";
|
|
8
|
+
import { Schema0, Schema0$Outbound } from "./schema0.js";
|
|
8
9
|
import { ToolDefinitionJson, ToolDefinitionJson$Outbound } from "./tooldefinitionjson.js";
|
|
10
|
+
export declare const ChatGenerationParamsDataCollection: {
|
|
11
|
+
readonly Deny: "deny";
|
|
12
|
+
readonly Allow: "allow";
|
|
13
|
+
};
|
|
14
|
+
export type ChatGenerationParamsDataCollection = OpenEnum<typeof ChatGenerationParamsDataCollection>;
|
|
15
|
+
export declare const Quantizations: {
|
|
16
|
+
readonly Int4: "int4";
|
|
17
|
+
readonly Int8: "int8";
|
|
18
|
+
readonly Fp4: "fp4";
|
|
19
|
+
readonly Fp6: "fp6";
|
|
20
|
+
readonly Fp8: "fp8";
|
|
21
|
+
readonly Fp16: "fp16";
|
|
22
|
+
readonly Bf16: "bf16";
|
|
23
|
+
readonly Fp32: "fp32";
|
|
24
|
+
readonly Unknown: "unknown";
|
|
25
|
+
};
|
|
26
|
+
export type Quantizations = OpenEnum<typeof Quantizations>;
|
|
27
|
+
export declare const Sort: {
|
|
28
|
+
readonly Price: "price";
|
|
29
|
+
readonly Throughput: "throughput";
|
|
30
|
+
readonly Latency: "latency";
|
|
31
|
+
};
|
|
32
|
+
export type Sort = OpenEnum<typeof Sort>;
|
|
33
|
+
/**
|
|
34
|
+
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
35
|
+
*/
|
|
36
|
+
export type ChatGenerationParamsMaxPrice = {
|
|
37
|
+
prompt?: any | undefined;
|
|
38
|
+
completion?: any | undefined;
|
|
39
|
+
image?: any | undefined;
|
|
40
|
+
audio?: any | undefined;
|
|
41
|
+
request?: any | undefined;
|
|
42
|
+
};
|
|
43
|
+
export type ChatGenerationParamsProvider = {
|
|
44
|
+
/**
|
|
45
|
+
* Whether to allow backup providers to serve requests
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
|
|
49
|
+
* - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
|
|
50
|
+
*/
|
|
51
|
+
allowFallbacks?: boolean | null | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.
|
|
54
|
+
*/
|
|
55
|
+
requireParameters?: boolean | null | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Data collection setting. If no available model provider meets the requirement, your request will return an error.
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* - allow: (default) allow providers which store user data non-transiently and may train on it
|
|
61
|
+
*
|
|
62
|
+
* - deny: use only providers which do not collect user data.
|
|
63
|
+
*/
|
|
64
|
+
dataCollection?: ChatGenerationParamsDataCollection | null | undefined;
|
|
65
|
+
zdr?: boolean | null | undefined;
|
|
66
|
+
enforceDistillableText?: boolean | null | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
|
|
69
|
+
*/
|
|
70
|
+
order?: Array<Schema0> | null | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
|
|
73
|
+
*/
|
|
74
|
+
only?: Array<Schema0> | null | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
|
|
77
|
+
*/
|
|
78
|
+
ignore?: Array<Schema0> | null | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* A list of quantization levels to filter the provider by.
|
|
81
|
+
*/
|
|
82
|
+
quantizations?: Array<Quantizations> | null | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
85
|
+
*/
|
|
86
|
+
sort?: Sort | null | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
89
|
+
*/
|
|
90
|
+
maxPrice?: ChatGenerationParamsMaxPrice | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used.
|
|
93
|
+
*/
|
|
94
|
+
minThroughput?: number | null | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used.
|
|
97
|
+
*/
|
|
98
|
+
maxLatency?: number | null | undefined;
|
|
99
|
+
};
|
|
100
|
+
export type ChatGenerationParamsPluginResponseHealing = {
|
|
101
|
+
id: "response-healing";
|
|
102
|
+
enabled?: boolean | undefined;
|
|
103
|
+
};
|
|
104
|
+
export declare const ChatGenerationParamsPdfEngine: {
|
|
105
|
+
readonly MistralOcr: "mistral-ocr";
|
|
106
|
+
readonly PdfText: "pdf-text";
|
|
107
|
+
readonly Native: "native";
|
|
108
|
+
};
|
|
109
|
+
export type ChatGenerationParamsPdfEngine = OpenEnum<typeof ChatGenerationParamsPdfEngine>;
|
|
110
|
+
export type ChatGenerationParamsPdf = {
|
|
111
|
+
engine?: ChatGenerationParamsPdfEngine | undefined;
|
|
112
|
+
};
|
|
113
|
+
export type ChatGenerationParamsPluginFileParser = {
|
|
114
|
+
id: "file-parser";
|
|
115
|
+
enabled?: boolean | undefined;
|
|
116
|
+
maxFiles?: number | undefined;
|
|
117
|
+
pdf?: ChatGenerationParamsPdf | undefined;
|
|
118
|
+
};
|
|
119
|
+
export declare const ChatGenerationParamsEngine: {
|
|
120
|
+
readonly Native: "native";
|
|
121
|
+
readonly Exa: "exa";
|
|
122
|
+
};
|
|
123
|
+
export type ChatGenerationParamsEngine = OpenEnum<typeof ChatGenerationParamsEngine>;
|
|
124
|
+
export type ChatGenerationParamsPluginWeb = {
|
|
125
|
+
id: "web";
|
|
126
|
+
enabled?: boolean | undefined;
|
|
127
|
+
maxResults?: number | undefined;
|
|
128
|
+
searchPrompt?: string | undefined;
|
|
129
|
+
engine?: ChatGenerationParamsEngine | undefined;
|
|
130
|
+
};
|
|
131
|
+
export type ChatGenerationParamsPluginModeration = {
|
|
132
|
+
id: "moderation";
|
|
133
|
+
};
|
|
134
|
+
export type ChatGenerationParamsPluginUnion = ChatGenerationParamsPluginModeration | ChatGenerationParamsPluginWeb | ChatGenerationParamsPluginFileParser | ChatGenerationParamsPluginResponseHealing;
|
|
135
|
+
export declare const ChatGenerationParamsRoute: {
|
|
136
|
+
readonly Fallback: "fallback";
|
|
137
|
+
readonly Sort: "sort";
|
|
138
|
+
};
|
|
139
|
+
export type ChatGenerationParamsRoute = OpenEnum<typeof ChatGenerationParamsRoute>;
|
|
9
140
|
export declare const Effort: {
|
|
10
141
|
readonly None: "none";
|
|
11
142
|
readonly Minimal: "minimal";
|
|
12
143
|
readonly Low: "low";
|
|
13
144
|
readonly Medium: "medium";
|
|
14
145
|
readonly High: "high";
|
|
146
|
+
readonly Xhigh: "xhigh";
|
|
15
147
|
};
|
|
16
148
|
export type Effort = OpenEnum<typeof Effort>;
|
|
17
149
|
export type Reasoning = {
|
|
@@ -33,6 +165,23 @@ export type Debug = {
|
|
|
33
165
|
echoUpstreamBody?: boolean | undefined;
|
|
34
166
|
};
|
|
35
167
|
export type ChatGenerationParams = {
|
|
168
|
+
/**
|
|
169
|
+
* When multiple model providers are available, optionally indicate your routing preference.
|
|
170
|
+
*/
|
|
171
|
+
provider?: ChatGenerationParamsProvider | null | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* Plugins you want to enable for this request, including their settings.
|
|
174
|
+
*/
|
|
175
|
+
plugins?: Array<ChatGenerationParamsPluginModeration | ChatGenerationParamsPluginWeb | ChatGenerationParamsPluginFileParser | ChatGenerationParamsPluginResponseHealing> | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria.
|
|
178
|
+
*/
|
|
179
|
+
route?: ChatGenerationParamsRoute | null | undefined;
|
|
180
|
+
user?: string | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* 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.
|
|
183
|
+
*/
|
|
184
|
+
sessionId?: string | undefined;
|
|
36
185
|
messages: Array<Message>;
|
|
37
186
|
model?: string | undefined;
|
|
38
187
|
models?: Array<string> | undefined;
|
|
@@ -58,10 +207,99 @@ export type ChatGenerationParams = {
|
|
|
58
207
|
toolChoice?: any | undefined;
|
|
59
208
|
tools?: Array<ToolDefinitionJson> | undefined;
|
|
60
209
|
topP?: number | null | undefined;
|
|
61
|
-
user?: string | undefined;
|
|
62
210
|
debug?: Debug | undefined;
|
|
63
211
|
};
|
|
64
212
|
/** @internal */
|
|
213
|
+
export declare const ChatGenerationParamsDataCollection$outboundSchema: z.ZodType<string, ChatGenerationParamsDataCollection>;
|
|
214
|
+
/** @internal */
|
|
215
|
+
export declare const Quantizations$outboundSchema: z.ZodType<string, Quantizations>;
|
|
216
|
+
/** @internal */
|
|
217
|
+
export declare const Sort$outboundSchema: z.ZodType<string, Sort>;
|
|
218
|
+
/** @internal */
|
|
219
|
+
export type ChatGenerationParamsMaxPrice$Outbound = {
|
|
220
|
+
prompt?: any | undefined;
|
|
221
|
+
completion?: any | undefined;
|
|
222
|
+
image?: any | undefined;
|
|
223
|
+
audio?: any | undefined;
|
|
224
|
+
request?: any | undefined;
|
|
225
|
+
};
|
|
226
|
+
/** @internal */
|
|
227
|
+
export declare const ChatGenerationParamsMaxPrice$outboundSchema: z.ZodType<ChatGenerationParamsMaxPrice$Outbound, ChatGenerationParamsMaxPrice>;
|
|
228
|
+
export declare function chatGenerationParamsMaxPriceToJSON(chatGenerationParamsMaxPrice: ChatGenerationParamsMaxPrice): string;
|
|
229
|
+
/** @internal */
|
|
230
|
+
export type ChatGenerationParamsProvider$Outbound = {
|
|
231
|
+
allow_fallbacks?: boolean | null | undefined;
|
|
232
|
+
require_parameters?: boolean | null | undefined;
|
|
233
|
+
data_collection?: string | null | undefined;
|
|
234
|
+
zdr?: boolean | null | undefined;
|
|
235
|
+
enforce_distillable_text?: boolean | null | undefined;
|
|
236
|
+
order?: Array<Schema0$Outbound> | null | undefined;
|
|
237
|
+
only?: Array<Schema0$Outbound> | null | undefined;
|
|
238
|
+
ignore?: Array<Schema0$Outbound> | null | undefined;
|
|
239
|
+
quantizations?: Array<string> | null | undefined;
|
|
240
|
+
sort?: string | null | undefined;
|
|
241
|
+
max_price?: ChatGenerationParamsMaxPrice$Outbound | undefined;
|
|
242
|
+
min_throughput?: number | null | undefined;
|
|
243
|
+
max_latency?: number | null | undefined;
|
|
244
|
+
};
|
|
245
|
+
/** @internal */
|
|
246
|
+
export declare const ChatGenerationParamsProvider$outboundSchema: z.ZodType<ChatGenerationParamsProvider$Outbound, ChatGenerationParamsProvider>;
|
|
247
|
+
export declare function chatGenerationParamsProviderToJSON(chatGenerationParamsProvider: ChatGenerationParamsProvider): string;
|
|
248
|
+
/** @internal */
|
|
249
|
+
export type ChatGenerationParamsPluginResponseHealing$Outbound = {
|
|
250
|
+
id: "response-healing";
|
|
251
|
+
enabled?: boolean | undefined;
|
|
252
|
+
};
|
|
253
|
+
/** @internal */
|
|
254
|
+
export declare const ChatGenerationParamsPluginResponseHealing$outboundSchema: z.ZodType<ChatGenerationParamsPluginResponseHealing$Outbound, ChatGenerationParamsPluginResponseHealing>;
|
|
255
|
+
export declare function chatGenerationParamsPluginResponseHealingToJSON(chatGenerationParamsPluginResponseHealing: ChatGenerationParamsPluginResponseHealing): string;
|
|
256
|
+
/** @internal */
|
|
257
|
+
export declare const ChatGenerationParamsPdfEngine$outboundSchema: z.ZodType<string, ChatGenerationParamsPdfEngine>;
|
|
258
|
+
/** @internal */
|
|
259
|
+
export type ChatGenerationParamsPdf$Outbound = {
|
|
260
|
+
engine?: string | undefined;
|
|
261
|
+
};
|
|
262
|
+
/** @internal */
|
|
263
|
+
export declare const ChatGenerationParamsPdf$outboundSchema: z.ZodType<ChatGenerationParamsPdf$Outbound, ChatGenerationParamsPdf>;
|
|
264
|
+
export declare function chatGenerationParamsPdfToJSON(chatGenerationParamsPdf: ChatGenerationParamsPdf): string;
|
|
265
|
+
/** @internal */
|
|
266
|
+
export type ChatGenerationParamsPluginFileParser$Outbound = {
|
|
267
|
+
id: "file-parser";
|
|
268
|
+
enabled?: boolean | undefined;
|
|
269
|
+
max_files?: number | undefined;
|
|
270
|
+
pdf?: ChatGenerationParamsPdf$Outbound | undefined;
|
|
271
|
+
};
|
|
272
|
+
/** @internal */
|
|
273
|
+
export declare const ChatGenerationParamsPluginFileParser$outboundSchema: z.ZodType<ChatGenerationParamsPluginFileParser$Outbound, ChatGenerationParamsPluginFileParser>;
|
|
274
|
+
export declare function chatGenerationParamsPluginFileParserToJSON(chatGenerationParamsPluginFileParser: ChatGenerationParamsPluginFileParser): string;
|
|
275
|
+
/** @internal */
|
|
276
|
+
export declare const ChatGenerationParamsEngine$outboundSchema: z.ZodType<string, ChatGenerationParamsEngine>;
|
|
277
|
+
/** @internal */
|
|
278
|
+
export type ChatGenerationParamsPluginWeb$Outbound = {
|
|
279
|
+
id: "web";
|
|
280
|
+
enabled?: boolean | undefined;
|
|
281
|
+
max_results?: number | undefined;
|
|
282
|
+
search_prompt?: string | undefined;
|
|
283
|
+
engine?: string | undefined;
|
|
284
|
+
};
|
|
285
|
+
/** @internal */
|
|
286
|
+
export declare const ChatGenerationParamsPluginWeb$outboundSchema: z.ZodType<ChatGenerationParamsPluginWeb$Outbound, ChatGenerationParamsPluginWeb>;
|
|
287
|
+
export declare function chatGenerationParamsPluginWebToJSON(chatGenerationParamsPluginWeb: ChatGenerationParamsPluginWeb): string;
|
|
288
|
+
/** @internal */
|
|
289
|
+
export type ChatGenerationParamsPluginModeration$Outbound = {
|
|
290
|
+
id: "moderation";
|
|
291
|
+
};
|
|
292
|
+
/** @internal */
|
|
293
|
+
export declare const ChatGenerationParamsPluginModeration$outboundSchema: z.ZodType<ChatGenerationParamsPluginModeration$Outbound, ChatGenerationParamsPluginModeration>;
|
|
294
|
+
export declare function chatGenerationParamsPluginModerationToJSON(chatGenerationParamsPluginModeration: ChatGenerationParamsPluginModeration): string;
|
|
295
|
+
/** @internal */
|
|
296
|
+
export type ChatGenerationParamsPluginUnion$Outbound = ChatGenerationParamsPluginModeration$Outbound | ChatGenerationParamsPluginWeb$Outbound | ChatGenerationParamsPluginFileParser$Outbound | ChatGenerationParamsPluginResponseHealing$Outbound;
|
|
297
|
+
/** @internal */
|
|
298
|
+
export declare const ChatGenerationParamsPluginUnion$outboundSchema: z.ZodType<ChatGenerationParamsPluginUnion$Outbound, ChatGenerationParamsPluginUnion>;
|
|
299
|
+
export declare function chatGenerationParamsPluginUnionToJSON(chatGenerationParamsPluginUnion: ChatGenerationParamsPluginUnion): string;
|
|
300
|
+
/** @internal */
|
|
301
|
+
export declare const ChatGenerationParamsRoute$outboundSchema: z.ZodType<string, ChatGenerationParamsRoute>;
|
|
302
|
+
/** @internal */
|
|
65
303
|
export declare const Effort$outboundSchema: z.ZodType<string, Effort>;
|
|
66
304
|
/** @internal */
|
|
67
305
|
export type Reasoning$Outbound = {
|
|
@@ -111,6 +349,11 @@ export declare const Debug$outboundSchema: z.ZodType<Debug$Outbound, Debug>;
|
|
|
111
349
|
export declare function debugToJSON(debug: Debug): string;
|
|
112
350
|
/** @internal */
|
|
113
351
|
export type ChatGenerationParams$Outbound = {
|
|
352
|
+
provider?: ChatGenerationParamsProvider$Outbound | null | undefined;
|
|
353
|
+
plugins?: Array<ChatGenerationParamsPluginModeration$Outbound | ChatGenerationParamsPluginWeb$Outbound | ChatGenerationParamsPluginFileParser$Outbound | ChatGenerationParamsPluginResponseHealing$Outbound> | undefined;
|
|
354
|
+
route?: string | null | undefined;
|
|
355
|
+
user?: string | undefined;
|
|
356
|
+
session_id?: string | undefined;
|
|
114
357
|
messages: Array<Message$Outbound>;
|
|
115
358
|
model?: string | undefined;
|
|
116
359
|
models?: Array<string> | undefined;
|
|
@@ -136,7 +379,6 @@ export type ChatGenerationParams$Outbound = {
|
|
|
136
379
|
tool_choice?: any | undefined;
|
|
137
380
|
tools?: Array<ToolDefinitionJson$Outbound> | undefined;
|
|
138
381
|
top_p?: number | null | undefined;
|
|
139
|
-
user?: string | undefined;
|
|
140
382
|
debug?: Debug$Outbound | undefined;
|
|
141
383
|
};
|
|
142
384
|
/** @internal */
|
|
@@ -9,15 +9,167 @@ import { Message$outboundSchema, } from "./message.js";
|
|
|
9
9
|
import { ReasoningSummaryVerbosity$outboundSchema, } from "./reasoningsummaryverbosity.js";
|
|
10
10
|
import { ResponseFormatJSONSchema$outboundSchema, } from "./responseformatjsonschema.js";
|
|
11
11
|
import { ResponseFormatTextGrammar$outboundSchema, } from "./responseformattextgrammar.js";
|
|
12
|
+
import { Schema0$outboundSchema, } from "./schema0.js";
|
|
12
13
|
import { ToolDefinitionJson$outboundSchema, } from "./tooldefinitionjson.js";
|
|
14
|
+
export const ChatGenerationParamsDataCollection = {
|
|
15
|
+
Deny: "deny",
|
|
16
|
+
Allow: "allow",
|
|
17
|
+
};
|
|
18
|
+
export const Quantizations = {
|
|
19
|
+
Int4: "int4",
|
|
20
|
+
Int8: "int8",
|
|
21
|
+
Fp4: "fp4",
|
|
22
|
+
Fp6: "fp6",
|
|
23
|
+
Fp8: "fp8",
|
|
24
|
+
Fp16: "fp16",
|
|
25
|
+
Bf16: "bf16",
|
|
26
|
+
Fp32: "fp32",
|
|
27
|
+
Unknown: "unknown",
|
|
28
|
+
};
|
|
29
|
+
export const Sort = {
|
|
30
|
+
Price: "price",
|
|
31
|
+
Throughput: "throughput",
|
|
32
|
+
Latency: "latency",
|
|
33
|
+
};
|
|
34
|
+
export const ChatGenerationParamsPdfEngine = {
|
|
35
|
+
MistralOcr: "mistral-ocr",
|
|
36
|
+
PdfText: "pdf-text",
|
|
37
|
+
Native: "native",
|
|
38
|
+
};
|
|
39
|
+
export const ChatGenerationParamsEngine = {
|
|
40
|
+
Native: "native",
|
|
41
|
+
Exa: "exa",
|
|
42
|
+
};
|
|
43
|
+
export const ChatGenerationParamsRoute = {
|
|
44
|
+
Fallback: "fallback",
|
|
45
|
+
Sort: "sort",
|
|
46
|
+
};
|
|
13
47
|
export const Effort = {
|
|
14
48
|
None: "none",
|
|
15
49
|
Minimal: "minimal",
|
|
16
50
|
Low: "low",
|
|
17
51
|
Medium: "medium",
|
|
18
52
|
High: "high",
|
|
53
|
+
Xhigh: "xhigh",
|
|
19
54
|
};
|
|
20
55
|
/** @internal */
|
|
56
|
+
export const ChatGenerationParamsDataCollection$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsDataCollection);
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const Quantizations$outboundSchema = openEnums.outboundSchema(Quantizations);
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const Sort$outboundSchema = openEnums
|
|
61
|
+
.outboundSchema(Sort);
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const ChatGenerationParamsMaxPrice$outboundSchema = z.object({
|
|
64
|
+
prompt: z.any().optional(),
|
|
65
|
+
completion: z.any().optional(),
|
|
66
|
+
image: z.any().optional(),
|
|
67
|
+
audio: z.any().optional(),
|
|
68
|
+
request: z.any().optional(),
|
|
69
|
+
});
|
|
70
|
+
export function chatGenerationParamsMaxPriceToJSON(chatGenerationParamsMaxPrice) {
|
|
71
|
+
return JSON.stringify(ChatGenerationParamsMaxPrice$outboundSchema.parse(chatGenerationParamsMaxPrice));
|
|
72
|
+
}
|
|
73
|
+
/** @internal */
|
|
74
|
+
export const ChatGenerationParamsProvider$outboundSchema = z.object({
|
|
75
|
+
allowFallbacks: z.nullable(z.boolean()).optional(),
|
|
76
|
+
requireParameters: z.nullable(z.boolean()).optional(),
|
|
77
|
+
dataCollection: z.nullable(ChatGenerationParamsDataCollection$outboundSchema)
|
|
78
|
+
.optional(),
|
|
79
|
+
zdr: z.nullable(z.boolean()).optional(),
|
|
80
|
+
enforceDistillableText: z.nullable(z.boolean()).optional(),
|
|
81
|
+
order: z.nullable(z.array(Schema0$outboundSchema)).optional(),
|
|
82
|
+
only: z.nullable(z.array(Schema0$outboundSchema)).optional(),
|
|
83
|
+
ignore: z.nullable(z.array(Schema0$outboundSchema)).optional(),
|
|
84
|
+
quantizations: z.nullable(z.array(Quantizations$outboundSchema)).optional(),
|
|
85
|
+
sort: z.nullable(Sort$outboundSchema).optional(),
|
|
86
|
+
maxPrice: z.lazy(() => ChatGenerationParamsMaxPrice$outboundSchema)
|
|
87
|
+
.optional(),
|
|
88
|
+
minThroughput: z.nullable(z.number()).optional(),
|
|
89
|
+
maxLatency: z.nullable(z.number()).optional(),
|
|
90
|
+
}).transform((v) => {
|
|
91
|
+
return remap$(v, {
|
|
92
|
+
allowFallbacks: "allow_fallbacks",
|
|
93
|
+
requireParameters: "require_parameters",
|
|
94
|
+
dataCollection: "data_collection",
|
|
95
|
+
enforceDistillableText: "enforce_distillable_text",
|
|
96
|
+
maxPrice: "max_price",
|
|
97
|
+
minThroughput: "min_throughput",
|
|
98
|
+
maxLatency: "max_latency",
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
export function chatGenerationParamsProviderToJSON(chatGenerationParamsProvider) {
|
|
102
|
+
return JSON.stringify(ChatGenerationParamsProvider$outboundSchema.parse(chatGenerationParamsProvider));
|
|
103
|
+
}
|
|
104
|
+
/** @internal */
|
|
105
|
+
export const ChatGenerationParamsPluginResponseHealing$outboundSchema = z.object({
|
|
106
|
+
id: z.literal("response-healing"),
|
|
107
|
+
enabled: z.boolean().optional(),
|
|
108
|
+
});
|
|
109
|
+
export function chatGenerationParamsPluginResponseHealingToJSON(chatGenerationParamsPluginResponseHealing) {
|
|
110
|
+
return JSON.stringify(ChatGenerationParamsPluginResponseHealing$outboundSchema.parse(chatGenerationParamsPluginResponseHealing));
|
|
111
|
+
}
|
|
112
|
+
/** @internal */
|
|
113
|
+
export const ChatGenerationParamsPdfEngine$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsPdfEngine);
|
|
114
|
+
/** @internal */
|
|
115
|
+
export const ChatGenerationParamsPdf$outboundSchema = z.object({
|
|
116
|
+
engine: ChatGenerationParamsPdfEngine$outboundSchema.optional(),
|
|
117
|
+
});
|
|
118
|
+
export function chatGenerationParamsPdfToJSON(chatGenerationParamsPdf) {
|
|
119
|
+
return JSON.stringify(ChatGenerationParamsPdf$outboundSchema.parse(chatGenerationParamsPdf));
|
|
120
|
+
}
|
|
121
|
+
/** @internal */
|
|
122
|
+
export const ChatGenerationParamsPluginFileParser$outboundSchema = z.object({
|
|
123
|
+
id: z.literal("file-parser"),
|
|
124
|
+
enabled: z.boolean().optional(),
|
|
125
|
+
maxFiles: z.number().optional(),
|
|
126
|
+
pdf: z.lazy(() => ChatGenerationParamsPdf$outboundSchema).optional(),
|
|
127
|
+
}).transform((v) => {
|
|
128
|
+
return remap$(v, {
|
|
129
|
+
maxFiles: "max_files",
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
export function chatGenerationParamsPluginFileParserToJSON(chatGenerationParamsPluginFileParser) {
|
|
133
|
+
return JSON.stringify(ChatGenerationParamsPluginFileParser$outboundSchema.parse(chatGenerationParamsPluginFileParser));
|
|
134
|
+
}
|
|
135
|
+
/** @internal */
|
|
136
|
+
export const ChatGenerationParamsEngine$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsEngine);
|
|
137
|
+
/** @internal */
|
|
138
|
+
export const ChatGenerationParamsPluginWeb$outboundSchema = z.object({
|
|
139
|
+
id: z.literal("web"),
|
|
140
|
+
enabled: z.boolean().optional(),
|
|
141
|
+
maxResults: z.number().optional(),
|
|
142
|
+
searchPrompt: z.string().optional(),
|
|
143
|
+
engine: ChatGenerationParamsEngine$outboundSchema.optional(),
|
|
144
|
+
}).transform((v) => {
|
|
145
|
+
return remap$(v, {
|
|
146
|
+
maxResults: "max_results",
|
|
147
|
+
searchPrompt: "search_prompt",
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
export function chatGenerationParamsPluginWebToJSON(chatGenerationParamsPluginWeb) {
|
|
151
|
+
return JSON.stringify(ChatGenerationParamsPluginWeb$outboundSchema.parse(chatGenerationParamsPluginWeb));
|
|
152
|
+
}
|
|
153
|
+
/** @internal */
|
|
154
|
+
export const ChatGenerationParamsPluginModeration$outboundSchema = z.object({
|
|
155
|
+
id: z.literal("moderation"),
|
|
156
|
+
});
|
|
157
|
+
export function chatGenerationParamsPluginModerationToJSON(chatGenerationParamsPluginModeration) {
|
|
158
|
+
return JSON.stringify(ChatGenerationParamsPluginModeration$outboundSchema.parse(chatGenerationParamsPluginModeration));
|
|
159
|
+
}
|
|
160
|
+
/** @internal */
|
|
161
|
+
export const ChatGenerationParamsPluginUnion$outboundSchema = z.union([
|
|
162
|
+
z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema),
|
|
163
|
+
z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema),
|
|
164
|
+
z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema),
|
|
165
|
+
z.lazy(() => ChatGenerationParamsPluginResponseHealing$outboundSchema),
|
|
166
|
+
]);
|
|
167
|
+
export function chatGenerationParamsPluginUnionToJSON(chatGenerationParamsPluginUnion) {
|
|
168
|
+
return JSON.stringify(ChatGenerationParamsPluginUnion$outboundSchema.parse(chatGenerationParamsPluginUnion));
|
|
169
|
+
}
|
|
170
|
+
/** @internal */
|
|
171
|
+
export const ChatGenerationParamsRoute$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsRoute);
|
|
172
|
+
/** @internal */
|
|
21
173
|
export const Effort$outboundSchema = openEnums
|
|
22
174
|
.outboundSchema(Effort);
|
|
23
175
|
/** @internal */
|
|
@@ -78,6 +230,16 @@ export function debugToJSON(debug) {
|
|
|
78
230
|
}
|
|
79
231
|
/** @internal */
|
|
80
232
|
export const ChatGenerationParams$outboundSchema = z.object({
|
|
233
|
+
provider: z.nullable(z.lazy(() => ChatGenerationParamsProvider$outboundSchema)).optional(),
|
|
234
|
+
plugins: z.array(z.union([
|
|
235
|
+
z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema),
|
|
236
|
+
z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema),
|
|
237
|
+
z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema),
|
|
238
|
+
z.lazy(() => ChatGenerationParamsPluginResponseHealing$outboundSchema),
|
|
239
|
+
])).optional(),
|
|
240
|
+
route: z.nullable(ChatGenerationParamsRoute$outboundSchema).optional(),
|
|
241
|
+
user: z.string().optional(),
|
|
242
|
+
sessionId: z.string().optional(),
|
|
81
243
|
messages: z.array(Message$outboundSchema),
|
|
82
244
|
model: z.string().optional(),
|
|
83
245
|
models: z.array(z.string()).optional(),
|
|
@@ -105,10 +267,10 @@ export const ChatGenerationParams$outboundSchema = z.object({
|
|
|
105
267
|
toolChoice: z.any().optional(),
|
|
106
268
|
tools: z.array(ToolDefinitionJson$outboundSchema).optional(),
|
|
107
269
|
topP: z.nullable(z.number()).optional(),
|
|
108
|
-
user: z.string().optional(),
|
|
109
270
|
debug: z.lazy(() => Debug$outboundSchema).optional(),
|
|
110
271
|
}).transform((v) => {
|
|
111
272
|
return remap$(v, {
|
|
273
|
+
sessionId: "session_id",
|
|
112
274
|
frequencyPenalty: "frequency_penalty",
|
|
113
275
|
logitBias: "logit_bias",
|
|
114
276
|
topLogprobs: "top_logprobs",
|
package/esm/models/index.d.ts
CHANGED
|
@@ -128,6 +128,7 @@ export * from "./responsessearchcontextsize.js";
|
|
|
128
128
|
export * from "./responseswebsearchcalloutput.js";
|
|
129
129
|
export * from "./responseswebsearchuserlocation.js";
|
|
130
130
|
export * from "./responsetextconfig.js";
|
|
131
|
+
export * from "./schema0.js";
|
|
131
132
|
export * from "./security.js";
|
|
132
133
|
export * from "./serviceunavailableresponseerrordata.js";
|
|
133
134
|
export * from "./systemmessage.js";
|
package/esm/models/index.js
CHANGED
|
@@ -131,6 +131,7 @@ export * from "./responsessearchcontextsize.js";
|
|
|
131
131
|
export * from "./responseswebsearchcalloutput.js";
|
|
132
132
|
export * from "./responseswebsearchuserlocation.js";
|
|
133
133
|
export * from "./responsetextconfig.js";
|
|
134
|
+
export * from "./schema0.js";
|
|
134
135
|
export * from "./security.js";
|
|
135
136
|
export * from "./serviceunavailableresponseerrordata.js";
|
|
136
137
|
export * from "./systemmessage.js";
|