notdiamond 2.0.0-rc4 → 2.0.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.
Files changed (181) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/LICENSE +1 -1
  3. package/README.md +294 -166
  4. package/client.d.mts +20 -23
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +20 -23
  7. package/client.d.ts.map +1 -1
  8. package/client.js +43 -46
  9. package/client.js.map +1 -1
  10. package/client.mjs +41 -44
  11. package/client.mjs.map +1 -1
  12. package/core/api-promise.d.mts +2 -2
  13. package/core/api-promise.d.ts +2 -2
  14. package/core/error.d.mts +2 -2
  15. package/core/error.d.ts +2 -2
  16. package/core/error.js +4 -4
  17. package/core/error.mjs +2 -2
  18. package/core/resource.d.mts +3 -3
  19. package/core/resource.d.ts +3 -3
  20. package/index.d.mts +3 -3
  21. package/index.d.ts +3 -3
  22. package/index.js +4 -4
  23. package/index.mjs +3 -3
  24. package/internal/parse.d.mts +2 -2
  25. package/internal/parse.d.ts +2 -2
  26. package/internal/shims.js +1 -1
  27. package/internal/shims.mjs +1 -1
  28. package/internal/tslib.js +17 -17
  29. package/internal/uploads.d.mts +4 -4
  30. package/internal/uploads.d.ts +4 -4
  31. package/internal/utils/base64.js +2 -2
  32. package/internal/utils/base64.mjs +3 -3
  33. package/internal/utils/log.d.mts +3 -3
  34. package/internal/utils/log.d.ts +3 -3
  35. package/internal/utils/path.js +1 -1
  36. package/internal/utils/path.mjs +2 -2
  37. package/internal/utils/values.js +5 -5
  38. package/internal/utils/values.mjs +6 -6
  39. package/package.json +3 -3
  40. package/resources/{pzn.d.mts → custom-router.d.mts} +16 -96
  41. package/resources/custom-router.d.mts.map +1 -0
  42. package/resources/{pzn.d.ts → custom-router.d.ts} +16 -96
  43. package/resources/custom-router.d.ts.map +1 -0
  44. package/resources/{pzn.js → custom-router.js} +13 -50
  45. package/resources/custom-router.js.map +1 -0
  46. package/resources/{pzn.mjs → custom-router.mjs} +11 -48
  47. package/resources/custom-router.mjs.map +1 -0
  48. package/resources/index.d.mts +4 -5
  49. package/resources/index.d.mts.map +1 -1
  50. package/resources/index.d.ts +4 -5
  51. package/resources/index.d.ts.map +1 -1
  52. package/resources/index.js +5 -7
  53. package/resources/index.js.map +1 -1
  54. package/resources/index.mjs +2 -3
  55. package/resources/index.mjs.map +1 -1
  56. package/resources/model-router.d.mts +6 -123
  57. package/resources/model-router.d.mts.map +1 -1
  58. package/resources/model-router.d.ts +6 -123
  59. package/resources/model-router.d.ts.map +1 -1
  60. package/resources/model-router.js +3 -32
  61. package/resources/model-router.js.map +1 -1
  62. package/resources/model-router.mjs +3 -32
  63. package/resources/model-router.mjs.map +1 -1
  64. package/resources/preferences.d.mts +4 -23
  65. package/resources/preferences.d.mts.map +1 -1
  66. package/resources/preferences.d.ts +4 -23
  67. package/resources/preferences.d.ts.map +1 -1
  68. package/resources/preferences.js +3 -25
  69. package/resources/preferences.js.map +1 -1
  70. package/resources/preferences.mjs +3 -25
  71. package/resources/preferences.mjs.map +1 -1
  72. package/resources/prompt-adaptation.d.mts +684 -0
  73. package/resources/prompt-adaptation.d.mts.map +1 -0
  74. package/resources/prompt-adaptation.d.ts +684 -0
  75. package/resources/prompt-adaptation.d.ts.map +1 -0
  76. package/resources/prompt-adaptation.js +258 -0
  77. package/resources/prompt-adaptation.js.map +1 -0
  78. package/resources/prompt-adaptation.mjs +254 -0
  79. package/resources/prompt-adaptation.mjs.map +1 -0
  80. package/src/client.ts +49 -56
  81. package/src/core/api-promise.ts +4 -4
  82. package/src/core/error.ts +2 -2
  83. package/src/core/resource.ts +3 -3
  84. package/src/index.ts +3 -3
  85. package/src/internal/parse.ts +2 -2
  86. package/src/internal/shims.ts +1 -1
  87. package/src/internal/uploads.ts +5 -5
  88. package/src/internal/utils/base64.ts +3 -3
  89. package/src/internal/utils/log.ts +3 -3
  90. package/src/internal/utils/path.ts +2 -2
  91. package/src/internal/utils/values.ts +6 -6
  92. package/src/resources/{pzn.ts → custom-router.ts} +17 -122
  93. package/src/resources/index.ts +14 -16
  94. package/src/resources/model-router.ts +5 -139
  95. package/src/resources/preferences.ts +3 -34
  96. package/src/resources/prompt-adaptation.ts +777 -0
  97. package/src/version.ts +1 -1
  98. package/version.d.mts +1 -1
  99. package/version.d.mts.map +1 -1
  100. package/version.d.ts +1 -1
  101. package/version.d.ts.map +1 -1
  102. package/version.js +1 -1
  103. package/version.js.map +1 -1
  104. package/version.mjs +1 -1
  105. package/version.mjs.map +1 -1
  106. package/resources/prompt/adapt.d.mts +0 -352
  107. package/resources/prompt/adapt.d.mts.map +0 -1
  108. package/resources/prompt/adapt.d.ts +0 -352
  109. package/resources/prompt/adapt.d.ts.map +0 -1
  110. package/resources/prompt/adapt.js +0 -154
  111. package/resources/prompt/adapt.js.map +0 -1
  112. package/resources/prompt/adapt.mjs +0 -150
  113. package/resources/prompt/adapt.mjs.map +0 -1
  114. package/resources/prompt/index.d.mts +0 -3
  115. package/resources/prompt/index.d.mts.map +0 -1
  116. package/resources/prompt/index.d.ts +0 -3
  117. package/resources/prompt/index.d.ts.map +0 -1
  118. package/resources/prompt/index.js +0 -9
  119. package/resources/prompt/index.js.map +0 -1
  120. package/resources/prompt/index.mjs +0 -4
  121. package/resources/prompt/index.mjs.map +0 -1
  122. package/resources/prompt/prompt.d.mts +0 -338
  123. package/resources/prompt/prompt.d.mts.map +0 -1
  124. package/resources/prompt/prompt.d.ts +0 -338
  125. package/resources/prompt/prompt.d.ts.map +0 -1
  126. package/resources/prompt/prompt.js +0 -128
  127. package/resources/prompt/prompt.js.map +0 -1
  128. package/resources/prompt/prompt.mjs +0 -123
  129. package/resources/prompt/prompt.mjs.map +0 -1
  130. package/resources/prompt.d.mts +0 -2
  131. package/resources/prompt.d.mts.map +0 -1
  132. package/resources/prompt.d.ts +0 -2
  133. package/resources/prompt.d.ts.map +0 -1
  134. package/resources/prompt.js +0 -6
  135. package/resources/prompt.js.map +0 -1
  136. package/resources/prompt.mjs +0 -3
  137. package/resources/prompt.mjs.map +0 -1
  138. package/resources/pzn.d.mts.map +0 -1
  139. package/resources/pzn.d.ts.map +0 -1
  140. package/resources/pzn.js.map +0 -1
  141. package/resources/pzn.mjs.map +0 -1
  142. package/resources/report/index.d.mts +0 -3
  143. package/resources/report/index.d.mts.map +0 -1
  144. package/resources/report/index.d.ts +0 -3
  145. package/resources/report/index.d.ts.map +0 -1
  146. package/resources/report/index.js +0 -9
  147. package/resources/report/index.js.map +0 -1
  148. package/resources/report/index.mjs +0 -4
  149. package/resources/report/index.mjs.map +0 -1
  150. package/resources/report/metrics.d.mts +0 -87
  151. package/resources/report/metrics.d.mts.map +0 -1
  152. package/resources/report/metrics.d.ts +0 -87
  153. package/resources/report/metrics.d.ts.map +0 -1
  154. package/resources/report/metrics.js +0 -57
  155. package/resources/report/metrics.js.map +0 -1
  156. package/resources/report/metrics.mjs +0 -53
  157. package/resources/report/metrics.mjs.map +0 -1
  158. package/resources/report/report.d.mts +0 -10
  159. package/resources/report/report.d.mts.map +0 -1
  160. package/resources/report/report.d.ts +0 -10
  161. package/resources/report/report.d.ts.map +0 -1
  162. package/resources/report/report.js +0 -17
  163. package/resources/report/report.js.map +0 -1
  164. package/resources/report/report.mjs +0 -12
  165. package/resources/report/report.mjs.map +0 -1
  166. package/resources/report.d.mts +0 -2
  167. package/resources/report.d.mts.map +0 -1
  168. package/resources/report.d.ts +0 -2
  169. package/resources/report.d.ts.map +0 -1
  170. package/resources/report.js +0 -6
  171. package/resources/report.js.map +0 -1
  172. package/resources/report.mjs +0 -3
  173. package/resources/report.mjs.map +0 -1
  174. package/src/resources/prompt/adapt.ts +0 -402
  175. package/src/resources/prompt/index.ts +0 -16
  176. package/src/resources/prompt/prompt.ts +0 -398
  177. package/src/resources/prompt.ts +0 -3
  178. package/src/resources/report/index.ts +0 -4
  179. package/src/resources/report/metrics.ts +0 -99
  180. package/src/resources/report/report.ts +0 -19
  181. package/src/resources/report.ts +0 -3
@@ -1,17 +1,15 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Report = exports.Pzn = exports.Prompt = exports.Preferences = exports.Models = exports.ModelRouter = void 0;
4
+ exports.PromptAdaptation = exports.Preferences = exports.Models = exports.ModelRouter = exports.CustomRouter = void 0;
5
+ var custom_router_1 = require("./custom-router.js");
6
+ Object.defineProperty(exports, "CustomRouter", { enumerable: true, get: function () { return custom_router_1.CustomRouter; } });
5
7
  var model_router_1 = require("./model-router.js");
6
8
  Object.defineProperty(exports, "ModelRouter", { enumerable: true, get: function () { return model_router_1.ModelRouter; } });
7
9
  var models_1 = require("./models.js");
8
10
  Object.defineProperty(exports, "Models", { enumerable: true, get: function () { return models_1.Models; } });
9
11
  var preferences_1 = require("./preferences.js");
10
12
  Object.defineProperty(exports, "Preferences", { enumerable: true, get: function () { return preferences_1.Preferences; } });
11
- var prompt_1 = require("./prompt/prompt.js");
12
- Object.defineProperty(exports, "Prompt", { enumerable: true, get: function () { return prompt_1.Prompt; } });
13
- var pzn_1 = require("./pzn.js");
14
- Object.defineProperty(exports, "Pzn", { enumerable: true, get: function () { return pzn_1.Pzn; } });
15
- var report_1 = require("./report/report.js");
16
- Object.defineProperty(exports, "Report", { enumerable: true, get: function () { return report_1.Report; } });
13
+ var prompt_adaptation_1 = require("./prompt-adaptation.js");
14
+ Object.defineProperty(exports, "PromptAdaptation", { enumerable: true, get: function () { return prompt_adaptation_1.PromptAdaptation; } });
17
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAMwB;AALtB,2GAAA,WAAW,OAAA;AAMb,sCAA4F;AAAnF,gGAAA,MAAM,OAAA;AACf,gDASuB;AARrB,0GAAA,WAAW,OAAA;AASb,6CAKyB;AAJvB,gGAAA,MAAM,OAAA;AAKR,gCAMe;AALb,0FAAA,GAAG,OAAA;AAML,6CAAyC;AAAhC,gGAAA,MAAM,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oDAIyB;AAHvB,6GAAA,YAAY,OAAA;AAId,kDAIwB;AAHtB,2GAAA,WAAW,OAAA;AAIb,sCAA4F;AAAnF,gGAAA,MAAM,OAAA;AACf,gDAOuB;AANrB,0GAAA,WAAW,OAAA;AAOb,4DAU6B;AAT3B,qHAAA,gBAAgB,OAAA"}
@@ -1,8 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { CustomRouter, } from "./custom-router.mjs";
2
3
  export { ModelRouter, } from "./model-router.mjs";
3
4
  export { Models } from "./models.mjs";
4
5
  export { Preferences, } from "./preferences.mjs";
5
- export { Prompt, } from "./prompt/prompt.mjs";
6
- export { Pzn, } from "./pzn.mjs";
7
- export { Report } from "./report/report.mjs";
6
+ export { PromptAdaptation, } from "./prompt-adaptation.mjs";
8
7
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,WAAW,GAKZ;OACM,EAAE,MAAM,EAA4D;OACpE,EACL,WAAW,GAQZ;OACM,EACL,MAAM,GAIP;OACM,EACL,GAAG,GAKJ;OACM,EAAE,MAAM,EAAE"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,YAAY,GAGb;OACM,EACL,WAAW,GAGZ;OACM,EAAE,MAAM,EAA4D;OACpE,EACL,WAAW,GAMZ;OACM,EACL,gBAAgB,GASjB"}
@@ -1,39 +1,14 @@
1
1
  import { APIResource } from "../core/resource.mjs";
2
- import * as AdaptAPI from "./prompt/adapt.mjs";
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 providers. The router considers factors like query complexity, model
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 for personalized routing
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-1.5-pro' },
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<AdaptAPI.RequestProvider | ModelRouterSelectModelParams.OpenRouterProvider>;
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 ModelRouterOpenHandsSelectResponse as ModelRouterOpenHandsSelectResponse, type ModelRouterSelectModelResponse as ModelRouterSelectModelResponse, type ModelRouterOpenHandsSelectParams as ModelRouterOpenHandsSelectParams, type ModelRouterSelectModelParams as ModelRouterSelectModelParams, };
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,QAAQ;OACb,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,eAAe,CAAC,IAAI,EAAE,gCAAgC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAItG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;IACH,WAAW,CACT,MAAM,EAAE,4BAA4B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,8BAA8B,CAAC;CAI9C;AAED,MAAM,MAAM,kCAAkC,GAAG,OAAO,CAAC;AAEzD;;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,gCAAgC;IA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ACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;IAEjD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,yBAAiB,4BAA4B,CAAC;IAC5C;;;;;;;;;;;;;OAaG;IACH,UAAiB,kBAAkB;QACjC;;;WAGG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAE/B;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAE5B;;WAEG;QACH,SAAS,CAAC,EAAE,OAAO,CAAC;QAEpB;;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"}
@@ -1,39 +1,14 @@
1
1
  import { APIResource } from "../core/resource.js";
2
- import * as AdaptAPI from "./prompt/adapt.js";
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 providers. The router considers factors like query complexity, model
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 for personalized routing
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-1.5-pro' },
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<AdaptAPI.RequestProvider | ModelRouterSelectModelParams.OpenRouterProvider>;
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 ModelRouterOpenHandsSelectResponse as ModelRouterOpenHandsSelectResponse, type ModelRouterSelectModelResponse as ModelRouterSelectModelResponse, type ModelRouterOpenHandsSelectParams as ModelRouterOpenHandsSelectParams, type ModelRouterSelectModelParams as ModelRouterSelectModelParams, };
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,QAAQ;OACb,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,eAAe,CAAC,IAAI,EAAE,gCAAgC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAItG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;IACH,WAAW,CACT,MAAM,EAAE,4BAA4B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,8BAA8B,CAAC;CAI9C;AAED,MAAM,MAAM,kCAAkC,GAAG,OAAO,CAAC;AAEzD;;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,gCAAgC;IAC/C;;;OAGG;IACH,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,eAAe,GAAG,gCAAgC,CAAC,kBAAkB,CAAC,CAAC;IAErG;;OAEG;IACH,QAAQ,EA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AE,MAAM,CAAC;IAEhB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;IAEjD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,yBAAiB,4BAA4B,CAAC;IAC5C;;;;;;;;;;;;;OAaG;IACH,UAAiB,kBAAkB;QACjC;;;WAGG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAE/B;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAE5B;;WAEG;QACH,SAAS,CAAC,EAAE,OAAO,CAAC;QAEpB;;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 providers. The router considers factors like query complexity, model
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 for personalized routing
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-1.5-pro' },
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;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,eAAe,CAAC,IAAsC,EAAE,OAAwB;QAC9E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;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;AA7FD,kCA6FC"}
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 providers. The router considers factors like query complexity, model
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 for personalized routing
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-1.5-pro' },
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;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,eAAe,CAAC,IAAsC,EAAE,OAAwB;QAC9E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;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"}
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"}