notdiamond 2.0.0-rc2 → 2.0.0-rc5

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 (167) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +14 -16
  3. package/client.d.mts +20 -34
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +20 -34
  6. package/client.d.ts.map +1 -1
  7. package/client.js +22 -38
  8. package/client.js.map +1 -1
  9. package/client.mjs +22 -38
  10. package/client.mjs.map +1 -1
  11. package/internal/tslib.js +17 -17
  12. package/internal/utils/env.d.mts.map +1 -1
  13. package/internal/utils/env.d.ts.map +1 -1
  14. package/internal/utils/env.js +4 -2
  15. package/internal/utils/env.js.map +1 -1
  16. package/internal/utils/env.mjs +4 -2
  17. package/internal/utils/env.mjs.map +1 -1
  18. package/package.json +10 -11
  19. package/resources/index.d.mts +6 -6
  20. package/resources/index.d.mts.map +1 -1
  21. package/resources/index.d.ts +6 -6
  22. package/resources/index.d.ts.map +1 -1
  23. package/resources/index.js +8 -8
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs +4 -4
  26. package/resources/index.mjs.map +1 -1
  27. package/resources/model-router.d.mts +311 -0
  28. package/resources/model-router.d.mts.map +1 -0
  29. package/resources/model-router.d.ts +311 -0
  30. package/resources/model-router.d.ts.map +1 -0
  31. package/resources/model-router.js +97 -0
  32. package/resources/model-router.js.map +1 -0
  33. package/resources/model-router.mjs +93 -0
  34. package/resources/model-router.mjs.map +1 -0
  35. package/resources/models.d.mts +50 -25
  36. package/resources/models.d.mts.map +1 -1
  37. package/resources/models.d.ts +50 -25
  38. package/resources/models.d.ts.map +1 -1
  39. package/resources/models.js +5 -0
  40. package/resources/models.js.map +1 -1
  41. package/resources/models.mjs +5 -0
  42. package/resources/models.mjs.map +1 -1
  43. package/resources/preferences.d.mts +49 -47
  44. package/resources/preferences.d.mts.map +1 -1
  45. package/resources/preferences.d.ts +49 -47
  46. package/resources/preferences.d.ts.map +1 -1
  47. package/resources/preferences.js +30 -33
  48. package/resources/preferences.js.map +1 -1
  49. package/resources/preferences.mjs +30 -33
  50. package/resources/preferences.mjs.map +1 -1
  51. package/resources/prompt/adapt.d.mts +352 -0
  52. package/resources/prompt/adapt.d.mts.map +1 -0
  53. package/resources/prompt/adapt.d.ts +352 -0
  54. package/resources/prompt/adapt.d.ts.map +1 -0
  55. package/resources/prompt/adapt.js +154 -0
  56. package/resources/prompt/adapt.js.map +1 -0
  57. package/resources/prompt/adapt.mjs +150 -0
  58. package/resources/prompt/adapt.mjs.map +1 -0
  59. package/resources/prompt/index.d.mts +3 -0
  60. package/resources/prompt/index.d.mts.map +1 -0
  61. package/resources/prompt/index.d.ts +3 -0
  62. package/resources/prompt/index.d.ts.map +1 -0
  63. package/resources/prompt/index.js +9 -0
  64. package/resources/prompt/index.js.map +1 -0
  65. package/resources/prompt/index.mjs +4 -0
  66. package/resources/prompt/index.mjs.map +1 -0
  67. package/resources/prompt/prompt.d.mts +338 -0
  68. package/resources/prompt/prompt.d.mts.map +1 -0
  69. package/resources/prompt/prompt.d.ts +338 -0
  70. package/resources/prompt/prompt.d.ts.map +1 -0
  71. package/resources/prompt/prompt.js +128 -0
  72. package/resources/prompt/prompt.js.map +1 -0
  73. package/resources/prompt/prompt.mjs +123 -0
  74. package/resources/prompt/prompt.mjs.map +1 -0
  75. package/resources/prompt.d.mts +2 -0
  76. package/resources/prompt.d.mts.map +1 -0
  77. package/resources/prompt.d.ts +2 -0
  78. package/resources/prompt.d.ts.map +1 -0
  79. package/resources/prompt.js +6 -0
  80. package/resources/prompt.js.map +1 -0
  81. package/resources/prompt.mjs +3 -0
  82. package/resources/prompt.mjs.map +1 -0
  83. package/resources/pzn.d.mts +225 -0
  84. package/resources/pzn.d.mts.map +1 -0
  85. package/resources/pzn.d.ts +225 -0
  86. package/resources/pzn.d.ts.map +1 -0
  87. package/resources/{routing.js → pzn.js} +26 -69
  88. package/resources/pzn.js.map +1 -0
  89. package/resources/{routing.mjs → pzn.mjs} +24 -67
  90. package/resources/pzn.mjs.map +1 -0
  91. package/resources/report/index.d.mts +3 -0
  92. package/resources/report/index.d.mts.map +1 -0
  93. package/resources/report/index.d.ts +3 -0
  94. package/resources/report/index.d.ts.map +1 -0
  95. package/resources/report/index.js +9 -0
  96. package/resources/report/index.js.map +1 -0
  97. package/resources/report/index.mjs +4 -0
  98. package/resources/report/index.mjs.map +1 -0
  99. package/resources/report/metrics.d.mts +87 -0
  100. package/resources/report/metrics.d.mts.map +1 -0
  101. package/resources/report/metrics.d.ts +87 -0
  102. package/resources/report/metrics.d.ts.map +1 -0
  103. package/resources/report/metrics.js +57 -0
  104. package/resources/report/metrics.js.map +1 -0
  105. package/resources/report/metrics.mjs +53 -0
  106. package/resources/report/metrics.mjs.map +1 -0
  107. package/resources/report/report.d.mts +10 -0
  108. package/resources/report/report.d.mts.map +1 -0
  109. package/resources/report/report.d.ts +10 -0
  110. package/resources/report/report.d.ts.map +1 -0
  111. package/resources/report/report.js +17 -0
  112. package/resources/report/report.js.map +1 -0
  113. package/resources/report/report.mjs +12 -0
  114. package/resources/report/report.mjs.map +1 -0
  115. package/resources/report.d.mts +1 -244
  116. package/resources/report.d.mts.map +1 -1
  117. package/resources/report.d.ts +1 -244
  118. package/resources/report.d.ts.map +1 -1
  119. package/resources/report.js +2 -82
  120. package/resources/report.js.map +1 -1
  121. package/resources/report.mjs +1 -80
  122. package/resources/report.mjs.map +1 -1
  123. package/src/client.ts +70 -119
  124. package/src/internal/utils/env.ts +4 -2
  125. package/src/resources/index.ts +24 -34
  126. package/src/resources/model-router.ts +356 -0
  127. package/src/resources/models.ts +55 -32
  128. package/src/resources/preferences.ts +61 -70
  129. package/src/resources/prompt/adapt.ts +402 -0
  130. package/src/resources/prompt/index.ts +16 -0
  131. package/src/resources/prompt/prompt.ts +398 -0
  132. package/src/resources/prompt.ts +3 -0
  133. package/src/resources/pzn.ts +273 -0
  134. package/src/resources/report/index.ts +4 -0
  135. package/src/resources/report/metrics.ts +99 -0
  136. package/src/resources/report/report.ts +19 -0
  137. package/src/resources/report.ts +1 -298
  138. package/src/version.ts +1 -1
  139. package/version.d.mts +1 -1
  140. package/version.d.ts +1 -1
  141. package/version.js +1 -1
  142. package/version.mjs +1 -1
  143. package/resources/admin.d.mts +0 -4
  144. package/resources/admin.d.mts.map +0 -1
  145. package/resources/admin.d.ts +0 -4
  146. package/resources/admin.d.ts.map +0 -1
  147. package/resources/admin.js +0 -9
  148. package/resources/admin.js.map +0 -1
  149. package/resources/admin.mjs +0 -5
  150. package/resources/admin.mjs.map +0 -1
  151. package/resources/prompt-adaptation.d.mts +0 -581
  152. package/resources/prompt-adaptation.d.mts.map +0 -1
  153. package/resources/prompt-adaptation.d.ts +0 -581
  154. package/resources/prompt-adaptation.d.ts.map +0 -1
  155. package/resources/prompt-adaptation.js +0 -289
  156. package/resources/prompt-adaptation.js.map +0 -1
  157. package/resources/prompt-adaptation.mjs +0 -285
  158. package/resources/prompt-adaptation.mjs.map +0 -1
  159. package/resources/routing.d.mts +0 -391
  160. package/resources/routing.d.mts.map +0 -1
  161. package/resources/routing.d.ts +0 -391
  162. package/resources/routing.d.ts.map +0 -1
  163. package/resources/routing.js.map +0 -1
  164. package/resources/routing.mjs.map +0 -1
  165. package/src/resources/admin.ts +0 -5
  166. package/src/resources/prompt-adaptation.ts +0 -707
  167. package/src/resources/routing.ts +0 -476
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0-rc5 (2025-11-06)
4
+
5
+ Full Changelog: [v2.0.0-rc4...v2.0.0-rc5](https://github.com/Not-Diamond/not-diamond-typescript/compare/v2.0.0-rc4...v2.0.0-rc5)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([92ec1c6](https://github.com/Not-Diamond/not-diamond-typescript/commit/92ec1c69f2c5de881cdc36790aa84bcf568eae70))
10
+
11
+ ## 2.0.0-rc4 (2025-11-05)
12
+
13
+ Full Changelog: [v2.0.0-rc3...v2.0.0-rc4](https://github.com/Not-Diamond/not-diamond-typescript/compare/v2.0.0-rc3...v2.0.0-rc4)
14
+
15
+ ### Features
16
+
17
+ * **api:** manual updates ([dd4e78c](https://github.com/Not-Diamond/not-diamond-typescript/commit/dd4e78c59a3b8d07613b72e33cf0e414b62d7e30))
18
+
19
+
20
+ ### Chores
21
+
22
+ * update SDK settings ([42a98d0](https://github.com/Not-Diamond/not-diamond-typescript/commit/42a98d0699147509d025e232ad05ed97e6fa9ed3))
23
+
24
+ ## 2.0.0-rc3 (2025-11-05)
25
+
26
+ Full Changelog: [v2.0.0-rc2...v2.0.0-rc3](https://github.com/Not-Diamond/not-diamond-typescript/compare/v2.0.0-rc2...v2.0.0-rc3)
27
+
28
+ ### Features
29
+
30
+ * **api:** api update ([d087c64](https://github.com/Not-Diamond/not-diamond-typescript/commit/d087c6421949701acada35f89a1a8d009b581194))
31
+ * **api:** api update ([e431f34](https://github.com/Not-Diamond/not-diamond-typescript/commit/e431f343b558579f7940eacaef5d4f4b3656398f))
32
+ * **api:** api update ([8e6ad30](https://github.com/Not-Diamond/not-diamond-typescript/commit/8e6ad303485025b04622fcaf8d92686581fcc2a7))
33
+ * **api:** enable tests ([d94af20](https://github.com/Not-Diamond/not-diamond-typescript/commit/d94af20e2963644a0034fe1b60a7febf140b204f))
34
+ * **api:** manual updates ([20adad9](https://github.com/Not-Diamond/not-diamond-typescript/commit/20adad9ab8f778b3a8599c41cd91734b2c556614))
35
+ * **api:** regen docs ([ba39a05](https://github.com/Not-Diamond/not-diamond-typescript/commit/ba39a05f842dac7d5eb5153192ec08c3d87bf79f))
36
+ * **api:** verify mock tests enabled ([dcfbb6b](https://github.com/Not-Diamond/not-diamond-typescript/commit/dcfbb6b47900690ea531c510387b7e0392e23abb))
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * **env:** handle empty environment variable values ([8360f59](https://github.com/Not-Diamond/not-diamond-typescript/commit/8360f59232e1887a1c6560a6195846c1c45f66e9))
42
+
43
+
44
+ ### Chores
45
+
46
+ * update SDK settings ([259c1ab](https://github.com/Not-Diamond/not-diamond-typescript/commit/259c1ab15d0c4d8bb1700ffa79fc24481ac4a4ae))
47
+
3
48
  ## 2.0.0-rc2 (2025-10-31)
4
49
 
5
50
  Full Changelog: [v2.0.0-rc1...v2.0.0-rc2](https://github.com/Not-Diamond/not-diamond-typescript/compare/v2.0.0-rc1...v2.0.0-rc2)
package/README.md CHANGED
@@ -24,10 +24,9 @@ import NotDiamond from 'notdiamond';
24
24
 
25
25
  const client = new NotDiamond({
26
26
  apiKey: process.env['NOT_DIAMOND_API_KEY'], // This is the default and can be omitted
27
- environment: 'staging', // defaults to 'production'
28
27
  });
29
28
 
30
- const response = await client.routing.selectModel({
29
+ const response = await client.modelRouter.selectModel({
31
30
  llm_providers: [
32
31
  { model: 'gpt-4o', provider: 'openai' },
33
32
  { model: 'claude-sonnet-4-5-20250929', provider: 'anthropic' },
@@ -52,10 +51,9 @@ import NotDiamond from 'notdiamond';
52
51
 
53
52
  const client = new NotDiamond({
54
53
  apiKey: process.env['NOT_DIAMOND_API_KEY'], // This is the default and can be omitted
55
- environment: 'staging', // defaults to 'production'
56
54
  });
57
55
 
58
- const params: NotDiamond.RoutingSelectModelParams = {
56
+ const params: NotDiamond.ModelRouterSelectModelParams = {
59
57
  llm_providers: [
60
58
  { model: 'gpt-4o', provider: 'openai' },
61
59
  { model: 'claude-sonnet-4-5-20250929', provider: 'anthropic' },
@@ -66,7 +64,7 @@ const params: NotDiamond.RoutingSelectModelParams = {
66
64
  { role: 'user', content: 'Explain quantum computing in simple terms' },
67
65
  ],
68
66
  };
69
- const response: NotDiamond.RoutingSelectModelResponse = await client.routing.selectModel(params);
67
+ const response: NotDiamond.ModelRouterSelectModelResponse = await client.modelRouter.selectModel(params);
70
68
  ```
71
69
 
72
70
  Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -87,7 +85,7 @@ import NotDiamond, { toFile } from 'notdiamond';
87
85
  const client = new NotDiamond();
88
86
 
89
87
  // If you have access to Node `fs` we recommend using `fs.createReadStream()`:
90
- await client.routing.createSurveyResponse({
88
+ await client.pzn.submitSurveyResponse({
91
89
  constraint_priorities: 'constraint_priorities',
92
90
  email: 'email',
93
91
  llm_providers: 'llm_providers',
@@ -98,7 +96,7 @@ await client.routing.createSurveyResponse({
98
96
  });
99
97
 
100
98
  // Or if you have the web `File` API you can pass a `File` instance:
101
- await client.routing.createSurveyResponse({
99
+ await client.pzn.submitSurveyResponse({
102
100
  constraint_priorities: 'constraint_priorities',
103
101
  email: 'email',
104
102
  llm_providers: 'llm_providers',
@@ -109,7 +107,7 @@ await client.routing.createSurveyResponse({
109
107
  });
110
108
 
111
109
  // You can also pass a `fetch` `Response`:
112
- await client.routing.createSurveyResponse({
110
+ await client.pzn.submitSurveyResponse({
113
111
  constraint_priorities: 'constraint_priorities',
114
112
  email: 'email',
115
113
  llm_providers: 'llm_providers',
@@ -120,7 +118,7 @@ await client.routing.createSurveyResponse({
120
118
  });
121
119
 
122
120
  // Finally, if none of the above are convenient, you can use our `toFile` helper:
123
- await client.routing.createSurveyResponse({
121
+ await client.pzn.submitSurveyResponse({
124
122
  constraint_priorities: 'constraint_priorities',
125
123
  email: 'email',
126
124
  llm_providers: 'llm_providers',
@@ -129,7 +127,7 @@ await client.routing.createSurveyResponse({
129
127
  'x-token': 'x-token',
130
128
  dataset_file: await toFile(Buffer.from('my bytes'), 'file'),
131
129
  });
132
- await client.routing.createSurveyResponse({
130
+ await client.pzn.submitSurveyResponse({
133
131
  constraint_priorities: 'constraint_priorities',
134
132
  email: 'email',
135
133
  llm_providers: 'llm_providers',
@@ -148,7 +146,7 @@ a subclass of `APIError` will be thrown:
148
146
 
149
147
  <!-- prettier-ignore -->
150
148
  ```ts
151
- const response = await client.routing
149
+ const response = await client.modelRouter
152
150
  .selectModel({
153
151
  llm_providers: [
154
152
  { model: 'gpt-4o', provider: 'openai' },
@@ -200,7 +198,7 @@ const client = new NotDiamond({
200
198
  });
201
199
 
202
200
  // Or, configure per-request:
203
- await client.routing.selectModel({ llm_providers: [{ model: 'gpt-4o', provider: 'openai' }, { model: 'claude-sonnet-4-5-20250929', provider: 'anthropic' }, { model: 'gemini-1.5-pro', provider: 'google' }], messages: [{ role: 'system', content: 'You are a helpful assistant.' }, { role: 'user', content: 'Explain quantum computing in simple terms' }] }, {
201
+ await client.modelRouter.selectModel({ llm_providers: [{ model: 'gpt-4o', provider: 'openai' }, { model: 'claude-sonnet-4-5-20250929', provider: 'anthropic' }, { model: 'gemini-1.5-pro', provider: 'google' }], messages: [{ role: 'system', content: 'You are a helpful assistant.' }, { role: 'user', content: 'Explain quantum computing in simple terms' }] }, {
204
202
  maxRetries: 5,
205
203
  });
206
204
  ```
@@ -217,7 +215,7 @@ const client = new NotDiamond({
217
215
  });
218
216
 
219
217
  // Override per-request:
220
- await client.routing.selectModel({ llm_providers: [{ model: 'gpt-4o', provider: 'openai' }, { model: 'claude-sonnet-4-5-20250929', provider: 'anthropic' }, { model: 'gemini-1.5-pro', provider: 'google' }], messages: [{ role: 'system', content: 'You are a helpful assistant.' }, { role: 'user', content: 'Explain quantum computing in simple terms' }] }, {
218
+ await client.modelRouter.selectModel({ llm_providers: [{ model: 'gpt-4o', provider: 'openai' }, { model: 'claude-sonnet-4-5-20250929', provider: 'anthropic' }, { model: 'gemini-1.5-pro', provider: 'google' }], messages: [{ role: 'system', content: 'You are a helpful assistant.' }, { role: 'user', content: 'Explain quantum computing in simple terms' }] }, {
221
219
  timeout: 5 * 1000,
222
220
  });
223
221
  ```
@@ -240,7 +238,7 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
240
238
  ```ts
241
239
  const client = new NotDiamond();
242
240
 
243
- const response = await client.routing
241
+ const response = await client.modelRouter
244
242
  .selectModel({
245
243
  llm_providers: [
246
244
  { model: 'gpt-4o', provider: 'openai' },
@@ -256,7 +254,7 @@ const response = await client.routing
256
254
  console.log(response.headers.get('X-My-Header'));
257
255
  console.log(response.statusText); // access the underlying Response object
258
256
 
259
- const { data: response, response: raw } = await client.routing
257
+ const { data: response, response: raw } = await client.modelRouter
260
258
  .selectModel({
261
259
  llm_providers: [
262
260
  { model: 'gpt-4o', provider: 'openai' },
@@ -350,7 +348,7 @@ parameter. This library doesn't validate at runtime that the request matches the
350
348
  send will be sent as-is.
351
349
 
352
350
  ```ts
353
- client.routing.selectModel({
351
+ client.modelRouter.selectModel({
354
352
  // ...
355
353
  // @ts-expect-error baz is not yet public
356
354
  baz: 'undocumented option',
package/client.d.mts CHANGED
@@ -6,34 +6,21 @@ import * as Errors from "./core/error.mjs";
6
6
  import * as Uploads from "./core/uploads.mjs";
7
7
  import * as API from "./resources/index.mjs";
8
8
  import { APIPromise } from "./core/api-promise.mjs";
9
- import { Admin } from "./resources/admin.mjs";
10
- import { ModelListParams, ModelListResponse, Models } from "./resources/models.mjs";
11
- import { PreferenceCreateUserPreferenceParams, PreferenceCreateUserPreferenceResponse, PreferenceDeleteUserPreferenceResponse, PreferenceRetrieveParams, PreferenceRetrieveResponse, PreferenceUpdateUserPreferenceParams, PreferenceUpdateUserPreferenceResponse, Preferences } from "./resources/preferences.mjs";
12
- import { AdaptationRunResults, JobStatus, PromptAdaptation, PromptAdaptationAdaptParams, PromptAdaptationAdaptResponse, PromptAdaptationGetAdaptRunResultsParams, PromptAdaptationGetAdaptRunsParams, PromptAdaptationGetAdaptRunsResponse, PromptAdaptationGetAdaptStatusResponse, PromptAdaptationRetrieveCostsResponse } from "./resources/prompt-adaptation.mjs";
13
- import { Report, ReportEvaluateHallucinationParams, ReportEvaluateHallucinationResponse, ReportLatencyParams, ReportLatencyResponse, ReportSubmitFeedbackParams, ReportSubmitFeedbackResponse } from "./resources/report.mjs";
14
- import { Routing, RoutingCreateSurveyResponseParams, RoutingCreateSurveyResponseResponse, RoutingSelectModelParams, RoutingSelectModelResponse, RoutingTrainCustomRouterParams, RoutingTrainCustomRouterResponse } from "./resources/routing.mjs";
9
+ import { ModelRouter, ModelRouterOpenHandsSelectParams, ModelRouterOpenHandsSelectResponse, ModelRouterSelectModelParams, ModelRouterSelectModelResponse } from "./resources/model-router.mjs";
10
+ import { Model, ModelListParams, ModelListResponse, Models } from "./resources/models.mjs";
11
+ import { PreferenceCreateParams, PreferenceCreateResponse, PreferenceDeleteResponse, PreferenceRetrieveParams, PreferenceRetrieveResponse, PreferenceUpdateParams, PreferenceUpdateResponse, Preferences } from "./resources/preferences.mjs";
12
+ import { Pzn, PznSubmitSurveyResponseParams, PznSubmitSurveyResponseResponse, PznTrainCustomRouterParams, PznTrainCustomRouterResponse } from "./resources/pzn.mjs";
13
+ import { JobStatus, Prompt, PromptGetAdaptResultsResponse, PromptGetAdaptStatusResponse } from "./resources/prompt/prompt.mjs";
14
+ import { Report } from "./resources/report/report.mjs";
15
15
  import { type Fetch } from "./internal/builtin-types.mjs";
16
16
  import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
17
17
  import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
18
18
  import { type LogLevel, type Logger } from "./internal/utils/log.mjs";
19
- declare const environments: {
20
- production: string;
21
- staging: string;
22
- };
23
- type Environment = keyof typeof environments;
24
19
  export interface ClientOptions {
25
20
  /**
26
- * Defaults to process.env['NOT_DIAMOND_API_KEY'].
21
+ * API key authentication using Bearer token
27
22
  */
28
- apiKey?: string | null | undefined;
29
- /**
30
- * Specifies the environment to use for the API.
31
- *
32
- * Each environment maps to a different base URL:
33
- * - `production` corresponds to `https://api.notdiamond.ai`
34
- * - `staging` corresponds to `https://staging-api.notdiamond.ai`
35
- */
36
- environment?: Environment | undefined;
23
+ apiKey?: string | undefined;
37
24
  /**
38
25
  * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
39
26
  *
@@ -100,7 +87,7 @@ export interface ClientOptions {
100
87
  */
101
88
  export declare class NotDiamond {
102
89
  #private;
103
- apiKey: string | null;
90
+ apiKey: string;
104
91
  baseURL: string;
105
92
  maxRetries: number;
106
93
  timeout: number;
@@ -113,8 +100,7 @@ export declare class NotDiamond {
113
100
  /**
114
101
  * API Client for interfacing with the Not Diamond API.
115
102
  *
116
- * @param {string | null | undefined} [opts.apiKey=process.env['NOT_DIAMOND_API_KEY'] ?? null]
117
- * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
103
+ * @param {string | undefined} [opts.apiKey=process.env['NOT_DIAMOND_API_KEY'] ?? undefined]
118
104
  * @param {string} [opts.baseURL=process.env['NOT_DIAMOND_BASE_URL'] ?? https://api.notdiamond.ai] - Override the default base URL for the API.
119
105
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
120
106
  * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
@@ -187,20 +173,20 @@ export declare class NotDiamond {
187
173
  static PermissionDeniedError: typeof Errors.PermissionDeniedError;
188
174
  static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
189
175
  static toFile: typeof Uploads.toFile;
190
- routing: API.Routing;
191
- preferences: API.Preferences;
192
- promptAdaptation: API.PromptAdaptation;
176
+ modelRouter: API.ModelRouter;
193
177
  report: API.Report;
178
+ preferences: API.Preferences;
179
+ prompt: API.Prompt;
180
+ pzn: API.Pzn;
194
181
  models: API.Models;
195
- admin: API.Admin;
196
182
  }
197
183
  export declare namespace NotDiamond {
198
184
  export type RequestOptions = Opts.RequestOptions;
199
- export { Routing as Routing, type RoutingCreateSurveyResponseResponse as RoutingCreateSurveyResponseResponse, type RoutingSelectModelResponse as RoutingSelectModelResponse, type RoutingTrainCustomRouterResponse as RoutingTrainCustomRouterResponse, type RoutingCreateSurveyResponseParams as RoutingCreateSurveyResponseParams, type RoutingSelectModelParams as RoutingSelectModelParams, type RoutingTrainCustomRouterParams as RoutingTrainCustomRouterParams, };
200
- export { Preferences as Preferences, type PreferenceRetrieveResponse as PreferenceRetrieveResponse, type PreferenceCreateUserPreferenceResponse as PreferenceCreateUserPreferenceResponse, type PreferenceDeleteUserPreferenceResponse as PreferenceDeleteUserPreferenceResponse, type PreferenceUpdateUserPreferenceResponse as PreferenceUpdateUserPreferenceResponse, type PreferenceRetrieveParams as PreferenceRetrieveParams, type PreferenceCreateUserPreferenceParams as PreferenceCreateUserPreferenceParams, type PreferenceUpdateUserPreferenceParams as PreferenceUpdateUserPreferenceParams, };
201
- export { PromptAdaptation as PromptAdaptation, type AdaptationRunResults as AdaptationRunResults, type JobStatus as JobStatus, type PromptAdaptationAdaptResponse as PromptAdaptationAdaptResponse, type PromptAdaptationGetAdaptRunsResponse as PromptAdaptationGetAdaptRunsResponse, type PromptAdaptationGetAdaptStatusResponse as PromptAdaptationGetAdaptStatusResponse, type PromptAdaptationRetrieveCostsResponse as PromptAdaptationRetrieveCostsResponse, type PromptAdaptationAdaptParams as PromptAdaptationAdaptParams, type PromptAdaptationGetAdaptRunResultsParams as PromptAdaptationGetAdaptRunResultsParams, type PromptAdaptationGetAdaptRunsParams as PromptAdaptationGetAdaptRunsParams, };
202
- export { Report as Report, type ReportEvaluateHallucinationResponse as ReportEvaluateHallucinationResponse, type ReportLatencyResponse as ReportLatencyResponse, type ReportSubmitFeedbackResponse as ReportSubmitFeedbackResponse, type ReportEvaluateHallucinationParams as ReportEvaluateHallucinationParams, type ReportLatencyParams as ReportLatencyParams, type ReportSubmitFeedbackParams as ReportSubmitFeedbackParams, };
203
- export { Models as Models, type ModelListResponse as ModelListResponse, type ModelListParams as ModelListParams, };
204
- export { Admin as Admin };
185
+ export { ModelRouter as ModelRouter, type ModelRouterOpenHandsSelectResponse as ModelRouterOpenHandsSelectResponse, type ModelRouterSelectModelResponse as ModelRouterSelectModelResponse, type ModelRouterOpenHandsSelectParams as ModelRouterOpenHandsSelectParams, type ModelRouterSelectModelParams as ModelRouterSelectModelParams, };
186
+ export { Report as Report };
187
+ export { Preferences as Preferences, 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, };
188
+ export { Prompt as Prompt, type JobStatus as JobStatus, type PromptGetAdaptResultsResponse as PromptGetAdaptResultsResponse, type PromptGetAdaptStatusResponse as PromptGetAdaptStatusResponse, };
189
+ export { Pzn as Pzn, type PznSubmitSurveyResponseResponse as PznSubmitSurveyResponseResponse, type PznTrainCustomRouterResponse as PznTrainCustomRouterResponse, type PznSubmitSurveyResponseParams as PznSubmitSurveyResponseParams, type PznTrainCustomRouterParams as PznTrainCustomRouterParams, };
190
+ export { Models as Models, type Model as Model, type ModelListResponse as ModelListResponse, type ModelListParams as ModelListParams, };
205
191
  }
206
192
  //# sourceMappingURL=client.d.mts.map
package/client.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAGT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,EAAE;OACT,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,EAAE;OAC9C,EACL,oCAAoC,EACpC,sCAAsC,EACtC,sCAAsC,EACtC,wBAAwB,EACxB,0BAA0B,EAC1B,oCAAoC,EACpC,sCAAsC,EACtC,WAAW,EACZ;OACM,EACL,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,2BAA2B,EAC3B,6BAA6B,EAC7B,wCAAwC,EACxC,kCAAkC,EAClC,oCAAoC,EACpC,sCAAsC,EACtC,qCAAqC,EACtC;OACM,EACL,MAAM,E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wB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;IAEF,OAAO,EACL,GAAG,IAAI,GAAG,EACV,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
package/client.d.ts CHANGED
@@ -6,34 +6,21 @@ import * as Errors from "./core/error.js";
6
6
  import * as Uploads from "./core/uploads.js";
7
7
  import * as API from "./resources/index.js";
8
8
  import { APIPromise } from "./core/api-promise.js";
9
- import { Admin } from "./resources/admin.js";
10
- import { ModelListParams, ModelListResponse, Models } from "./resources/models.js";
11
- import { PreferenceCreateUserPreferenceParams, PreferenceCreateUserPreferenceResponse, PreferenceDeleteUserPreferenceResponse, PreferenceRetrieveParams, PreferenceRetrieveResponse, PreferenceUpdateUserPreferenceParams, PreferenceUpdateUserPreferenceResponse, Preferences } from "./resources/preferences.js";
12
- import { AdaptationRunResults, JobStatus, PromptAdaptation, PromptAdaptationAdaptParams, PromptAdaptationAdaptResponse, PromptAdaptationGetAdaptRunResultsParams, PromptAdaptationGetAdaptRunsParams, PromptAdaptationGetAdaptRunsResponse, PromptAdaptationGetAdaptStatusResponse, PromptAdaptationRetrieveCostsResponse } from "./resources/prompt-adaptation.js";
13
- import { Report, ReportEvaluateHallucinationParams, ReportEvaluateHallucinationResponse, ReportLatencyParams, ReportLatencyResponse, ReportSubmitFeedbackParams, ReportSubmitFeedbackResponse } from "./resources/report.js";
14
- import { Routing, RoutingCreateSurveyResponseParams, RoutingCreateSurveyResponseResponse, RoutingSelectModelParams, RoutingSelectModelResponse, RoutingTrainCustomRouterParams, RoutingTrainCustomRouterResponse } from "./resources/routing.js";
9
+ import { ModelRouter, ModelRouterOpenHandsSelectParams, ModelRouterOpenHandsSelectResponse, ModelRouterSelectModelParams, ModelRouterSelectModelResponse } from "./resources/model-router.js";
10
+ import { Model, ModelListParams, ModelListResponse, Models } from "./resources/models.js";
11
+ import { PreferenceCreateParams, PreferenceCreateResponse, PreferenceDeleteResponse, PreferenceRetrieveParams, PreferenceRetrieveResponse, PreferenceUpdateParams, PreferenceUpdateResponse, Preferences } from "./resources/preferences.js";
12
+ import { Pzn, PznSubmitSurveyResponseParams, PznSubmitSurveyResponseResponse, PznTrainCustomRouterParams, PznTrainCustomRouterResponse } from "./resources/pzn.js";
13
+ import { JobStatus, Prompt, PromptGetAdaptResultsResponse, PromptGetAdaptStatusResponse } from "./resources/prompt/prompt.js";
14
+ import { Report } from "./resources/report/report.js";
15
15
  import { type Fetch } from "./internal/builtin-types.js";
16
16
  import { HeadersLike, NullableHeaders } from "./internal/headers.js";
17
17
  import { FinalRequestOptions, RequestOptions } from "./internal/request-options.js";
18
18
  import { type LogLevel, type Logger } from "./internal/utils/log.js";
19
- declare const environments: {
20
- production: string;
21
- staging: string;
22
- };
23
- type Environment = keyof typeof environments;
24
19
  export interface ClientOptions {
25
20
  /**
26
- * Defaults to process.env['NOT_DIAMOND_API_KEY'].
21
+ * API key authentication using Bearer token
27
22
  */
28
- apiKey?: string | null | undefined;
29
- /**
30
- * Specifies the environment to use for the API.
31
- *
32
- * Each environment maps to a different base URL:
33
- * - `production` corresponds to `https://api.notdiamond.ai`
34
- * - `staging` corresponds to `https://staging-api.notdiamond.ai`
35
- */
36
- environment?: Environment | undefined;
23
+ apiKey?: string | undefined;
37
24
  /**
38
25
  * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
39
26
  *
@@ -100,7 +87,7 @@ export interface ClientOptions {
100
87
  */
101
88
  export declare class NotDiamond {
102
89
  #private;
103
- apiKey: string | null;
90
+ apiKey: string;
104
91
  baseURL: string;
105
92
  maxRetries: number;
106
93
  timeout: number;
@@ -113,8 +100,7 @@ export declare class NotDiamond {
113
100
  /**
114
101
  * API Client for interfacing with the Not Diamond API.
115
102
  *
116
- * @param {string | null | undefined} [opts.apiKey=process.env['NOT_DIAMOND_API_KEY'] ?? null]
117
- * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
103
+ * @param {string | undefined} [opts.apiKey=process.env['NOT_DIAMOND_API_KEY'] ?? undefined]
118
104
  * @param {string} [opts.baseURL=process.env['NOT_DIAMOND_BASE_URL'] ?? https://api.notdiamond.ai] - Override the default base URL for the API.
119
105
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
120
106
  * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
@@ -187,20 +173,20 @@ export declare class NotDiamond {
187
173
  static PermissionDeniedError: typeof Errors.PermissionDeniedError;
188
174
  static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
189
175
  static toFile: typeof Uploads.toFile;
190
- routing: API.Routing;
191
- preferences: API.Preferences;
192
- promptAdaptation: API.PromptAdaptation;
176
+ modelRouter: API.ModelRouter;
193
177
  report: API.Report;
178
+ preferences: API.Preferences;
179
+ prompt: API.Prompt;
180
+ pzn: API.Pzn;
194
181
  models: API.Models;
195
- admin: API.Admin;
196
182
  }
197
183
  export declare namespace NotDiamond {
198
184
  export type RequestOptions = Opts.RequestOptions;
199
- export { Routing as Routing, type RoutingCreateSurveyResponseResponse as RoutingCreateSurveyResponseResponse, type RoutingSelectModelResponse as RoutingSelectModelResponse, type RoutingTrainCustomRouterResponse as RoutingTrainCustomRouterResponse, type RoutingCreateSurveyResponseParams as RoutingCreateSurveyResponseParams, type RoutingSelectModelParams as RoutingSelectModelParams, type RoutingTrainCustomRouterParams as RoutingTrainCustomRouterParams, };
200
- export { Preferences as Preferences, type PreferenceRetrieveResponse as PreferenceRetrieveResponse, type PreferenceCreateUserPreferenceResponse as PreferenceCreateUserPreferenceResponse, type PreferenceDeleteUserPreferenceResponse as PreferenceDeleteUserPreferenceResponse, type PreferenceUpdateUserPreferenceResponse as PreferenceUpdateUserPreferenceResponse, type PreferenceRetrieveParams as PreferenceRetrieveParams, type PreferenceCreateUserPreferenceParams as PreferenceCreateUserPreferenceParams, type PreferenceUpdateUserPreferenceParams as PreferenceUpdateUserPreferenceParams, };
201
- export { PromptAdaptation as PromptAdaptation, type AdaptationRunResults as AdaptationRunResults, type JobStatus as JobStatus, type PromptAdaptationAdaptResponse as PromptAdaptationAdaptResponse, type PromptAdaptationGetAdaptRunsResponse as PromptAdaptationGetAdaptRunsResponse, type PromptAdaptationGetAdaptStatusResponse as PromptAdaptationGetAdaptStatusResponse, type PromptAdaptationRetrieveCostsResponse as PromptAdaptationRetrieveCostsResponse, type PromptAdaptationAdaptParams as PromptAdaptationAdaptParams, type PromptAdaptationGetAdaptRunResultsParams as PromptAdaptationGetAdaptRunResultsParams, type PromptAdaptationGetAdaptRunsParams as PromptAdaptationGetAdaptRunsParams, };
202
- export { Report as Report, type ReportEvaluateHallucinationResponse as ReportEvaluateHallucinationResponse, type ReportLatencyResponse as ReportLatencyResponse, type ReportSubmitFeedbackResponse as ReportSubmitFeedbackResponse, type ReportEvaluateHallucinationParams as ReportEvaluateHallucinationParams, type ReportLatencyParams as ReportLatencyParams, type ReportSubmitFeedbackParams as ReportSubmitFeedbackParams, };
203
- export { Models as Models, type ModelListResponse as ModelListResponse, type ModelListParams as ModelListParams, };
204
- export { Admin as Admin };
185
+ export { ModelRouter as ModelRouter, type ModelRouterOpenHandsSelectResponse as ModelRouterOpenHandsSelectResponse, type ModelRouterSelectModelResponse as ModelRouterSelectModelResponse, type ModelRouterOpenHandsSelectParams as ModelRouterOpenHandsSelectParams, type ModelRouterSelectModelParams as ModelRouterSelectModelParams, };
186
+ export { Report as Report };
187
+ export { Preferences as Preferences, 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, };
188
+ export { Prompt as Prompt, type JobStatus as JobStatus, type PromptGetAdaptResultsResponse as PromptGetAdaptResultsResponse, type PromptGetAdaptStatusResponse as PromptGetAdaptStatusResponse, };
189
+ export { Pzn as Pzn, type PznSubmitSurveyResponseResponse as PznSubmitSurveyResponseResponse, type PznTrainCustomRouterResponse as PznTrainCustomRouterResponse, type PznSubmitSurveyResponseParams as PznSubmitSurveyResponseParams, type PznTrainCustomRouterParams as PznTrainCustomRouterParams, };
190
+ export { Models as Models, type Model as Model, type ModelListResponse as ModelListResponse, type ModelListParams as ModelListParams, };
205
191
  }
206
192
  //# sourceMappingURL=client.d.ts.map
package/client.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAGT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,EAAE;OACT,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,EAAE;OAC9C,EACL,oCAAoC,EACpC,sCAAsC,EACtC,sCAAsC,EACtC,wBAAwB,EACxB,0BAA0B,EAC1B,oCAAoC,EACpC,sCAAsC,EACtC,WAAW,EACZ;OACM,EACL,oBAAoB,E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AAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;IAEF,OAAO,EACL,GAAG,IAAI,GAAG,EACV,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
package/client.js CHANGED
@@ -17,20 +17,16 @@ const Errors = tslib_1.__importStar(require("./core/error.js"));
17
17
  const Uploads = tslib_1.__importStar(require("./core/uploads.js"));
18
18
  const API = tslib_1.__importStar(require("./resources/index.js"));
19
19
  const api_promise_1 = require("./core/api-promise.js");
20
- const admin_1 = require("./resources/admin.js");
20
+ const model_router_1 = require("./resources/model-router.js");
21
21
  const models_1 = require("./resources/models.js");
22
22
  const preferences_1 = require("./resources/preferences.js");
23
- const prompt_adaptation_1 = require("./resources/prompt-adaptation.js");
24
- const report_1 = require("./resources/report.js");
25
- const routing_1 = require("./resources/routing.js");
23
+ const pzn_1 = require("./resources/pzn.js");
24
+ const prompt_1 = require("./resources/prompt/prompt.js");
25
+ const report_1 = require("./resources/report/report.js");
26
26
  const headers_1 = require("./internal/headers.js");
27
27
  const env_1 = require("./internal/utils/env.js");
28
28
  const log_1 = require("./internal/utils/log.js");
29
29
  const values_2 = require("./internal/utils/values.js");
30
- const environments = {
31
- production: 'https://api.notdiamond.ai',
32
- staging: 'https://staging-api.notdiamond.ai',
33
- };
34
30
  /**
35
31
  * API Client for interfacing with the Not Diamond API.
36
32
  */
@@ -38,8 +34,7 @@ class NotDiamond {
38
34
  /**
39
35
  * API Client for interfacing with the Not Diamond API.
40
36
  *
41
- * @param {string | null | undefined} [opts.apiKey=process.env['NOT_DIAMOND_API_KEY'] ?? null]
42
- * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
37
+ * @param {string | undefined} [opts.apiKey=process.env['NOT_DIAMOND_API_KEY'] ?? undefined]
43
38
  * @param {string} [opts.baseURL=process.env['NOT_DIAMOND_BASE_URL'] ?? https://api.notdiamond.ai] - Override the default base URL for the API.
44
39
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
45
40
  * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
@@ -48,25 +43,24 @@ class NotDiamond {
48
43
  * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
49
44
  * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
50
45
  */
51
- constructor({ baseURL = (0, env_1.readEnv)('NOT_DIAMOND_BASE_URL'), apiKey = (0, env_1.readEnv)('NOT_DIAMOND_API_KEY') ?? null, ...opts } = {}) {
46
+ constructor({ baseURL = (0, env_1.readEnv)('NOT_DIAMOND_BASE_URL'), apiKey = (0, env_1.readEnv)('NOT_DIAMOND_API_KEY'), ...opts } = {}) {
52
47
  _NotDiamond_instances.add(this);
53
48
  _NotDiamond_encoder.set(this, void 0);
54
- this.routing = new API.Routing(this);
55
- this.preferences = new API.Preferences(this);
56
- this.promptAdaptation = new API.PromptAdaptation(this);
49
+ this.modelRouter = new API.ModelRouter(this);
57
50
  this.report = new API.Report(this);
51
+ this.preferences = new API.Preferences(this);
52
+ this.prompt = new API.Prompt(this);
53
+ this.pzn = new API.Pzn(this);
58
54
  this.models = new API.Models(this);
59
- this.admin = new API.Admin(this);
55
+ if (apiKey === undefined) {
56
+ throw new Errors.NotDiamondError("The NOT_DIAMOND_API_KEY environment variable is missing or empty; either provide it, or instantiate the NotDiamond client with an apiKey option, like new NotDiamond({ apiKey: 'My API Key' }).");
57
+ }
60
58
  const options = {
61
59
  apiKey,
62
60
  ...opts,
63
- baseURL,
64
- environment: opts.environment ?? 'production',
61
+ baseURL: baseURL || `https://api.notdiamond.ai`,
65
62
  };
66
- if (baseURL && opts.environment) {
67
- throw new Errors.NotDiamondError('Ambiguous URL; The `baseURL` option (or NOT_DIAMOND_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null');
68
- }
69
- this.baseURL = options.baseURL || environments[options.environment || 'production'];
63
+ this.baseURL = options.baseURL;
70
64
  this.timeout = options.timeout ?? _a.DEFAULT_TIMEOUT /* 1 minute */;
71
65
  this.logger = options.logger ?? console;
72
66
  const defaultLogLevel = 'warn';
@@ -89,8 +83,7 @@ class NotDiamond {
89
83
  withOptions(options) {
90
84
  const client = new this.constructor({
91
85
  ...this._options,
92
- environment: options.environment ? options.environment : undefined,
93
- baseURL: options.environment ? undefined : this.baseURL,
86
+ baseURL: this.baseURL,
94
87
  maxRetries: this.maxRetries,
95
88
  timeout: this.timeout,
96
89
  logger: this.logger,
@@ -106,18 +99,9 @@ class NotDiamond {
106
99
  return this._options.defaultQuery;
107
100
  }
108
101
  validateHeaders({ values, nulls }) {
109
- if (this.apiKey && values.get('authorization')) {
110
- return;
111
- }
112
- if (nulls.has('authorization')) {
113
- return;
114
- }
115
- throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "Authorization" headers to be explicitly omitted');
102
+ return;
116
103
  }
117
104
  async authHeaders(opts) {
118
- if (this.apiKey == null) {
119
- return undefined;
120
- }
121
105
  return (0, headers_1.buildHeaders)([{ Authorization: `Bearer ${this.apiKey}` }]);
122
106
  }
123
107
  stringifyQuery(query) {
@@ -452,7 +436,7 @@ class NotDiamond {
452
436
  }
453
437
  exports.NotDiamond = NotDiamond;
454
438
  _a = NotDiamond, _NotDiamond_encoder = new WeakMap(), _NotDiamond_instances = new WeakSet(), _NotDiamond_baseURLOverridden = function _NotDiamond_baseURLOverridden() {
455
- return this.baseURL !== environments[this._options.environment || 'production'];
439
+ return this.baseURL !== 'https://api.notdiamond.ai';
456
440
  };
457
441
  NotDiamond.NotDiamond = _a;
458
442
  NotDiamond.DEFAULT_TIMEOUT = 60000; // 1 minute
@@ -470,10 +454,10 @@ NotDiamond.InternalServerError = Errors.InternalServerError;
470
454
  NotDiamond.PermissionDeniedError = Errors.PermissionDeniedError;
471
455
  NotDiamond.UnprocessableEntityError = Errors.UnprocessableEntityError;
472
456
  NotDiamond.toFile = Uploads.toFile;
473
- NotDiamond.Routing = routing_1.Routing;
474
- NotDiamond.Preferences = preferences_1.Preferences;
475
- NotDiamond.PromptAdaptation = prompt_adaptation_1.PromptAdaptation;
457
+ NotDiamond.ModelRouter = model_router_1.ModelRouter;
476
458
  NotDiamond.Report = report_1.Report;
459
+ NotDiamond.Preferences = preferences_1.Preferences;
460
+ NotDiamond.Prompt = prompt_1.Prompt;
461
+ NotDiamond.Pzn = pzn_1.Pzn;
477
462
  NotDiamond.Models = models_1.Models;
478
- NotDiamond.Admin = admin_1.Admin;
479
463
  //# sourceMappingURL=client.js.map