@openrouter/sdk 0.2.11 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/chatgenerationparams.d.ts +30 -44
- package/esm/models/chatgenerationparams.js +27 -32
- package/esm/models/chatresponsechoice.d.ts +2 -0
- package/esm/models/chatresponsechoice.js +3 -0
- package/esm/models/chatstreamingmessagechunk.d.ts +2 -0
- package/esm/models/chatstreamingmessagechunk.js +3 -0
- package/esm/models/index.d.ts +7 -0
- package/esm/models/index.js +7 -0
- package/esm/models/openresponsesrequest.d.ts +51 -64
- package/esm/models/openresponsesrequest.js +32 -54
- package/esm/models/operations/createembeddings.d.ts +5 -138
- package/esm/models/operations/createembeddings.js +1 -65
- package/esm/models/operations/getparameters.d.ts +3 -75
- package/esm/models/operations/getparameters.js +3 -74
- package/esm/models/parameter.d.ts +1 -0
- package/esm/models/parameter.js +1 -0
- package/esm/models/pdfparserengine.d.ts +17 -0
- package/esm/models/pdfparserengine.js +15 -0
- package/esm/models/pdfparseroptions.d.ts +19 -0
- package/esm/models/pdfparseroptions.js +13 -0
- package/esm/models/providerpreferences.d.ts +215 -0
- package/esm/models/providerpreferences.js +135 -0
- package/esm/models/providersort.d.ts +0 -6
- package/esm/models/providersort.js +0 -3
- package/esm/models/providersortconfig.d.ts +23 -0
- package/esm/models/providersortconfig.js +22 -0
- package/esm/models/providersortunion.d.ts +10 -0
- package/esm/models/providersortunion.js +12 -0
- package/esm/models/schema3.d.ts +50 -0
- package/esm/models/schema3.js +60 -0
- package/esm/models/websearchengine.d.ts +16 -0
- package/esm/models/websearchengine.js +14 -0
- package/esm/types/discriminatedUnion.d.ts +25 -0
- package/esm/types/discriminatedUnion.js +57 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
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.
|
|
48
|
+
readonly sdkVersion: "0.3.1";
|
|
49
49
|
readonly genVersion: "2.768.0";
|
|
50
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.
|
|
50
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.3.1 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.
|
|
28
|
+
sdkVersion: "0.3.1",
|
|
29
29
|
genVersion: "2.768.0",
|
|
30
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
30
|
+
userAgent: "speakeasy-sdk/typescript 0.3.1 2.768.0 1.0.0 @openrouter/sdk",
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=config.js.map
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { ChatStreamOptions, ChatStreamOptions$Outbound } from "./chatstreamoptions.js";
|
|
4
4
|
import { Message, Message$Outbound } from "./message.js";
|
|
5
|
+
import { ProviderSortUnion, ProviderSortUnion$Outbound } from "./providersortunion.js";
|
|
5
6
|
import { ReasoningSummaryVerbosity } from "./reasoningsummaryverbosity.js";
|
|
6
7
|
import { ResponseFormatJSONSchema, ResponseFormatJSONSchema$Outbound } from "./responseformatjsonschema.js";
|
|
7
8
|
import { ResponseFormatTextGrammar, ResponseFormatTextGrammar$Outbound } from "./responseformattextgrammar.js";
|
|
@@ -24,12 +25,6 @@ export declare const Quantizations: {
|
|
|
24
25
|
readonly Unknown: "unknown";
|
|
25
26
|
};
|
|
26
27
|
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
28
|
/**
|
|
34
29
|
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
35
30
|
*/
|
|
@@ -83,67 +78,62 @@ export type ChatGenerationParamsProvider = {
|
|
|
83
78
|
/**
|
|
84
79
|
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
85
80
|
*/
|
|
86
|
-
sort?:
|
|
81
|
+
sort?: ProviderSortUnion | null | undefined;
|
|
87
82
|
/**
|
|
88
83
|
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
89
84
|
*/
|
|
90
85
|
maxPrice?: ChatGenerationParamsMaxPrice | undefined;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
*/
|
|
86
|
+
preferredMinThroughput?: number | null | undefined;
|
|
87
|
+
preferredMaxLatency?: number | null | undefined;
|
|
94
88
|
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
89
|
maxLatency?: number | null | undefined;
|
|
99
90
|
};
|
|
100
91
|
export type ChatGenerationParamsPluginResponseHealing = {
|
|
101
92
|
id: "response-healing";
|
|
102
93
|
enabled?: boolean | undefined;
|
|
103
94
|
};
|
|
104
|
-
export declare const
|
|
95
|
+
export declare const PdfEngine: {
|
|
105
96
|
readonly MistralOcr: "mistral-ocr";
|
|
106
97
|
readonly PdfText: "pdf-text";
|
|
107
98
|
readonly Native: "native";
|
|
108
99
|
};
|
|
109
|
-
export type
|
|
110
|
-
export type
|
|
111
|
-
engine?:
|
|
100
|
+
export type PdfEngine = OpenEnum<typeof PdfEngine>;
|
|
101
|
+
export type Pdf = {
|
|
102
|
+
engine?: PdfEngine | undefined;
|
|
112
103
|
};
|
|
113
104
|
export type ChatGenerationParamsPluginFileParser = {
|
|
114
105
|
id: "file-parser";
|
|
115
106
|
enabled?: boolean | undefined;
|
|
116
|
-
|
|
117
|
-
pdf?: ChatGenerationParamsPdf | undefined;
|
|
107
|
+
pdf?: Pdf | undefined;
|
|
118
108
|
};
|
|
119
|
-
export declare const
|
|
109
|
+
export declare const Engine: {
|
|
120
110
|
readonly Native: "native";
|
|
121
111
|
readonly Exa: "exa";
|
|
122
112
|
};
|
|
123
|
-
export type
|
|
113
|
+
export type Engine = OpenEnum<typeof Engine>;
|
|
124
114
|
export type ChatGenerationParamsPluginWeb = {
|
|
125
115
|
id: "web";
|
|
126
116
|
enabled?: boolean | undefined;
|
|
127
117
|
maxResults?: number | undefined;
|
|
128
118
|
searchPrompt?: string | undefined;
|
|
129
|
-
engine?:
|
|
119
|
+
engine?: Engine | undefined;
|
|
130
120
|
};
|
|
131
121
|
export type ChatGenerationParamsPluginModeration = {
|
|
132
122
|
id: "moderation";
|
|
133
123
|
};
|
|
134
124
|
export type ChatGenerationParamsPluginUnion = ChatGenerationParamsPluginModeration | ChatGenerationParamsPluginWeb | ChatGenerationParamsPluginFileParser | ChatGenerationParamsPluginResponseHealing;
|
|
135
|
-
export declare const
|
|
125
|
+
export declare const Route: {
|
|
136
126
|
readonly Fallback: "fallback";
|
|
137
127
|
readonly Sort: "sort";
|
|
138
128
|
};
|
|
139
|
-
export type
|
|
129
|
+
export type Route = OpenEnum<typeof Route>;
|
|
140
130
|
export declare const Effort: {
|
|
141
|
-
readonly None: "none";
|
|
142
|
-
readonly Minimal: "minimal";
|
|
143
|
-
readonly Low: "low";
|
|
144
|
-
readonly Medium: "medium";
|
|
145
|
-
readonly High: "high";
|
|
146
131
|
readonly Xhigh: "xhigh";
|
|
132
|
+
readonly High: "high";
|
|
133
|
+
readonly Medium: "medium";
|
|
134
|
+
readonly Low: "low";
|
|
135
|
+
readonly Minimal: "minimal";
|
|
136
|
+
readonly None: "none";
|
|
147
137
|
};
|
|
148
138
|
export type Effort = OpenEnum<typeof Effort>;
|
|
149
139
|
export type Reasoning = {
|
|
@@ -173,10 +163,7 @@ export type ChatGenerationParams = {
|
|
|
173
163
|
* Plugins you want to enable for this request, including their settings.
|
|
174
164
|
*/
|
|
175
165
|
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;
|
|
166
|
+
route?: Route | null | undefined;
|
|
180
167
|
user?: string | undefined;
|
|
181
168
|
/**
|
|
182
169
|
* 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.
|
|
@@ -214,8 +201,6 @@ export declare const ChatGenerationParamsDataCollection$outboundSchema: z.ZodTyp
|
|
|
214
201
|
/** @internal */
|
|
215
202
|
export declare const Quantizations$outboundSchema: z.ZodType<string, Quantizations>;
|
|
216
203
|
/** @internal */
|
|
217
|
-
export declare const Sort$outboundSchema: z.ZodType<string, Sort>;
|
|
218
|
-
/** @internal */
|
|
219
204
|
export type ChatGenerationParamsMaxPrice$Outbound = {
|
|
220
205
|
prompt?: any | undefined;
|
|
221
206
|
completion?: any | undefined;
|
|
@@ -237,8 +222,10 @@ export type ChatGenerationParamsProvider$Outbound = {
|
|
|
237
222
|
only?: Array<Schema0$Outbound> | null | undefined;
|
|
238
223
|
ignore?: Array<Schema0$Outbound> | null | undefined;
|
|
239
224
|
quantizations?: Array<string> | null | undefined;
|
|
240
|
-
sort?:
|
|
225
|
+
sort?: ProviderSortUnion$Outbound | null | undefined;
|
|
241
226
|
max_price?: ChatGenerationParamsMaxPrice$Outbound | undefined;
|
|
227
|
+
preferred_min_throughput?: number | null | undefined;
|
|
228
|
+
preferred_max_latency?: number | null | undefined;
|
|
242
229
|
min_throughput?: number | null | undefined;
|
|
243
230
|
max_latency?: number | null | undefined;
|
|
244
231
|
};
|
|
@@ -254,26 +241,25 @@ export type ChatGenerationParamsPluginResponseHealing$Outbound = {
|
|
|
254
241
|
export declare const ChatGenerationParamsPluginResponseHealing$outboundSchema: z.ZodType<ChatGenerationParamsPluginResponseHealing$Outbound, ChatGenerationParamsPluginResponseHealing>;
|
|
255
242
|
export declare function chatGenerationParamsPluginResponseHealingToJSON(chatGenerationParamsPluginResponseHealing: ChatGenerationParamsPluginResponseHealing): string;
|
|
256
243
|
/** @internal */
|
|
257
|
-
export declare const
|
|
244
|
+
export declare const PdfEngine$outboundSchema: z.ZodType<string, PdfEngine>;
|
|
258
245
|
/** @internal */
|
|
259
|
-
export type
|
|
246
|
+
export type Pdf$Outbound = {
|
|
260
247
|
engine?: string | undefined;
|
|
261
248
|
};
|
|
262
249
|
/** @internal */
|
|
263
|
-
export declare const
|
|
264
|
-
export declare function
|
|
250
|
+
export declare const Pdf$outboundSchema: z.ZodType<Pdf$Outbound, Pdf>;
|
|
251
|
+
export declare function pdfToJSON(pdf: Pdf): string;
|
|
265
252
|
/** @internal */
|
|
266
253
|
export type ChatGenerationParamsPluginFileParser$Outbound = {
|
|
267
254
|
id: "file-parser";
|
|
268
255
|
enabled?: boolean | undefined;
|
|
269
|
-
|
|
270
|
-
pdf?: ChatGenerationParamsPdf$Outbound | undefined;
|
|
256
|
+
pdf?: Pdf$Outbound | undefined;
|
|
271
257
|
};
|
|
272
258
|
/** @internal */
|
|
273
259
|
export declare const ChatGenerationParamsPluginFileParser$outboundSchema: z.ZodType<ChatGenerationParamsPluginFileParser$Outbound, ChatGenerationParamsPluginFileParser>;
|
|
274
260
|
export declare function chatGenerationParamsPluginFileParserToJSON(chatGenerationParamsPluginFileParser: ChatGenerationParamsPluginFileParser): string;
|
|
275
261
|
/** @internal */
|
|
276
|
-
export declare const
|
|
262
|
+
export declare const Engine$outboundSchema: z.ZodType<string, Engine>;
|
|
277
263
|
/** @internal */
|
|
278
264
|
export type ChatGenerationParamsPluginWeb$Outbound = {
|
|
279
265
|
id: "web";
|
|
@@ -298,7 +284,7 @@ export type ChatGenerationParamsPluginUnion$Outbound = ChatGenerationParamsPlugi
|
|
|
298
284
|
export declare const ChatGenerationParamsPluginUnion$outboundSchema: z.ZodType<ChatGenerationParamsPluginUnion$Outbound, ChatGenerationParamsPluginUnion>;
|
|
299
285
|
export declare function chatGenerationParamsPluginUnionToJSON(chatGenerationParamsPluginUnion: ChatGenerationParamsPluginUnion): string;
|
|
300
286
|
/** @internal */
|
|
301
|
-
export declare const
|
|
287
|
+
export declare const Route$outboundSchema: z.ZodType<string, Route>;
|
|
302
288
|
/** @internal */
|
|
303
289
|
export declare const Effort$outboundSchema: z.ZodType<string, Effort>;
|
|
304
290
|
/** @internal */
|
|
@@ -6,6 +6,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
6
6
|
import * as openEnums from "../types/enums.js";
|
|
7
7
|
import { ChatStreamOptions$outboundSchema, } from "./chatstreamoptions.js";
|
|
8
8
|
import { Message$outboundSchema, } from "./message.js";
|
|
9
|
+
import { ProviderSortUnion$outboundSchema, } from "./providersortunion.js";
|
|
9
10
|
import { ReasoningSummaryVerbosity$outboundSchema, } from "./reasoningsummaryverbosity.js";
|
|
10
11
|
import { ResponseFormatJSONSchema$outboundSchema, } from "./responseformatjsonschema.js";
|
|
11
12
|
import { ResponseFormatTextGrammar$outboundSchema, } from "./responseformattextgrammar.js";
|
|
@@ -26,40 +27,32 @@ export const Quantizations = {
|
|
|
26
27
|
Fp32: "fp32",
|
|
27
28
|
Unknown: "unknown",
|
|
28
29
|
};
|
|
29
|
-
export const
|
|
30
|
-
Price: "price",
|
|
31
|
-
Throughput: "throughput",
|
|
32
|
-
Latency: "latency",
|
|
33
|
-
};
|
|
34
|
-
export const ChatGenerationParamsPdfEngine = {
|
|
30
|
+
export const PdfEngine = {
|
|
35
31
|
MistralOcr: "mistral-ocr",
|
|
36
32
|
PdfText: "pdf-text",
|
|
37
33
|
Native: "native",
|
|
38
34
|
};
|
|
39
|
-
export const
|
|
35
|
+
export const Engine = {
|
|
40
36
|
Native: "native",
|
|
41
37
|
Exa: "exa",
|
|
42
38
|
};
|
|
43
|
-
export const
|
|
39
|
+
export const Route = {
|
|
44
40
|
Fallback: "fallback",
|
|
45
41
|
Sort: "sort",
|
|
46
42
|
};
|
|
47
43
|
export const Effort = {
|
|
48
|
-
None: "none",
|
|
49
|
-
Minimal: "minimal",
|
|
50
|
-
Low: "low",
|
|
51
|
-
Medium: "medium",
|
|
52
|
-
High: "high",
|
|
53
44
|
Xhigh: "xhigh",
|
|
45
|
+
High: "high",
|
|
46
|
+
Medium: "medium",
|
|
47
|
+
Low: "low",
|
|
48
|
+
Minimal: "minimal",
|
|
49
|
+
None: "none",
|
|
54
50
|
};
|
|
55
51
|
/** @internal */
|
|
56
52
|
export const ChatGenerationParamsDataCollection$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsDataCollection);
|
|
57
53
|
/** @internal */
|
|
58
54
|
export const Quantizations$outboundSchema = openEnums.outboundSchema(Quantizations);
|
|
59
55
|
/** @internal */
|
|
60
|
-
export const Sort$outboundSchema = openEnums
|
|
61
|
-
.outboundSchema(Sort);
|
|
62
|
-
/** @internal */
|
|
63
56
|
export const ChatGenerationParamsMaxPrice$outboundSchema = z.object({
|
|
64
57
|
prompt: z.any().optional(),
|
|
65
58
|
completion: z.any().optional(),
|
|
@@ -82,9 +75,11 @@ export const ChatGenerationParamsProvider$outboundSchema = z.object({
|
|
|
82
75
|
only: z.nullable(z.array(Schema0$outboundSchema)).optional(),
|
|
83
76
|
ignore: z.nullable(z.array(Schema0$outboundSchema)).optional(),
|
|
84
77
|
quantizations: z.nullable(z.array(Quantizations$outboundSchema)).optional(),
|
|
85
|
-
sort: z.nullable(
|
|
78
|
+
sort: z.nullable(ProviderSortUnion$outboundSchema).optional(),
|
|
86
79
|
maxPrice: z.lazy(() => ChatGenerationParamsMaxPrice$outboundSchema)
|
|
87
80
|
.optional(),
|
|
81
|
+
preferredMinThroughput: z.nullable(z.number()).optional(),
|
|
82
|
+
preferredMaxLatency: z.nullable(z.number()).optional(),
|
|
88
83
|
minThroughput: z.nullable(z.number()).optional(),
|
|
89
84
|
maxLatency: z.nullable(z.number()).optional(),
|
|
90
85
|
}).transform((v) => {
|
|
@@ -94,6 +89,8 @@ export const ChatGenerationParamsProvider$outboundSchema = z.object({
|
|
|
94
89
|
dataCollection: "data_collection",
|
|
95
90
|
enforceDistillableText: "enforce_distillable_text",
|
|
96
91
|
maxPrice: "max_price",
|
|
92
|
+
preferredMinThroughput: "preferred_min_throughput",
|
|
93
|
+
preferredMaxLatency: "preferred_max_latency",
|
|
97
94
|
minThroughput: "min_throughput",
|
|
98
95
|
maxLatency: "max_latency",
|
|
99
96
|
});
|
|
@@ -110,37 +107,34 @@ export function chatGenerationParamsPluginResponseHealingToJSON(chatGenerationPa
|
|
|
110
107
|
return JSON.stringify(ChatGenerationParamsPluginResponseHealing$outboundSchema.parse(chatGenerationParamsPluginResponseHealing));
|
|
111
108
|
}
|
|
112
109
|
/** @internal */
|
|
113
|
-
export const
|
|
110
|
+
export const PdfEngine$outboundSchema = openEnums
|
|
111
|
+
.outboundSchema(PdfEngine);
|
|
114
112
|
/** @internal */
|
|
115
|
-
export const
|
|
116
|
-
engine:
|
|
113
|
+
export const Pdf$outboundSchema = z.object({
|
|
114
|
+
engine: PdfEngine$outboundSchema.optional(),
|
|
117
115
|
});
|
|
118
|
-
export function
|
|
119
|
-
return JSON.stringify(
|
|
116
|
+
export function pdfToJSON(pdf) {
|
|
117
|
+
return JSON.stringify(Pdf$outboundSchema.parse(pdf));
|
|
120
118
|
}
|
|
121
119
|
/** @internal */
|
|
122
120
|
export const ChatGenerationParamsPluginFileParser$outboundSchema = z.object({
|
|
123
121
|
id: z.literal("file-parser"),
|
|
124
122
|
enabled: z.boolean().optional(),
|
|
125
|
-
|
|
126
|
-
pdf: z.lazy(() => ChatGenerationParamsPdf$outboundSchema).optional(),
|
|
127
|
-
}).transform((v) => {
|
|
128
|
-
return remap$(v, {
|
|
129
|
-
maxFiles: "max_files",
|
|
130
|
-
});
|
|
123
|
+
pdf: z.lazy(() => Pdf$outboundSchema).optional(),
|
|
131
124
|
});
|
|
132
125
|
export function chatGenerationParamsPluginFileParserToJSON(chatGenerationParamsPluginFileParser) {
|
|
133
126
|
return JSON.stringify(ChatGenerationParamsPluginFileParser$outboundSchema.parse(chatGenerationParamsPluginFileParser));
|
|
134
127
|
}
|
|
135
128
|
/** @internal */
|
|
136
|
-
export const
|
|
129
|
+
export const Engine$outboundSchema = openEnums
|
|
130
|
+
.outboundSchema(Engine);
|
|
137
131
|
/** @internal */
|
|
138
132
|
export const ChatGenerationParamsPluginWeb$outboundSchema = z.object({
|
|
139
133
|
id: z.literal("web"),
|
|
140
134
|
enabled: z.boolean().optional(),
|
|
141
135
|
maxResults: z.number().optional(),
|
|
142
136
|
searchPrompt: z.string().optional(),
|
|
143
|
-
engine:
|
|
137
|
+
engine: Engine$outboundSchema.optional(),
|
|
144
138
|
}).transform((v) => {
|
|
145
139
|
return remap$(v, {
|
|
146
140
|
maxResults: "max_results",
|
|
@@ -168,7 +162,8 @@ export function chatGenerationParamsPluginUnionToJSON(chatGenerationParamsPlugin
|
|
|
168
162
|
return JSON.stringify(ChatGenerationParamsPluginUnion$outboundSchema.parse(chatGenerationParamsPluginUnion));
|
|
169
163
|
}
|
|
170
164
|
/** @internal */
|
|
171
|
-
export const
|
|
165
|
+
export const Route$outboundSchema = openEnums
|
|
166
|
+
.outboundSchema(Route);
|
|
172
167
|
/** @internal */
|
|
173
168
|
export const Effort$outboundSchema = openEnums
|
|
174
169
|
.outboundSchema(Effort);
|
|
@@ -237,7 +232,7 @@ export const ChatGenerationParams$outboundSchema = z.object({
|
|
|
237
232
|
z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema),
|
|
238
233
|
z.lazy(() => ChatGenerationParamsPluginResponseHealing$outboundSchema),
|
|
239
234
|
])).optional(),
|
|
240
|
-
route: z.nullable(
|
|
235
|
+
route: z.nullable(Route$outboundSchema).optional(),
|
|
241
236
|
user: z.string().optional(),
|
|
242
237
|
sessionId: z.string().optional(),
|
|
243
238
|
messages: z.array(Message$outboundSchema),
|
|
@@ -4,10 +4,12 @@ import { AssistantMessage } from "./assistantmessage.js";
|
|
|
4
4
|
import { ChatCompletionFinishReason } from "./chatcompletionfinishreason.js";
|
|
5
5
|
import { ChatMessageTokenLogprobs } from "./chatmessagetokenlogprobs.js";
|
|
6
6
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
7
|
+
import { Schema3 } from "./schema3.js";
|
|
7
8
|
export type ChatResponseChoice = {
|
|
8
9
|
finishReason: ChatCompletionFinishReason | null;
|
|
9
10
|
index: number;
|
|
10
11
|
message: AssistantMessage;
|
|
12
|
+
reasoningDetails?: Array<Schema3> | undefined;
|
|
11
13
|
logprobs?: ChatMessageTokenLogprobs | null | undefined;
|
|
12
14
|
};
|
|
13
15
|
/** @internal */
|
|
@@ -7,15 +7,18 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
7
7
|
import { AssistantMessage$inboundSchema, } from "./assistantmessage.js";
|
|
8
8
|
import { ChatCompletionFinishReason$inboundSchema, } from "./chatcompletionfinishreason.js";
|
|
9
9
|
import { ChatMessageTokenLogprobs$inboundSchema, } from "./chatmessagetokenlogprobs.js";
|
|
10
|
+
import { Schema3$inboundSchema } from "./schema3.js";
|
|
10
11
|
/** @internal */
|
|
11
12
|
export const ChatResponseChoice$inboundSchema = z.object({
|
|
12
13
|
finish_reason: z.nullable(ChatCompletionFinishReason$inboundSchema),
|
|
13
14
|
index: z.number(),
|
|
14
15
|
message: AssistantMessage$inboundSchema,
|
|
16
|
+
reasoning_details: z.array(Schema3$inboundSchema).optional(),
|
|
15
17
|
logprobs: z.nullable(ChatMessageTokenLogprobs$inboundSchema).optional(),
|
|
16
18
|
}).transform((v) => {
|
|
17
19
|
return remap$(v, {
|
|
18
20
|
"finish_reason": "finishReason",
|
|
21
|
+
"reasoning_details": "reasoningDetails",
|
|
19
22
|
});
|
|
20
23
|
});
|
|
21
24
|
export function chatResponseChoiceFromJSON(jsonString) {
|
|
@@ -3,6 +3,7 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { ChatStreamingMessageToolCall } from "./chatstreamingmessagetoolcall.js";
|
|
5
5
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
6
|
+
import { Schema3 } from "./schema3.js";
|
|
6
7
|
export declare const ChatStreamingMessageChunkRole: {
|
|
7
8
|
readonly Assistant: "assistant";
|
|
8
9
|
};
|
|
@@ -13,6 +14,7 @@ export type ChatStreamingMessageChunk = {
|
|
|
13
14
|
reasoning?: string | null | undefined;
|
|
14
15
|
refusal?: string | null | undefined;
|
|
15
16
|
toolCalls?: Array<ChatStreamingMessageToolCall> | undefined;
|
|
17
|
+
reasoningDetails?: Array<Schema3> | undefined;
|
|
16
18
|
};
|
|
17
19
|
/** @internal */
|
|
18
20
|
export declare const ChatStreamingMessageChunkRole$inboundSchema: z.ZodEnum<typeof ChatStreamingMessageChunkRole>;
|
|
@@ -5,6 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { ChatStreamingMessageToolCall$inboundSchema, } from "./chatstreamingmessagetoolcall.js";
|
|
8
|
+
import { Schema3$inboundSchema } from "./schema3.js";
|
|
8
9
|
export const ChatStreamingMessageChunkRole = {
|
|
9
10
|
Assistant: "assistant",
|
|
10
11
|
};
|
|
@@ -17,9 +18,11 @@ export const ChatStreamingMessageChunk$inboundSchema = z.object({
|
|
|
17
18
|
reasoning: z.nullable(z.string()).optional(),
|
|
18
19
|
refusal: z.nullable(z.string()).optional(),
|
|
19
20
|
tool_calls: z.array(ChatStreamingMessageToolCall$inboundSchema).optional(),
|
|
21
|
+
reasoning_details: z.array(Schema3$inboundSchema).optional(),
|
|
20
22
|
}).transform((v) => {
|
|
21
23
|
return remap$(v, {
|
|
22
24
|
"tool_calls": "toolCalls",
|
|
25
|
+
"reasoning_details": "reasoningDetails",
|
|
23
26
|
});
|
|
24
27
|
});
|
|
25
28
|
export function chatStreamingMessageChunkFromJSON(jsonString) {
|
package/esm/models/index.d.ts
CHANGED
|
@@ -95,10 +95,15 @@ export * from "./outputmodality.js";
|
|
|
95
95
|
export * from "./parameter.js";
|
|
96
96
|
export * from "./payloadtoolargeresponseerrordata.js";
|
|
97
97
|
export * from "./paymentrequiredresponseerrordata.js";
|
|
98
|
+
export * from "./pdfparserengine.js";
|
|
99
|
+
export * from "./pdfparseroptions.js";
|
|
98
100
|
export * from "./perrequestlimits.js";
|
|
99
101
|
export * from "./providername.js";
|
|
100
102
|
export * from "./provideroverloadedresponseerrordata.js";
|
|
103
|
+
export * from "./providerpreferences.js";
|
|
101
104
|
export * from "./providersort.js";
|
|
105
|
+
export * from "./providersortconfig.js";
|
|
106
|
+
export * from "./providersortunion.js";
|
|
102
107
|
export * from "./publicendpoint.js";
|
|
103
108
|
export * from "./publicpricing.js";
|
|
104
109
|
export * from "./quantization.js";
|
|
@@ -129,6 +134,7 @@ export * from "./responseswebsearchcalloutput.js";
|
|
|
129
134
|
export * from "./responseswebsearchuserlocation.js";
|
|
130
135
|
export * from "./responsetextconfig.js";
|
|
131
136
|
export * from "./schema0.js";
|
|
137
|
+
export * from "./schema3.js";
|
|
132
138
|
export * from "./security.js";
|
|
133
139
|
export * from "./serviceunavailableresponseerrordata.js";
|
|
134
140
|
export * from "./systemmessage.js";
|
|
@@ -141,6 +147,7 @@ export * from "./unauthorizedresponseerrordata.js";
|
|
|
141
147
|
export * from "./unprocessableentityresponseerrordata.js";
|
|
142
148
|
export * from "./urlcitation.js";
|
|
143
149
|
export * from "./usermessage.js";
|
|
150
|
+
export * from "./websearchengine.js";
|
|
144
151
|
export * from "./websearchpreviewtooluserlocation.js";
|
|
145
152
|
export * from "./websearchstatus.js";
|
|
146
153
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/models/index.js
CHANGED
|
@@ -98,10 +98,15 @@ export * from "./outputmodality.js";
|
|
|
98
98
|
export * from "./parameter.js";
|
|
99
99
|
export * from "./payloadtoolargeresponseerrordata.js";
|
|
100
100
|
export * from "./paymentrequiredresponseerrordata.js";
|
|
101
|
+
export * from "./pdfparserengine.js";
|
|
102
|
+
export * from "./pdfparseroptions.js";
|
|
101
103
|
export * from "./perrequestlimits.js";
|
|
102
104
|
export * from "./providername.js";
|
|
103
105
|
export * from "./provideroverloadedresponseerrordata.js";
|
|
106
|
+
export * from "./providerpreferences.js";
|
|
104
107
|
export * from "./providersort.js";
|
|
108
|
+
export * from "./providersortconfig.js";
|
|
109
|
+
export * from "./providersortunion.js";
|
|
105
110
|
export * from "./publicendpoint.js";
|
|
106
111
|
export * from "./publicpricing.js";
|
|
107
112
|
export * from "./quantization.js";
|
|
@@ -132,6 +137,7 @@ export * from "./responseswebsearchcalloutput.js";
|
|
|
132
137
|
export * from "./responseswebsearchuserlocation.js";
|
|
133
138
|
export * from "./responsetextconfig.js";
|
|
134
139
|
export * from "./schema0.js";
|
|
140
|
+
export * from "./schema3.js";
|
|
135
141
|
export * from "./security.js";
|
|
136
142
|
export * from "./serviceunavailableresponseerrordata.js";
|
|
137
143
|
export * from "./systemmessage.js";
|
|
@@ -144,6 +150,7 @@ export * from "./unauthorizedresponseerrordata.js";
|
|
|
144
150
|
export * from "./unprocessableentityresponseerrordata.js";
|
|
145
151
|
export * from "./urlcitation.js";
|
|
146
152
|
export * from "./usermessage.js";
|
|
153
|
+
export * from "./websearchengine.js";
|
|
147
154
|
export * from "./websearchpreviewtooluserlocation.js";
|
|
148
155
|
export * from "./websearchstatus.js";
|
|
149
156
|
//# sourceMappingURL=index.js.map
|