notdiamond 2.0.0-rc5 → 2.1.0
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/CHANGELOG.md +170 -0
- package/LICENSE +1 -1
- package/README.md +276 -148
- package/client.d.mts +16 -19
- package/client.d.mts.map +1 -1
- package/client.d.ts +16 -19
- package/client.d.ts.map +1 -1
- package/client.js +11 -14
- package/client.js.map +1 -1
- package/client.mjs +11 -14
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/package.json +3 -3
- package/resources/{pzn.d.mts → custom-router.d.mts} +16 -96
- package/resources/custom-router.d.mts.map +1 -0
- package/resources/{pzn.d.ts → custom-router.d.ts} +16 -96
- package/resources/custom-router.d.ts.map +1 -0
- package/resources/{pzn.js → custom-router.js} +13 -50
- package/resources/custom-router.js.map +1 -0
- package/resources/{pzn.mjs → custom-router.mjs} +11 -48
- package/resources/custom-router.mjs.map +1 -0
- package/resources/index.d.mts +4 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -7
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -3
- package/resources/index.mjs.map +1 -1
- package/resources/model-router.d.mts +6 -123
- package/resources/model-router.d.mts.map +1 -1
- package/resources/model-router.d.ts +6 -123
- package/resources/model-router.d.ts.map +1 -1
- package/resources/model-router.js +3 -32
- package/resources/model-router.js.map +1 -1
- package/resources/model-router.mjs +3 -32
- package/resources/model-router.mjs.map +1 -1
- package/resources/preferences.d.mts +4 -23
- package/resources/preferences.d.mts.map +1 -1
- package/resources/preferences.d.ts +4 -23
- package/resources/preferences.d.ts.map +1 -1
- package/resources/preferences.js +3 -25
- package/resources/preferences.js.map +1 -1
- package/resources/preferences.mjs +3 -25
- package/resources/preferences.mjs.map +1 -1
- package/resources/prompt-adaptation.d.mts +687 -0
- package/resources/prompt-adaptation.d.mts.map +1 -0
- package/resources/prompt-adaptation.d.ts +687 -0
- package/resources/prompt-adaptation.d.ts.map +1 -0
- package/resources/prompt-adaptation.js +258 -0
- package/resources/prompt-adaptation.js.map +1 -0
- package/resources/prompt-adaptation.mjs +254 -0
- package/resources/prompt-adaptation.mjs.map +1 -0
- package/src/client.ts +37 -44
- package/src/resources/{pzn.ts → custom-router.ts} +17 -122
- package/src/resources/index.ts +14 -16
- package/src/resources/model-router.ts +5 -139
- package/src/resources/preferences.ts +3 -34
- package/src/resources/prompt-adaptation.ts +780 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/prompt/adapt.d.mts +0 -352
- package/resources/prompt/adapt.d.mts.map +0 -1
- package/resources/prompt/adapt.d.ts +0 -352
- package/resources/prompt/adapt.d.ts.map +0 -1
- package/resources/prompt/adapt.js +0 -154
- package/resources/prompt/adapt.js.map +0 -1
- package/resources/prompt/adapt.mjs +0 -150
- package/resources/prompt/adapt.mjs.map +0 -1
- package/resources/prompt/index.d.mts +0 -3
- package/resources/prompt/index.d.mts.map +0 -1
- package/resources/prompt/index.d.ts +0 -3
- package/resources/prompt/index.d.ts.map +0 -1
- package/resources/prompt/index.js +0 -9
- package/resources/prompt/index.js.map +0 -1
- package/resources/prompt/index.mjs +0 -4
- package/resources/prompt/index.mjs.map +0 -1
- package/resources/prompt/prompt.d.mts +0 -338
- package/resources/prompt/prompt.d.mts.map +0 -1
- package/resources/prompt/prompt.d.ts +0 -338
- package/resources/prompt/prompt.d.ts.map +0 -1
- package/resources/prompt/prompt.js +0 -128
- package/resources/prompt/prompt.js.map +0 -1
- package/resources/prompt/prompt.mjs +0 -123
- package/resources/prompt/prompt.mjs.map +0 -1
- package/resources/prompt.d.mts +0 -2
- package/resources/prompt.d.mts.map +0 -1
- package/resources/prompt.d.ts +0 -2
- package/resources/prompt.d.ts.map +0 -1
- package/resources/prompt.js +0 -6
- package/resources/prompt.js.map +0 -1
- package/resources/prompt.mjs +0 -3
- package/resources/prompt.mjs.map +0 -1
- package/resources/pzn.d.mts.map +0 -1
- package/resources/pzn.d.ts.map +0 -1
- package/resources/pzn.js.map +0 -1
- package/resources/pzn.mjs.map +0 -1
- package/resources/report/index.d.mts +0 -3
- package/resources/report/index.d.mts.map +0 -1
- package/resources/report/index.d.ts +0 -3
- package/resources/report/index.d.ts.map +0 -1
- package/resources/report/index.js +0 -9
- package/resources/report/index.js.map +0 -1
- package/resources/report/index.mjs +0 -4
- package/resources/report/index.mjs.map +0 -1
- package/resources/report/metrics.d.mts +0 -87
- package/resources/report/metrics.d.mts.map +0 -1
- package/resources/report/metrics.d.ts +0 -87
- package/resources/report/metrics.d.ts.map +0 -1
- package/resources/report/metrics.js +0 -57
- package/resources/report/metrics.js.map +0 -1
- package/resources/report/metrics.mjs +0 -53
- package/resources/report/metrics.mjs.map +0 -1
- package/resources/report/report.d.mts +0 -10
- package/resources/report/report.d.mts.map +0 -1
- package/resources/report/report.d.ts +0 -10
- package/resources/report/report.d.ts.map +0 -1
- package/resources/report/report.js +0 -17
- package/resources/report/report.js.map +0 -1
- package/resources/report/report.mjs +0 -12
- package/resources/report/report.mjs.map +0 -1
- package/resources/report.d.mts +0 -2
- package/resources/report.d.mts.map +0 -1
- package/resources/report.d.ts +0 -2
- package/resources/report.d.ts.map +0 -1
- package/resources/report.js +0 -6
- package/resources/report.js.map +0 -1
- package/resources/report.mjs +0 -3
- package/resources/report.mjs.map +0 -1
- package/src/resources/prompt/adapt.ts +0 -402
- package/src/resources/prompt/index.ts +0 -16
- package/src/resources/prompt/prompt.ts +0 -398
- package/src/resources/prompt.ts +0 -3
- package/src/resources/report/index.ts +0 -4
- package/src/resources/report/metrics.ts +0 -99
- package/src/resources/report/report.ts +0 -19
- package/src/resources/report.ts +0 -3
|
@@ -1,39 +1,14 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as PromptAdaptationAPI from "./prompt-adaptation.mjs";
|
|
3
3
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
5
|
export declare class ModelRouter extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* Openhands Model Select
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const response = await client.modelRouter.openHandsSelect({
|
|
12
|
-
* llm_providers: [
|
|
13
|
-
* { model: 'gpt-4o', provider: 'openai' },
|
|
14
|
-
* {
|
|
15
|
-
* model: 'claude-sonnet-4-5-20250929',
|
|
16
|
-
* provider: 'anthropic',
|
|
17
|
-
* },
|
|
18
|
-
* { model: 'gemini-1.5-pro', provider: 'google' },
|
|
19
|
-
* ],
|
|
20
|
-
* messages: [
|
|
21
|
-
* {
|
|
22
|
-
* content: 'You are a helpful assistant.',
|
|
23
|
-
* role: 'system',
|
|
24
|
-
* },
|
|
25
|
-
* { content: 'Explain quantum computing', role: 'user' },
|
|
26
|
-
* ],
|
|
27
|
-
* });
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
openHandsSelect(body: ModelRouterOpenHandsSelectParams, options?: RequestOptions): APIPromise<unknown>;
|
|
31
6
|
/**
|
|
32
7
|
* Select the optimal LLM to handle your query based on Not Diamond's routing
|
|
33
8
|
* algorithm.
|
|
34
9
|
*
|
|
35
10
|
* This endpoint analyzes your messages and returns the best-suited model from your
|
|
36
|
-
* specified
|
|
11
|
+
* specified models. The router considers factors like query complexity, model
|
|
37
12
|
* capabilities, cost, and latency based on your preferences.
|
|
38
13
|
*
|
|
39
14
|
* **Key Features:**
|
|
@@ -42,14 +17,13 @@ export declare class ModelRouter extends APIResource {
|
|
|
42
17
|
* - Support for custom routers trained on your evaluation data
|
|
43
18
|
* - Optional cost/latency optimization
|
|
44
19
|
* - Function calling support for compatible models
|
|
45
|
-
* - Privacy-preserving content hashing
|
|
46
20
|
*
|
|
47
21
|
* **Usage:**
|
|
48
22
|
*
|
|
49
23
|
* 1. Pass your messages in OpenAI format (array of objects with 'role' and
|
|
50
24
|
* 'content')
|
|
51
25
|
* 2. Specify which LLM providers you want to route between
|
|
52
|
-
* 3. Optionally provide a preference_id
|
|
26
|
+
* 3. Optionally provide a preference_id to use a custom router that you've trained
|
|
53
27
|
* 4. Receive a recommended model and session_id
|
|
54
28
|
* 5. Use the session_id to submit feedback and improve routing
|
|
55
29
|
*
|
|
@@ -57,7 +31,6 @@ export declare class ModelRouter extends APIResource {
|
|
|
57
31
|
*
|
|
58
32
|
* - `POST /v2/preferences/userPreferenceCreate` - Create a preference ID for
|
|
59
33
|
* personalized routing
|
|
60
|
-
* - `POST /v2/report/metrics/feedback` - Submit feedback on routing decisions
|
|
61
34
|
* - `POST /v2/pzn/trainCustomRouter` - Train a custom router on your evaluation
|
|
62
35
|
* data
|
|
63
36
|
*
|
|
@@ -70,7 +43,7 @@ export declare class ModelRouter extends APIResource {
|
|
|
70
43
|
* provider: 'anthropic',
|
|
71
44
|
* model: 'claude-sonnet-4-5-20250929',
|
|
72
45
|
* },
|
|
73
|
-
* { provider: 'google', model: 'gemini-
|
|
46
|
+
* { provider: 'google', model: 'gemini-2.5-flash' },
|
|
74
47
|
* ],
|
|
75
48
|
* messages: [
|
|
76
49
|
* {
|
|
@@ -87,7 +60,6 @@ export declare class ModelRouter extends APIResource {
|
|
|
87
60
|
*/
|
|
88
61
|
selectModel(params: ModelRouterSelectModelParams, options?: RequestOptions): APIPromise<ModelRouterSelectModelResponse>;
|
|
89
62
|
}
|
|
90
|
-
export type ModelRouterOpenHandsSelectResponse = unknown;
|
|
91
63
|
/**
|
|
92
64
|
* Response from model selection endpoint.
|
|
93
65
|
*/
|
|
@@ -121,101 +93,12 @@ export declare namespace ModelRouterSelectModelResponse {
|
|
|
121
93
|
provider: string;
|
|
122
94
|
}
|
|
123
95
|
}
|
|
124
|
-
export interface ModelRouterOpenHandsSelectParams {
|
|
125
|
-
/**
|
|
126
|
-
* List of LLM providers to route between. Specify at least one provider in format
|
|
127
|
-
* {provider, model}
|
|
128
|
-
*/
|
|
129
|
-
llm_providers: Array<AdaptAPI.RequestProvider | ModelRouterOpenHandsSelectParams.OpenRouterProvider>;
|
|
130
|
-
/**
|
|
131
|
-
* Array of message objects in OpenAI format (with 'role' and 'content' keys)
|
|
132
|
-
*/
|
|
133
|
-
messages: Array<{
|
|
134
|
-
[key: string]: string | Array<unknown>;
|
|
135
|
-
}> | string;
|
|
136
|
-
/**
|
|
137
|
-
* Whether to hash message content for privacy
|
|
138
|
-
*/
|
|
139
|
-
hash_content?: boolean;
|
|
140
|
-
/**
|
|
141
|
-
* Maximum number of models to consider for routing. If not specified, considers
|
|
142
|
-
* all provided models
|
|
143
|
-
*/
|
|
144
|
-
max_model_depth?: number | null;
|
|
145
|
-
/**
|
|
146
|
-
* Optimization metric for model selection
|
|
147
|
-
*/
|
|
148
|
-
metric?: string;
|
|
149
|
-
/**
|
|
150
|
-
* Preference ID for personalized routing. Create one via POST
|
|
151
|
-
* /v2/preferences/userPreferenceCreate
|
|
152
|
-
*/
|
|
153
|
-
preference_id?: string | null;
|
|
154
|
-
/**
|
|
155
|
-
* Previous session ID to link related requests
|
|
156
|
-
*/
|
|
157
|
-
previous_session?: string | null;
|
|
158
|
-
/**
|
|
159
|
-
* OpenAI-format function calling tools
|
|
160
|
-
*/
|
|
161
|
-
tools?: Array<{
|
|
162
|
-
[key: string]: unknown;
|
|
163
|
-
}> | null;
|
|
164
|
-
/**
|
|
165
|
-
* Optimization tradeoff strategy. Use 'cost' to prioritize cost savings or
|
|
166
|
-
* 'latency' to prioritize speed
|
|
167
|
-
*/
|
|
168
|
-
tradeoff?: string | null;
|
|
169
|
-
}
|
|
170
|
-
export declare namespace ModelRouterOpenHandsSelectParams {
|
|
171
|
-
/**
|
|
172
|
-
* Model for specifying an LLM provider using OpenRouter format.
|
|
173
|
-
*
|
|
174
|
-
* Used in model routing requests when you want to specify providers using the
|
|
175
|
-
* OpenRouter naming convention (combined 'provider/model' format). This is an
|
|
176
|
-
* alternative to the standard RequestProvider which uses separate provider and
|
|
177
|
-
* model fields.
|
|
178
|
-
*
|
|
179
|
-
* **When to use:**
|
|
180
|
-
*
|
|
181
|
-
* - When working with OpenRouter-compatible systems
|
|
182
|
-
* - When you prefer the unified 'provider/model' format
|
|
183
|
-
* - For models accessed via OpenRouter proxy
|
|
184
|
-
*/
|
|
185
|
-
interface OpenRouterProvider {
|
|
186
|
-
/**
|
|
187
|
-
* OpenRouter model identifier in 'provider/model' format (e.g., 'openai/gpt-4o',
|
|
188
|
-
* 'anthropic/claude-sonnet-4-5-20250929')
|
|
189
|
-
*/
|
|
190
|
-
model: string;
|
|
191
|
-
/**
|
|
192
|
-
* Maximum context length for the model (required for custom models)
|
|
193
|
-
*/
|
|
194
|
-
context_length?: number | null;
|
|
195
|
-
/**
|
|
196
|
-
* Input token price per million tokens in USD (required for custom models)
|
|
197
|
-
*/
|
|
198
|
-
input_price?: number | null;
|
|
199
|
-
/**
|
|
200
|
-
* Whether this is a custom model not in Not Diamond's supported model list
|
|
201
|
-
*/
|
|
202
|
-
is_custom?: boolean;
|
|
203
|
-
/**
|
|
204
|
-
* Average latency in seconds (required for custom models)
|
|
205
|
-
*/
|
|
206
|
-
latency?: number | null;
|
|
207
|
-
/**
|
|
208
|
-
* Output token price per million tokens in USD (required for custom models)
|
|
209
|
-
*/
|
|
210
|
-
output_price?: number | null;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
96
|
export interface ModelRouterSelectModelParams {
|
|
214
97
|
/**
|
|
215
98
|
* Body param: List of LLM providers to route between. Specify at least one
|
|
216
99
|
* provider in format {provider, model}
|
|
217
100
|
*/
|
|
218
|
-
llm_providers: Array<
|
|
101
|
+
llm_providers: Array<PromptAdaptationAPI.RequestProvider | ModelRouterSelectModelParams.OpenRouterProvider>;
|
|
219
102
|
/**
|
|
220
103
|
* Body param: Array of message objects in OpenAI format (with 'role' and 'content'
|
|
221
104
|
* keys)
|
|
@@ -306,6 +189,6 @@ export declare namespace ModelRouterSelectModelParams {
|
|
|
306
189
|
}
|
|
307
190
|
}
|
|
308
191
|
export declare namespace ModelRouter {
|
|
309
|
-
export { type
|
|
192
|
+
export { type ModelRouterSelectModelResponse as ModelRouterSelectModelResponse, type ModelRouterSelectModelParams as ModelRouterSelectModelParams, };
|
|
310
193
|
}
|
|
311
194
|
//# sourceMappingURL=model-router.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-router.d.mts","sourceRoot":"","sources":["../src/resources/model-router.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,
|
|
1
|
+
{"version":3,"file":"model-router.d.mts","sourceRoot":"","sources":["../src/resources/model-router.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,mBAAmB;OACxB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsDG;IACH,WAAW,CACT,MAAM,EAAE,4BAA4B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,8BAA8B,CAAC;CAI9C;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IAE1D;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,yBAAiB,8BAA8B,CAAC;IAC9C;;;;;;OAMG;IACH,UAAiB,QAAQ;QACvB;;;WAGG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;KAClB;CACF;AAED,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,aAA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W,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -1,39 +1,14 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as PromptAdaptationAPI from "./prompt-adaptation.js";
|
|
3
3
|
import { APIPromise } from "../core/api-promise.js";
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.js";
|
|
5
5
|
export declare class ModelRouter extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* Openhands Model Select
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const response = await client.modelRouter.openHandsSelect({
|
|
12
|
-
* llm_providers: [
|
|
13
|
-
* { model: 'gpt-4o', provider: 'openai' },
|
|
14
|
-
* {
|
|
15
|
-
* model: 'claude-sonnet-4-5-20250929',
|
|
16
|
-
* provider: 'anthropic',
|
|
17
|
-
* },
|
|
18
|
-
* { model: 'gemini-1.5-pro', provider: 'google' },
|
|
19
|
-
* ],
|
|
20
|
-
* messages: [
|
|
21
|
-
* {
|
|
22
|
-
* content: 'You are a helpful assistant.',
|
|
23
|
-
* role: 'system',
|
|
24
|
-
* },
|
|
25
|
-
* { content: 'Explain quantum computing', role: 'user' },
|
|
26
|
-
* ],
|
|
27
|
-
* });
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
openHandsSelect(body: ModelRouterOpenHandsSelectParams, options?: RequestOptions): APIPromise<unknown>;
|
|
31
6
|
/**
|
|
32
7
|
* Select the optimal LLM to handle your query based on Not Diamond's routing
|
|
33
8
|
* algorithm.
|
|
34
9
|
*
|
|
35
10
|
* This endpoint analyzes your messages and returns the best-suited model from your
|
|
36
|
-
* specified
|
|
11
|
+
* specified models. The router considers factors like query complexity, model
|
|
37
12
|
* capabilities, cost, and latency based on your preferences.
|
|
38
13
|
*
|
|
39
14
|
* **Key Features:**
|
|
@@ -42,14 +17,13 @@ export declare class ModelRouter extends APIResource {
|
|
|
42
17
|
* - Support for custom routers trained on your evaluation data
|
|
43
18
|
* - Optional cost/latency optimization
|
|
44
19
|
* - Function calling support for compatible models
|
|
45
|
-
* - Privacy-preserving content hashing
|
|
46
20
|
*
|
|
47
21
|
* **Usage:**
|
|
48
22
|
*
|
|
49
23
|
* 1. Pass your messages in OpenAI format (array of objects with 'role' and
|
|
50
24
|
* 'content')
|
|
51
25
|
* 2. Specify which LLM providers you want to route between
|
|
52
|
-
* 3. Optionally provide a preference_id
|
|
26
|
+
* 3. Optionally provide a preference_id to use a custom router that you've trained
|
|
53
27
|
* 4. Receive a recommended model and session_id
|
|
54
28
|
* 5. Use the session_id to submit feedback and improve routing
|
|
55
29
|
*
|
|
@@ -57,7 +31,6 @@ export declare class ModelRouter extends APIResource {
|
|
|
57
31
|
*
|
|
58
32
|
* - `POST /v2/preferences/userPreferenceCreate` - Create a preference ID for
|
|
59
33
|
* personalized routing
|
|
60
|
-
* - `POST /v2/report/metrics/feedback` - Submit feedback on routing decisions
|
|
61
34
|
* - `POST /v2/pzn/trainCustomRouter` - Train a custom router on your evaluation
|
|
62
35
|
* data
|
|
63
36
|
*
|
|
@@ -70,7 +43,7 @@ export declare class ModelRouter extends APIResource {
|
|
|
70
43
|
* provider: 'anthropic',
|
|
71
44
|
* model: 'claude-sonnet-4-5-20250929',
|
|
72
45
|
* },
|
|
73
|
-
* { provider: 'google', model: 'gemini-
|
|
46
|
+
* { provider: 'google', model: 'gemini-2.5-flash' },
|
|
74
47
|
* ],
|
|
75
48
|
* messages: [
|
|
76
49
|
* {
|
|
@@ -87,7 +60,6 @@ export declare class ModelRouter extends APIResource {
|
|
|
87
60
|
*/
|
|
88
61
|
selectModel(params: ModelRouterSelectModelParams, options?: RequestOptions): APIPromise<ModelRouterSelectModelResponse>;
|
|
89
62
|
}
|
|
90
|
-
export type ModelRouterOpenHandsSelectResponse = unknown;
|
|
91
63
|
/**
|
|
92
64
|
* Response from model selection endpoint.
|
|
93
65
|
*/
|
|
@@ -121,101 +93,12 @@ export declare namespace ModelRouterSelectModelResponse {
|
|
|
121
93
|
provider: string;
|
|
122
94
|
}
|
|
123
95
|
}
|
|
124
|
-
export interface ModelRouterOpenHandsSelectParams {
|
|
125
|
-
/**
|
|
126
|
-
* List of LLM providers to route between. Specify at least one provider in format
|
|
127
|
-
* {provider, model}
|
|
128
|
-
*/
|
|
129
|
-
llm_providers: Array<AdaptAPI.RequestProvider | ModelRouterOpenHandsSelectParams.OpenRouterProvider>;
|
|
130
|
-
/**
|
|
131
|
-
* Array of message objects in OpenAI format (with 'role' and 'content' keys)
|
|
132
|
-
*/
|
|
133
|
-
messages: Array<{
|
|
134
|
-
[key: string]: string | Array<unknown>;
|
|
135
|
-
}> | string;
|
|
136
|
-
/**
|
|
137
|
-
* Whether to hash message content for privacy
|
|
138
|
-
*/
|
|
139
|
-
hash_content?: boolean;
|
|
140
|
-
/**
|
|
141
|
-
* Maximum number of models to consider for routing. If not specified, considers
|
|
142
|
-
* all provided models
|
|
143
|
-
*/
|
|
144
|
-
max_model_depth?: number | null;
|
|
145
|
-
/**
|
|
146
|
-
* Optimization metric for model selection
|
|
147
|
-
*/
|
|
148
|
-
metric?: string;
|
|
149
|
-
/**
|
|
150
|
-
* Preference ID for personalized routing. Create one via POST
|
|
151
|
-
* /v2/preferences/userPreferenceCreate
|
|
152
|
-
*/
|
|
153
|
-
preference_id?: string | null;
|
|
154
|
-
/**
|
|
155
|
-
* Previous session ID to link related requests
|
|
156
|
-
*/
|
|
157
|
-
previous_session?: string | null;
|
|
158
|
-
/**
|
|
159
|
-
* OpenAI-format function calling tools
|
|
160
|
-
*/
|
|
161
|
-
tools?: Array<{
|
|
162
|
-
[key: string]: unknown;
|
|
163
|
-
}> | null;
|
|
164
|
-
/**
|
|
165
|
-
* Optimization tradeoff strategy. Use 'cost' to prioritize cost savings or
|
|
166
|
-
* 'latency' to prioritize speed
|
|
167
|
-
*/
|
|
168
|
-
tradeoff?: string | null;
|
|
169
|
-
}
|
|
170
|
-
export declare namespace ModelRouterOpenHandsSelectParams {
|
|
171
|
-
/**
|
|
172
|
-
* Model for specifying an LLM provider using OpenRouter format.
|
|
173
|
-
*
|
|
174
|
-
* Used in model routing requests when you want to specify providers using the
|
|
175
|
-
* OpenRouter naming convention (combined 'provider/model' format). This is an
|
|
176
|
-
* alternative to the standard RequestProvider which uses separate provider and
|
|
177
|
-
* model fields.
|
|
178
|
-
*
|
|
179
|
-
* **When to use:**
|
|
180
|
-
*
|
|
181
|
-
* - When working with OpenRouter-compatible systems
|
|
182
|
-
* - When you prefer the unified 'provider/model' format
|
|
183
|
-
* - For models accessed via OpenRouter proxy
|
|
184
|
-
*/
|
|
185
|
-
interface OpenRouterProvider {
|
|
186
|
-
/**
|
|
187
|
-
* OpenRouter model identifier in 'provider/model' format (e.g., 'openai/gpt-4o',
|
|
188
|
-
* 'anthropic/claude-sonnet-4-5-20250929')
|
|
189
|
-
*/
|
|
190
|
-
model: string;
|
|
191
|
-
/**
|
|
192
|
-
* Maximum context length for the model (required for custom models)
|
|
193
|
-
*/
|
|
194
|
-
context_length?: number | null;
|
|
195
|
-
/**
|
|
196
|
-
* Input token price per million tokens in USD (required for custom models)
|
|
197
|
-
*/
|
|
198
|
-
input_price?: number | null;
|
|
199
|
-
/**
|
|
200
|
-
* Whether this is a custom model not in Not Diamond's supported model list
|
|
201
|
-
*/
|
|
202
|
-
is_custom?: boolean;
|
|
203
|
-
/**
|
|
204
|
-
* Average latency in seconds (required for custom models)
|
|
205
|
-
*/
|
|
206
|
-
latency?: number | null;
|
|
207
|
-
/**
|
|
208
|
-
* Output token price per million tokens in USD (required for custom models)
|
|
209
|
-
*/
|
|
210
|
-
output_price?: number | null;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
96
|
export interface ModelRouterSelectModelParams {
|
|
214
97
|
/**
|
|
215
98
|
* Body param: List of LLM providers to route between. Specify at least one
|
|
216
99
|
* provider in format {provider, model}
|
|
217
100
|
*/
|
|
218
|
-
llm_providers: Array<
|
|
101
|
+
llm_providers: Array<PromptAdaptationAPI.RequestProvider | ModelRouterSelectModelParams.OpenRouterProvider>;
|
|
219
102
|
/**
|
|
220
103
|
* Body param: Array of message objects in OpenAI format (with 'role' and 'content'
|
|
221
104
|
* keys)
|
|
@@ -306,6 +189,6 @@ export declare namespace ModelRouterSelectModelParams {
|
|
|
306
189
|
}
|
|
307
190
|
}
|
|
308
191
|
export declare namespace ModelRouter {
|
|
309
|
-
export { type
|
|
192
|
+
export { type ModelRouterSelectModelResponse as ModelRouterSelectModelResponse, type ModelRouterSelectModelParams as ModelRouterSelectModelParams, };
|
|
310
193
|
}
|
|
311
194
|
//# sourceMappingURL=model-router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-router.d.ts","sourceRoot":"","sources":["../src/resources/model-router.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,
|
|
1
|
+
{"version":3,"file":"model-router.d.ts","sourceRoot":"","sources":["../src/resources/model-router.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,mBAAmB;OACxB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsDG;IACH,WAAW,CACT,MAAM,EAAE,4BAA4B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,8BAA8B,CAAC;CAI9C;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IAE1D;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,yBAAiB,8BAA8B,CAAC;IAC9C;;;;;;OAMG;IACH,UAAiB,QA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WAEG;QACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAExB;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B;CACF;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -4,39 +4,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.ModelRouter = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
class ModelRouter extends resource_1.APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Openhands Model Select
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const response = await client.modelRouter.openHandsSelect({
|
|
13
|
-
* llm_providers: [
|
|
14
|
-
* { model: 'gpt-4o', provider: 'openai' },
|
|
15
|
-
* {
|
|
16
|
-
* model: 'claude-sonnet-4-5-20250929',
|
|
17
|
-
* provider: 'anthropic',
|
|
18
|
-
* },
|
|
19
|
-
* { model: 'gemini-1.5-pro', provider: 'google' },
|
|
20
|
-
* ],
|
|
21
|
-
* messages: [
|
|
22
|
-
* {
|
|
23
|
-
* content: 'You are a helpful assistant.',
|
|
24
|
-
* role: 'system',
|
|
25
|
-
* },
|
|
26
|
-
* { content: 'Explain quantum computing', role: 'user' },
|
|
27
|
-
* ],
|
|
28
|
-
* });
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
openHandsSelect(body, options) {
|
|
32
|
-
return this._client.post('/v2/modelRouter/openHandsRouter', { body, ...options });
|
|
33
|
-
}
|
|
34
7
|
/**
|
|
35
8
|
* Select the optimal LLM to handle your query based on Not Diamond's routing
|
|
36
9
|
* algorithm.
|
|
37
10
|
*
|
|
38
11
|
* This endpoint analyzes your messages and returns the best-suited model from your
|
|
39
|
-
* specified
|
|
12
|
+
* specified models. The router considers factors like query complexity, model
|
|
40
13
|
* capabilities, cost, and latency based on your preferences.
|
|
41
14
|
*
|
|
42
15
|
* **Key Features:**
|
|
@@ -45,14 +18,13 @@ class ModelRouter extends resource_1.APIResource {
|
|
|
45
18
|
* - Support for custom routers trained on your evaluation data
|
|
46
19
|
* - Optional cost/latency optimization
|
|
47
20
|
* - Function calling support for compatible models
|
|
48
|
-
* - Privacy-preserving content hashing
|
|
49
21
|
*
|
|
50
22
|
* **Usage:**
|
|
51
23
|
*
|
|
52
24
|
* 1. Pass your messages in OpenAI format (array of objects with 'role' and
|
|
53
25
|
* 'content')
|
|
54
26
|
* 2. Specify which LLM providers you want to route between
|
|
55
|
-
* 3. Optionally provide a preference_id
|
|
27
|
+
* 3. Optionally provide a preference_id to use a custom router that you've trained
|
|
56
28
|
* 4. Receive a recommended model and session_id
|
|
57
29
|
* 5. Use the session_id to submit feedback and improve routing
|
|
58
30
|
*
|
|
@@ -60,7 +32,6 @@ class ModelRouter extends resource_1.APIResource {
|
|
|
60
32
|
*
|
|
61
33
|
* - `POST /v2/preferences/userPreferenceCreate` - Create a preference ID for
|
|
62
34
|
* personalized routing
|
|
63
|
-
* - `POST /v2/report/metrics/feedback` - Submit feedback on routing decisions
|
|
64
35
|
* - `POST /v2/pzn/trainCustomRouter` - Train a custom router on your evaluation
|
|
65
36
|
* data
|
|
66
37
|
*
|
|
@@ -73,7 +44,7 @@ class ModelRouter extends resource_1.APIResource {
|
|
|
73
44
|
* provider: 'anthropic',
|
|
74
45
|
* model: 'claude-sonnet-4-5-20250929',
|
|
75
46
|
* },
|
|
76
|
-
* { provider: 'google', model: 'gemini-
|
|
47
|
+
* { provider: 'google', model: 'gemini-2.5-flash' },
|
|
77
48
|
* ],
|
|
78
49
|
* messages: [
|
|
79
50
|
* {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-router.js","sourceRoot":"","sources":["../src/resources/model-router.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C,MAAa,WAAY,SAAQ,sBAAW;IAC1C
|
|
1
|
+
{"version":3,"file":"model-router.js","sourceRoot":"","sources":["../src/resources/model-router.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsDG;IACH,WAAW,CACT,MAAoC,EACpC,OAAwB;QAExB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;CACF;AA/DD,kCA+DC"}
|
|
@@ -1,39 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
export class ModelRouter extends APIResource {
|
|
4
|
-
/**
|
|
5
|
-
* Openhands Model Select
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* const response = await client.modelRouter.openHandsSelect({
|
|
10
|
-
* llm_providers: [
|
|
11
|
-
* { model: 'gpt-4o', provider: 'openai' },
|
|
12
|
-
* {
|
|
13
|
-
* model: 'claude-sonnet-4-5-20250929',
|
|
14
|
-
* provider: 'anthropic',
|
|
15
|
-
* },
|
|
16
|
-
* { model: 'gemini-1.5-pro', provider: 'google' },
|
|
17
|
-
* ],
|
|
18
|
-
* messages: [
|
|
19
|
-
* {
|
|
20
|
-
* content: 'You are a helpful assistant.',
|
|
21
|
-
* role: 'system',
|
|
22
|
-
* },
|
|
23
|
-
* { content: 'Explain quantum computing', role: 'user' },
|
|
24
|
-
* ],
|
|
25
|
-
* });
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
openHandsSelect(body, options) {
|
|
29
|
-
return this._client.post('/v2/modelRouter/openHandsRouter', { body, ...options });
|
|
30
|
-
}
|
|
31
4
|
/**
|
|
32
5
|
* Select the optimal LLM to handle your query based on Not Diamond's routing
|
|
33
6
|
* algorithm.
|
|
34
7
|
*
|
|
35
8
|
* This endpoint analyzes your messages and returns the best-suited model from your
|
|
36
|
-
* specified
|
|
9
|
+
* specified models. The router considers factors like query complexity, model
|
|
37
10
|
* capabilities, cost, and latency based on your preferences.
|
|
38
11
|
*
|
|
39
12
|
* **Key Features:**
|
|
@@ -42,14 +15,13 @@ export class ModelRouter extends APIResource {
|
|
|
42
15
|
* - Support for custom routers trained on your evaluation data
|
|
43
16
|
* - Optional cost/latency optimization
|
|
44
17
|
* - Function calling support for compatible models
|
|
45
|
-
* - Privacy-preserving content hashing
|
|
46
18
|
*
|
|
47
19
|
* **Usage:**
|
|
48
20
|
*
|
|
49
21
|
* 1. Pass your messages in OpenAI format (array of objects with 'role' and
|
|
50
22
|
* 'content')
|
|
51
23
|
* 2. Specify which LLM providers you want to route between
|
|
52
|
-
* 3. Optionally provide a preference_id
|
|
24
|
+
* 3. Optionally provide a preference_id to use a custom router that you've trained
|
|
53
25
|
* 4. Receive a recommended model and session_id
|
|
54
26
|
* 5. Use the session_id to submit feedback and improve routing
|
|
55
27
|
*
|
|
@@ -57,7 +29,6 @@ export class ModelRouter extends APIResource {
|
|
|
57
29
|
*
|
|
58
30
|
* - `POST /v2/preferences/userPreferenceCreate` - Create a preference ID for
|
|
59
31
|
* personalized routing
|
|
60
|
-
* - `POST /v2/report/metrics/feedback` - Submit feedback on routing decisions
|
|
61
32
|
* - `POST /v2/pzn/trainCustomRouter` - Train a custom router on your evaluation
|
|
62
33
|
* data
|
|
63
34
|
*
|
|
@@ -70,7 +41,7 @@ export class ModelRouter extends APIResource {
|
|
|
70
41
|
* provider: 'anthropic',
|
|
71
42
|
* model: 'claude-sonnet-4-5-20250929',
|
|
72
43
|
* },
|
|
73
|
-
* { provider: 'google', model: 'gemini-
|
|
44
|
+
* { provider: 'google', model: 'gemini-2.5-flash' },
|
|
74
45
|
* ],
|
|
75
46
|
* messages: [
|
|
76
47
|
* {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-router.mjs","sourceRoot":"","sources":["../src/resources/model-router.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAKtB,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C
|
|
1
|
+
{"version":3,"file":"model-router.mjs","sourceRoot":"","sources":["../src/resources/model-router.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAKtB,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsDG;IACH,WAAW,CACT,MAAoC,EACpC,OAAwB;QAExB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;CACF"}
|
|
@@ -9,20 +9,17 @@ export declare class Preferences extends APIResource {
|
|
|
9
9
|
* learning your preferences over time. Once created, you can:
|
|
10
10
|
*
|
|
11
11
|
* 1. Use it in model_select() calls to get personalized routing decisions
|
|
12
|
-
* 2.
|
|
13
|
-
* 3. Train a custom router specific to your use case
|
|
12
|
+
* 2. Train a custom router specific to your use case
|
|
14
13
|
*
|
|
15
14
|
* **Workflow:**
|
|
16
15
|
*
|
|
17
16
|
* 1. Create a preference ID (this endpoint)
|
|
18
17
|
* 2. Use the preference_id in POST /v2/modelRouter/modelSelect requests
|
|
19
|
-
* 3.
|
|
20
|
-
* 4. Optionally train a custom router via POST /v2/pzn/trainCustomRouter
|
|
18
|
+
* 3. Optionally train a custom router via POST /v2/pzn/trainCustomRouter
|
|
21
19
|
*
|
|
22
20
|
* **Benefits:**
|
|
23
21
|
*
|
|
24
|
-
* - Personalized routing
|
|
25
|
-
* - Improved accuracy for your specific use case
|
|
22
|
+
* - Personalized routing for your specific use case
|
|
26
23
|
* - Ability to train custom routers on your evaluation data
|
|
27
24
|
*
|
|
28
25
|
* **Note:** If you don't provide a preference_id in model_select() calls, the
|
|
@@ -34,18 +31,6 @@ export declare class Preferences extends APIResource {
|
|
|
34
31
|
* ```
|
|
35
32
|
*/
|
|
36
33
|
create(body: PreferenceCreateParams, options?: RequestOptions): APIPromise<PreferenceCreateResponse>;
|
|
37
|
-
/**
|
|
38
|
-
* Get User Preference
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```ts
|
|
42
|
-
* const preference = await client.preferences.retrieve(
|
|
43
|
-
* 'user_id',
|
|
44
|
-
* { 'x-token': 'x-token' },
|
|
45
|
-
* );
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
retrieve(userID: string, params: PreferenceRetrieveParams, options?: RequestOptions): APIPromise<unknown>;
|
|
49
34
|
/**
|
|
50
35
|
* Update User Preference
|
|
51
36
|
*
|
|
@@ -89,7 +74,6 @@ export interface PreferenceCreateResponse {
|
|
|
89
74
|
*/
|
|
90
75
|
preference_id: string;
|
|
91
76
|
}
|
|
92
|
-
export type PreferenceRetrieveResponse = unknown;
|
|
93
77
|
export type PreferenceUpdateResponse = unknown;
|
|
94
78
|
export type PreferenceDeleteResponse = unknown;
|
|
95
79
|
export interface PreferenceCreateParams {
|
|
@@ -100,14 +84,11 @@ export interface PreferenceCreateParams {
|
|
|
100
84
|
*/
|
|
101
85
|
name?: string | null;
|
|
102
86
|
}
|
|
103
|
-
export interface PreferenceRetrieveParams {
|
|
104
|
-
'x-token': string;
|
|
105
|
-
}
|
|
106
87
|
export interface PreferenceUpdateParams {
|
|
107
88
|
preference_id: string;
|
|
108
89
|
name?: string | null;
|
|
109
90
|
}
|
|
110
91
|
export declare namespace Preferences {
|
|
111
|
-
export { type PreferenceCreateResponse as PreferenceCreateResponse, type
|
|
92
|
+
export { type PreferenceCreateResponse as PreferenceCreateResponse, type PreferenceUpdateResponse as PreferenceUpdateResponse, type PreferenceDeleteResponse as PreferenceDeleteResponse, type PreferenceCreateParams as PreferenceCreateParams, type PreferenceUpdateParams as PreferenceUpdateParams, };
|
|
112
93
|
}
|
|
113
94
|
//# sourceMappingURL=preferences.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.d.mts","sourceRoot":"","sources":["../src/resources/preferences.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"preferences.d.mts","sourceRoot":"","sources":["../src/resources/preferences.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInF;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;CAG5E;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,wBAAwB,GAAG,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