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.
Files changed (144) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/LICENSE +1 -1
  3. package/README.md +276 -148
  4. package/client.d.mts +16 -19
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +16 -19
  7. package/client.d.ts.map +1 -1
  8. package/client.js +11 -14
  9. package/client.js.map +1 -1
  10. package/client.mjs +11 -14
  11. package/client.mjs.map +1 -1
  12. package/internal/tslib.js +17 -17
  13. package/package.json +3 -3
  14. package/resources/{pzn.d.mts → custom-router.d.mts} +16 -96
  15. package/resources/custom-router.d.mts.map +1 -0
  16. package/resources/{pzn.d.ts → custom-router.d.ts} +16 -96
  17. package/resources/custom-router.d.ts.map +1 -0
  18. package/resources/{pzn.js → custom-router.js} +13 -50
  19. package/resources/custom-router.js.map +1 -0
  20. package/resources/{pzn.mjs → custom-router.mjs} +11 -48
  21. package/resources/custom-router.mjs.map +1 -0
  22. package/resources/index.d.mts +4 -5
  23. package/resources/index.d.mts.map +1 -1
  24. package/resources/index.d.ts +4 -5
  25. package/resources/index.d.ts.map +1 -1
  26. package/resources/index.js +5 -7
  27. package/resources/index.js.map +1 -1
  28. package/resources/index.mjs +2 -3
  29. package/resources/index.mjs.map +1 -1
  30. package/resources/model-router.d.mts +6 -123
  31. package/resources/model-router.d.mts.map +1 -1
  32. package/resources/model-router.d.ts +6 -123
  33. package/resources/model-router.d.ts.map +1 -1
  34. package/resources/model-router.js +3 -32
  35. package/resources/model-router.js.map +1 -1
  36. package/resources/model-router.mjs +3 -32
  37. package/resources/model-router.mjs.map +1 -1
  38. package/resources/preferences.d.mts +4 -23
  39. package/resources/preferences.d.mts.map +1 -1
  40. package/resources/preferences.d.ts +4 -23
  41. package/resources/preferences.d.ts.map +1 -1
  42. package/resources/preferences.js +3 -25
  43. package/resources/preferences.js.map +1 -1
  44. package/resources/preferences.mjs +3 -25
  45. package/resources/preferences.mjs.map +1 -1
  46. package/resources/prompt-adaptation.d.mts +687 -0
  47. package/resources/prompt-adaptation.d.mts.map +1 -0
  48. package/resources/prompt-adaptation.d.ts +687 -0
  49. package/resources/prompt-adaptation.d.ts.map +1 -0
  50. package/resources/prompt-adaptation.js +258 -0
  51. package/resources/prompt-adaptation.js.map +1 -0
  52. package/resources/prompt-adaptation.mjs +254 -0
  53. package/resources/prompt-adaptation.mjs.map +1 -0
  54. package/src/client.ts +37 -44
  55. package/src/resources/{pzn.ts → custom-router.ts} +17 -122
  56. package/src/resources/index.ts +14 -16
  57. package/src/resources/model-router.ts +5 -139
  58. package/src/resources/preferences.ts +3 -34
  59. package/src/resources/prompt-adaptation.ts +780 -0
  60. package/src/version.ts +1 -1
  61. package/version.d.mts +1 -1
  62. package/version.d.mts.map +1 -1
  63. package/version.d.ts +1 -1
  64. package/version.d.ts.map +1 -1
  65. package/version.js +1 -1
  66. package/version.js.map +1 -1
  67. package/version.mjs +1 -1
  68. package/version.mjs.map +1 -1
  69. package/resources/prompt/adapt.d.mts +0 -352
  70. package/resources/prompt/adapt.d.mts.map +0 -1
  71. package/resources/prompt/adapt.d.ts +0 -352
  72. package/resources/prompt/adapt.d.ts.map +0 -1
  73. package/resources/prompt/adapt.js +0 -154
  74. package/resources/prompt/adapt.js.map +0 -1
  75. package/resources/prompt/adapt.mjs +0 -150
  76. package/resources/prompt/adapt.mjs.map +0 -1
  77. package/resources/prompt/index.d.mts +0 -3
  78. package/resources/prompt/index.d.mts.map +0 -1
  79. package/resources/prompt/index.d.ts +0 -3
  80. package/resources/prompt/index.d.ts.map +0 -1
  81. package/resources/prompt/index.js +0 -9
  82. package/resources/prompt/index.js.map +0 -1
  83. package/resources/prompt/index.mjs +0 -4
  84. package/resources/prompt/index.mjs.map +0 -1
  85. package/resources/prompt/prompt.d.mts +0 -338
  86. package/resources/prompt/prompt.d.mts.map +0 -1
  87. package/resources/prompt/prompt.d.ts +0 -338
  88. package/resources/prompt/prompt.d.ts.map +0 -1
  89. package/resources/prompt/prompt.js +0 -128
  90. package/resources/prompt/prompt.js.map +0 -1
  91. package/resources/prompt/prompt.mjs +0 -123
  92. package/resources/prompt/prompt.mjs.map +0 -1
  93. package/resources/prompt.d.mts +0 -2
  94. package/resources/prompt.d.mts.map +0 -1
  95. package/resources/prompt.d.ts +0 -2
  96. package/resources/prompt.d.ts.map +0 -1
  97. package/resources/prompt.js +0 -6
  98. package/resources/prompt.js.map +0 -1
  99. package/resources/prompt.mjs +0 -3
  100. package/resources/prompt.mjs.map +0 -1
  101. package/resources/pzn.d.mts.map +0 -1
  102. package/resources/pzn.d.ts.map +0 -1
  103. package/resources/pzn.js.map +0 -1
  104. package/resources/pzn.mjs.map +0 -1
  105. package/resources/report/index.d.mts +0 -3
  106. package/resources/report/index.d.mts.map +0 -1
  107. package/resources/report/index.d.ts +0 -3
  108. package/resources/report/index.d.ts.map +0 -1
  109. package/resources/report/index.js +0 -9
  110. package/resources/report/index.js.map +0 -1
  111. package/resources/report/index.mjs +0 -4
  112. package/resources/report/index.mjs.map +0 -1
  113. package/resources/report/metrics.d.mts +0 -87
  114. package/resources/report/metrics.d.mts.map +0 -1
  115. package/resources/report/metrics.d.ts +0 -87
  116. package/resources/report/metrics.d.ts.map +0 -1
  117. package/resources/report/metrics.js +0 -57
  118. package/resources/report/metrics.js.map +0 -1
  119. package/resources/report/metrics.mjs +0 -53
  120. package/resources/report/metrics.mjs.map +0 -1
  121. package/resources/report/report.d.mts +0 -10
  122. package/resources/report/report.d.mts.map +0 -1
  123. package/resources/report/report.d.ts +0 -10
  124. package/resources/report/report.d.ts.map +0 -1
  125. package/resources/report/report.js +0 -17
  126. package/resources/report/report.js.map +0 -1
  127. package/resources/report/report.mjs +0 -12
  128. package/resources/report/report.mjs.map +0 -1
  129. package/resources/report.d.mts +0 -2
  130. package/resources/report.d.mts.map +0 -1
  131. package/resources/report.d.ts +0 -2
  132. package/resources/report.d.ts.map +0 -1
  133. package/resources/report.js +0 -6
  134. package/resources/report.js.map +0 -1
  135. package/resources/report.mjs +0 -3
  136. package/resources/report.mjs.map +0 -1
  137. package/src/resources/prompt/adapt.ts +0 -402
  138. package/src/resources/prompt/index.ts +0 -16
  139. package/src/resources/prompt/prompt.ts +0 -398
  140. package/src/resources/prompt.ts +0 -3
  141. package/src/resources/report/index.ts +0 -4
  142. package/src/resources/report/metrics.ts +0 -99
  143. package/src/resources/report/report.ts +0 -19
  144. package/src/resources/report.ts +0 -3
@@ -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,M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H,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,C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AAI,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"}
@@ -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. Submit feedback via the feedback endpoint to improve routing quality
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. Submit feedback on routing decisions via POST /v2/report/metrics/feedback
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 that learns from your feedback
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 PreferenceRetrieveResponse as PreferenceRetrieveResponse, type PreferenceUpdateResponse as PreferenceUpdateResponse, type PreferenceDeleteResponse as PreferenceDeleteResponse, type PreferenceCreateParams as PreferenceCreateParams, type PreferenceRetrieveParams as PreferenceRetrieveParams, type PreferenceUpdateParams as PreferenceUpdateParams, };
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;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAQzG;;;;;;;;;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,0BAA0B,GAAG,OAAO,CAAC;AAEjD,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAE/C,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAE/C,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IAEtB,IAAI,CAAC,EAAE,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