notdiamond 2.0.0-rc5 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +170 -0
- package/LICENSE +1 -1
- package/README.md +276 -148
- package/client.d.mts +16 -19
- package/client.d.mts.map +1 -1
- package/client.d.ts +16 -19
- package/client.d.ts.map +1 -1
- package/client.js +11 -14
- package/client.js.map +1 -1
- package/client.mjs +11 -14
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/package.json +3 -3
- package/resources/{pzn.d.mts → custom-router.d.mts} +16 -96
- package/resources/custom-router.d.mts.map +1 -0
- package/resources/{pzn.d.ts → custom-router.d.ts} +16 -96
- package/resources/custom-router.d.ts.map +1 -0
- package/resources/{pzn.js → custom-router.js} +13 -50
- package/resources/custom-router.js.map +1 -0
- package/resources/{pzn.mjs → custom-router.mjs} +11 -48
- package/resources/custom-router.mjs.map +1 -0
- package/resources/index.d.mts +4 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -7
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -3
- package/resources/index.mjs.map +1 -1
- package/resources/model-router.d.mts +6 -123
- package/resources/model-router.d.mts.map +1 -1
- package/resources/model-router.d.ts +6 -123
- package/resources/model-router.d.ts.map +1 -1
- package/resources/model-router.js +3 -32
- package/resources/model-router.js.map +1 -1
- package/resources/model-router.mjs +3 -32
- package/resources/model-router.mjs.map +1 -1
- package/resources/preferences.d.mts +4 -23
- package/resources/preferences.d.mts.map +1 -1
- package/resources/preferences.d.ts +4 -23
- package/resources/preferences.d.ts.map +1 -1
- package/resources/preferences.js +3 -25
- package/resources/preferences.js.map +1 -1
- package/resources/preferences.mjs +3 -25
- package/resources/preferences.mjs.map +1 -1
- package/resources/prompt-adaptation.d.mts +687 -0
- package/resources/prompt-adaptation.d.mts.map +1 -0
- package/resources/prompt-adaptation.d.ts +687 -0
- package/resources/prompt-adaptation.d.ts.map +1 -0
- package/resources/prompt-adaptation.js +258 -0
- package/resources/prompt-adaptation.js.map +1 -0
- package/resources/prompt-adaptation.mjs +254 -0
- package/resources/prompt-adaptation.mjs.map +1 -0
- package/src/client.ts +37 -44
- package/src/resources/{pzn.ts → custom-router.ts} +17 -122
- package/src/resources/index.ts +14 -16
- package/src/resources/model-router.ts +5 -139
- package/src/resources/preferences.ts +3 -34
- package/src/resources/prompt-adaptation.ts +780 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/prompt/adapt.d.mts +0 -352
- package/resources/prompt/adapt.d.mts.map +0 -1
- package/resources/prompt/adapt.d.ts +0 -352
- package/resources/prompt/adapt.d.ts.map +0 -1
- package/resources/prompt/adapt.js +0 -154
- package/resources/prompt/adapt.js.map +0 -1
- package/resources/prompt/adapt.mjs +0 -150
- package/resources/prompt/adapt.mjs.map +0 -1
- package/resources/prompt/index.d.mts +0 -3
- package/resources/prompt/index.d.mts.map +0 -1
- package/resources/prompt/index.d.ts +0 -3
- package/resources/prompt/index.d.ts.map +0 -1
- package/resources/prompt/index.js +0 -9
- package/resources/prompt/index.js.map +0 -1
- package/resources/prompt/index.mjs +0 -4
- package/resources/prompt/index.mjs.map +0 -1
- package/resources/prompt/prompt.d.mts +0 -338
- package/resources/prompt/prompt.d.mts.map +0 -1
- package/resources/prompt/prompt.d.ts +0 -338
- package/resources/prompt/prompt.d.ts.map +0 -1
- package/resources/prompt/prompt.js +0 -128
- package/resources/prompt/prompt.js.map +0 -1
- package/resources/prompt/prompt.mjs +0 -123
- package/resources/prompt/prompt.mjs.map +0 -1
- package/resources/prompt.d.mts +0 -2
- package/resources/prompt.d.mts.map +0 -1
- package/resources/prompt.d.ts +0 -2
- package/resources/prompt.d.ts.map +0 -1
- package/resources/prompt.js +0 -6
- package/resources/prompt.js.map +0 -1
- package/resources/prompt.mjs +0 -3
- package/resources/prompt.mjs.map +0 -1
- package/resources/pzn.d.mts.map +0 -1
- package/resources/pzn.d.ts.map +0 -1
- package/resources/pzn.js.map +0 -1
- package/resources/pzn.mjs.map +0 -1
- package/resources/report/index.d.mts +0 -3
- package/resources/report/index.d.mts.map +0 -1
- package/resources/report/index.d.ts +0 -3
- package/resources/report/index.d.ts.map +0 -1
- package/resources/report/index.js +0 -9
- package/resources/report/index.js.map +0 -1
- package/resources/report/index.mjs +0 -4
- package/resources/report/index.mjs.map +0 -1
- package/resources/report/metrics.d.mts +0 -87
- package/resources/report/metrics.d.mts.map +0 -1
- package/resources/report/metrics.d.ts +0 -87
- package/resources/report/metrics.d.ts.map +0 -1
- package/resources/report/metrics.js +0 -57
- package/resources/report/metrics.js.map +0 -1
- package/resources/report/metrics.mjs +0 -53
- package/resources/report/metrics.mjs.map +0 -1
- package/resources/report/report.d.mts +0 -10
- package/resources/report/report.d.mts.map +0 -1
- package/resources/report/report.d.ts +0 -10
- package/resources/report/report.d.ts.map +0 -1
- package/resources/report/report.js +0 -17
- package/resources/report/report.js.map +0 -1
- package/resources/report/report.mjs +0 -12
- package/resources/report/report.mjs.map +0 -1
- package/resources/report.d.mts +0 -2
- package/resources/report.d.mts.map +0 -1
- package/resources/report.d.ts +0 -2
- package/resources/report.d.ts.map +0 -1
- package/resources/report.js +0 -6
- package/resources/report.js.map +0 -1
- package/resources/report.mjs +0 -3
- package/resources/report.mjs.map +0 -1
- package/src/resources/prompt/adapt.ts +0 -402
- package/src/resources/prompt/index.ts +0 -16
- package/src/resources/prompt/prompt.ts +0 -398
- package/src/resources/prompt.ts +0 -3
- package/src/resources/report/index.ts +0 -4
- package/src/resources/report/metrics.ts +0 -99
- package/src/resources/report/report.ts +0 -19
- package/src/resources/report.ts +0 -3
package/README.md
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Notdiamond TypeScript API Library
|
|
2
2
|
|
|
3
3
|
[>)](https://npmjs.org/package/notdiamond) 
|
|
4
4
|
|
|
5
|
-
This library provides convenient access to the
|
|
5
|
+
This library provides convenient access to the Notdiamond REST API from server-side TypeScript or JavaScript.
|
|
6
6
|
|
|
7
|
-
The
|
|
7
|
+
The library includes type definitions for all request params and response fields.
|
|
8
|
+
|
|
9
|
+
## What is Prompt Adaptation?
|
|
10
|
+
|
|
11
|
+
Not Diamond specializes in **Prompt Adaptation** - automatically optimizing your prompts to work optimally across different LLMs. Each language model has unique characteristics, instruction-following patterns, and preferred prompt formats. A prompt that works perfectly for GPT-5 might perform poorly on Claude or Gemini.
|
|
12
|
+
Manually rewriting prompts for each model is time-consuming and requires deep expertise in each model's quirks.
|
|
13
|
+
|
|
14
|
+
**The Solution**: Not Diamond automatically adapts your prompts with:
|
|
15
|
+
|
|
16
|
+
- Automatic optimization of both system and user prompts
|
|
17
|
+
- Built-in evaluation metrics
|
|
18
|
+
- Minimum 25 training examples recommended
|
|
19
|
+
- Processing time: typically 10–30 minutes
|
|
8
20
|
|
|
9
|
-
|
|
21
|
+
## Documentation
|
|
22
|
+
|
|
23
|
+
The REST API documentation can be found on [docs.notdiamond.ai](https://docs.notdiamond.ai). The full API of this library can be found in [api.md](api.md).
|
|
10
24
|
|
|
11
25
|
## Installation
|
|
12
26
|
|
|
@@ -16,128 +30,217 @@ npm install notdiamond
|
|
|
16
30
|
|
|
17
31
|
## Usage
|
|
18
32
|
|
|
19
|
-
|
|
33
|
+
#### Quick Start
|
|
20
34
|
|
|
21
35
|
<!-- prettier-ignore -->
|
|
22
|
-
|
|
36
|
+
|
|
37
|
+
```ts
|
|
23
38
|
import NotDiamond from 'notdiamond';
|
|
24
39
|
|
|
25
|
-
const client = new
|
|
26
|
-
apiKey: process.env['
|
|
40
|
+
const client = new Notdiamond({
|
|
41
|
+
apiKey: process.env['NOTDIAMOND_API_KEY'], // This is the default and can be omitted
|
|
27
42
|
});
|
|
28
43
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
// Step 1: Start a prompt adaptation job with prototype mode
|
|
45
|
+
const adaptation = await client.promptAdaptation.adapt({
|
|
46
|
+
fields: ['question'],
|
|
47
|
+
system_prompt: 'You are a mathematical assistant that counts digits accurately.',
|
|
48
|
+
target_models: [
|
|
49
|
+
{
|
|
50
|
+
model: 'claude-sonnet-4-5-20250929',
|
|
51
|
+
provider: 'anthropic',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
model: 'gemini-2.5-flash',
|
|
55
|
+
provider: 'google',
|
|
56
|
+
},
|
|
34
57
|
],
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
58
|
+
template: 'Question: {question}\nAnswer:',
|
|
59
|
+
train_goldens: [
|
|
60
|
+
{
|
|
61
|
+
fields: { question: 'How many digits are in (23874045494*2789392485)?' },
|
|
62
|
+
answer: '20',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
fields: { question: 'How many odd digits are in (999*777*555*333*111)?' },
|
|
66
|
+
answer: '10',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
fields: { question: "How often does the number '17' appear in the digits of (287558*17)?" },
|
|
70
|
+
answer: '0',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
fields: { question: 'How many even digits are in (222*444*666*888)?' },
|
|
74
|
+
answer: '16',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
fields: { question: 'How many 0s are in (1234567890*1357908642)?' },
|
|
78
|
+
answer: '2',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
test_goldens: [
|
|
82
|
+
{
|
|
83
|
+
fields: { question: 'How many digits are in (9876543210*123456)?' },
|
|
84
|
+
answer: '15',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
fields: { question: 'How many odd digits are in (135*579*246)?' },
|
|
88
|
+
answer: '8',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
fields: { question: "How often does the number '42' appear in the digits of (123456789*42)?" },
|
|
92
|
+
answer: '1',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
fields: { question: 'How many even digits are in (1111*2222*3333)?' },
|
|
96
|
+
answer: '10',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
fields: { question: 'How many 9s are in (999999*888888)?' },
|
|
100
|
+
answer: '11',
|
|
101
|
+
},
|
|
38
102
|
],
|
|
103
|
+
evaluation_metric: 'LLMaaJ:Sem_Sim_1', // Or use custom evaluation
|
|
104
|
+
prototype_mode: true, // Enable faster prototype mode for quick experimentation
|
|
39
105
|
});
|
|
40
106
|
|
|
41
|
-
console.log(
|
|
107
|
+
console.log(`Adaptation started: ${adaptation.adaptation_run_id}`);
|
|
108
|
+
|
|
109
|
+
// Step 2: Poll for completion (typically takes 10-30 minutes)
|
|
110
|
+
let status;
|
|
111
|
+
while (true) {
|
|
112
|
+
status = await client.promptAdaptation.getAdaptStatus(adaptation.adaptation_run_id);
|
|
113
|
+
console.log(`Status: ${status.status}`);
|
|
114
|
+
|
|
115
|
+
if (status.status === 'queued') {
|
|
116
|
+
console.log(`Queue position: ${status.queue_position}`);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (status.status === 'completed' || status.status === 'failed') {
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
await new Promise(resolve => setTimeout(resolve, 30000)); // Poll every 30 seconds
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Step 3: Get the optimized prompts
|
|
127
|
+
if (status.status === 'completed') {
|
|
128
|
+
const results = await client.promptAdaptation.getAdaptResults(adaptation.adaptation_run_id);
|
|
129
|
+
|
|
130
|
+
console.log(`\nOrigin model baseline: ${results.origin_model.score.toFixed(2)}`);
|
|
131
|
+
|
|
132
|
+
for (const target of results.target_models) {
|
|
133
|
+
console.log('\n' + '='.repeat(50));
|
|
134
|
+
console.log(`Model: ${target.model.model} (${target.model.provider})`);
|
|
135
|
+
console.log(`Optimized System Prompt:\n${target.system_prompt}`);
|
|
136
|
+
console.log(`Optimized Template:\n${target.user_message_template}`);
|
|
137
|
+
console.log(`Pre-optimization score: ${target.pre_optimization_score.toFixed(2)}`);
|
|
138
|
+
console.log(`Post-optimization score: ${target.post_optimization_score.toFixed(2)}`);
|
|
139
|
+
console.log(`Improvement: ${((target.post_optimization_score / target.pre_optimization_score - 1) * 100).toFixed(1)}%`);
|
|
140
|
+
console.log(`Cost: $${target.cost.toFixed(4)}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
42
143
|
```
|
|
43
144
|
|
|
44
|
-
|
|
145
|
+
For more details, see the [Prompt Adaptation documentation](https://docs.notdiamond.ai/docs/adapting-prompts-to-new-models).
|
|
45
146
|
|
|
46
|
-
|
|
147
|
+
### Model Routing
|
|
148
|
+
|
|
149
|
+
Select the best model automatically:
|
|
47
150
|
|
|
48
151
|
<!-- prettier-ignore -->
|
|
49
152
|
```ts
|
|
50
153
|
import NotDiamond from 'notdiamond';
|
|
51
154
|
|
|
52
155
|
const client = new NotDiamond({
|
|
53
|
-
apiKey: process.env['
|
|
156
|
+
apiKey: process.env['NOTDIAMOND_API_KEY'], // This is the default and can be omitted
|
|
54
157
|
});
|
|
55
158
|
|
|
56
|
-
const
|
|
159
|
+
const response = await client.modelRouter.selectModel({
|
|
57
160
|
llm_providers: [
|
|
58
161
|
{ model: 'gpt-4o', provider: 'openai' },
|
|
59
162
|
{ model: 'claude-sonnet-4-5-20250929', provider: 'anthropic' },
|
|
60
|
-
{ model: 'gemini-
|
|
163
|
+
{ model: 'gemini-2.5-flash', provider: 'google' },
|
|
61
164
|
],
|
|
62
165
|
messages: [
|
|
63
166
|
{ role: 'system', content: 'You are a helpful assistant.' },
|
|
64
167
|
{ role: 'user', content: 'Explain quantum computing in simple terms' },
|
|
65
168
|
],
|
|
66
|
-
};
|
|
67
|
-
const response: NotDiamond.ModelRouterSelectModelResponse = await client.modelRouter.selectModel(params);
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
169
|
+
});
|
|
71
170
|
|
|
72
|
-
|
|
171
|
+
console.log(response.providers);
|
|
172
|
+
```
|
|
73
173
|
|
|
74
|
-
|
|
174
|
+
### Train Custom Router
|
|
75
175
|
|
|
76
|
-
|
|
77
|
-
- a `fetch` `Response` (or an object with the same structure)
|
|
78
|
-
- an `fs.ReadStream`
|
|
79
|
-
- the return value of our `toFile` helper
|
|
176
|
+
For even better performance, you can train a custom router on your own dataset. This allows the router to learn the specific patterns and preferences of your use case:
|
|
80
177
|
|
|
81
178
|
```ts
|
|
82
179
|
import fs from 'fs';
|
|
83
|
-
import NotDiamond
|
|
180
|
+
import NotDiamond from 'notdiamond';
|
|
84
181
|
|
|
85
|
-
const client = new NotDiamond(
|
|
182
|
+
const client = new NotDiamond({
|
|
183
|
+
apiKey: process.env['NOTDIAMOND_API_KEY'], // This is the default and can be omitted
|
|
184
|
+
});
|
|
86
185
|
|
|
87
|
-
|
|
88
|
-
await client.pzn.submitSurveyResponse({
|
|
89
|
-
constraint_priorities: 'constraint_priorities',
|
|
90
|
-
email: 'email',
|
|
91
|
-
llm_providers: 'llm_providers',
|
|
92
|
-
use_case_desc: 'use_case_desc',
|
|
93
|
-
user_id: 'user_id',
|
|
94
|
-
'x-token': 'x-token',
|
|
186
|
+
await client.customRouter.trainCustomRouter({
|
|
95
187
|
dataset_file: fs.createReadStream('/path/to/file'),
|
|
96
|
-
|
|
188
|
+
language: 'english',
|
|
189
|
+
llm_providers:
|
|
190
|
+
'[{"provider": "openai", "model": "gpt-4o"}, {"provider": "anthropic", "model": "claude-sonnet-4-5-20250929"}]',
|
|
191
|
+
maximize: true,
|
|
192
|
+
prompt_column: 'prompt',
|
|
193
|
+
});cust
|
|
194
|
+
```
|
|
97
195
|
|
|
98
|
-
|
|
99
|
-
await client.pzn.submitSurveyResponse({
|
|
100
|
-
constraint_priorities: 'constraint_priorities',
|
|
101
|
-
email: 'email',
|
|
102
|
-
llm_providers: 'llm_providers',
|
|
103
|
-
use_case_desc: 'use_case_desc',
|
|
104
|
-
user_id: 'user_id',
|
|
105
|
-
'x-token': 'x-token',
|
|
106
|
-
dataset_file: new File(['my bytes'], 'file'),
|
|
107
|
-
});
|
|
196
|
+
### Request & Response types
|
|
108
197
|
|
|
109
|
-
|
|
110
|
-
await client.pzn.submitSurveyResponse({
|
|
111
|
-
constraint_priorities: 'constraint_priorities',
|
|
112
|
-
email: 'email',
|
|
113
|
-
llm_providers: 'llm_providers',
|
|
114
|
-
use_case_desc: 'use_case_desc',
|
|
115
|
-
user_id: 'user_id',
|
|
116
|
-
'x-token': 'x-token',
|
|
117
|
-
dataset_file: await fetch('https://somesite/file'),
|
|
118
|
-
});
|
|
198
|
+
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
|
|
119
199
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
user_id: 'user_id',
|
|
127
|
-
'x-token': 'x-token',
|
|
128
|
-
dataset_file: await toFile(Buffer.from('my bytes'), 'file'),
|
|
129
|
-
});
|
|
130
|
-
await client.pzn.submitSurveyResponse({
|
|
131
|
-
constraint_priorities: 'constraint_priorities',
|
|
132
|
-
email: 'email',
|
|
133
|
-
llm_providers: 'llm_providers',
|
|
134
|
-
use_case_desc: 'use_case_desc',
|
|
135
|
-
user_id: 'user_id',
|
|
136
|
-
'x-token': 'x-token',
|
|
137
|
-
dataset_file: await toFile(new Uint8Array([0, 1, 2]), 'file'),
|
|
200
|
+
<!-- prettier-ignore -->
|
|
201
|
+
```ts
|
|
202
|
+
import Notdiamond from 'notdiamond';
|
|
203
|
+
|
|
204
|
+
const client = new Notdiamond({
|
|
205
|
+
apiKey: process.env['NOTDIAMOND_API_KEY'], // This is the default and can be omitted
|
|
138
206
|
});
|
|
207
|
+
|
|
208
|
+
const params: NotDiamond.PromptAdaptCreateParams = {
|
|
209
|
+
fields: ['question', 'context'],
|
|
210
|
+
system_prompt: 'You are a helpful assistant.',
|
|
211
|
+
target_models: [
|
|
212
|
+
{
|
|
213
|
+
model: 'claude-sonnet-4-5-20250929',
|
|
214
|
+
provider: 'anthropic',
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
template: 'Context: {context}\nQuestion: {question}\nAnswer:',
|
|
218
|
+
train_goldens: [
|
|
219
|
+
{
|
|
220
|
+
fields: {
|
|
221
|
+
question: 'What is 2+2?',
|
|
222
|
+
context: 'Basic arithmetic',
|
|
223
|
+
},
|
|
224
|
+
answer: '4',
|
|
225
|
+
},
|
|
226
|
+
// Add at least 25 examples for best results
|
|
227
|
+
],
|
|
228
|
+
test_goldens: [
|
|
229
|
+
{
|
|
230
|
+
fields: {
|
|
231
|
+
question: 'What is 3*3?',
|
|
232
|
+
context: 'Basic arithmetic',
|
|
233
|
+
},
|
|
234
|
+
answer: '9',
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
};
|
|
238
|
+
const response: NotDiamond.PromptAdaptCreateResponse = await client.promptAdaptation.adapt(params);
|
|
239
|
+
console.log(response.adaptation_run_id);
|
|
139
240
|
```
|
|
140
241
|
|
|
242
|
+
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
243
|
+
|
|
141
244
|
## Handling errors
|
|
142
245
|
|
|
143
246
|
When the library is unable to connect to the API,
|
|
@@ -146,27 +249,47 @@ a subclass of `APIError` will be thrown:
|
|
|
146
249
|
|
|
147
250
|
<!-- prettier-ignore -->
|
|
148
251
|
```ts
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
252
|
+
import NotDiamond from 'notdiamond';
|
|
253
|
+
|
|
254
|
+
const client = new NotDiamond();
|
|
255
|
+
|
|
256
|
+
try {
|
|
257
|
+
await client.promptAdaptation.adapt({
|
|
258
|
+
fields: ['question'],
|
|
259
|
+
system_prompt: 'You are a helpful assistant.',
|
|
260
|
+
target_models: [
|
|
261
|
+
{
|
|
262
|
+
model: 'claude-sonnet-4-5-20250929',
|
|
263
|
+
provider: 'anthropic',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
model: 'gemini-2.5-flash',
|
|
267
|
+
provider: 'google',
|
|
268
|
+
},
|
|
155
269
|
],
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
{
|
|
270
|
+
template: 'Question: {question}\nAnswer:',
|
|
271
|
+
train_goldens: [
|
|
272
|
+
{ fields: { question: 'What is 2+2?' }, answer: '4' },
|
|
273
|
+
// Add at least 25 examples...
|
|
274
|
+
],
|
|
275
|
+
test_goldens: [
|
|
276
|
+
{ fields: { question: 'What is 3*3?' }, answer: '9' },
|
|
159
277
|
],
|
|
160
|
-
})
|
|
161
|
-
.catch(async (err) => {
|
|
162
|
-
if (err instanceof NotDiamond.APIError) {
|
|
163
|
-
console.log(err.status); // 400
|
|
164
|
-
console.log(err.name); // BadRequestError
|
|
165
|
-
console.log(err.headers); // {server: 'nginx', ...}
|
|
166
|
-
} else {
|
|
167
|
-
throw err;
|
|
168
|
-
}
|
|
169
278
|
});
|
|
279
|
+
} catch (err) {
|
|
280
|
+
if (err instanceof NotDiamond.APIConnectionError) {
|
|
281
|
+
console.log('The server could not be reached');
|
|
282
|
+
console.log(err.cause); // an underlying Error, likely from fetch()
|
|
283
|
+
} else if (err instanceof NotDiamond.RateLimitError) {
|
|
284
|
+
console.log('A 429 status code was received; we should back off a bit.');
|
|
285
|
+
} else if (err instanceof NotDiamond.APIError) {
|
|
286
|
+
console.log(err.status); // 400
|
|
287
|
+
console.log(err.name); // BadRequestError
|
|
288
|
+
console.log(err.headers); // {server: 'nginx', ...}
|
|
289
|
+
} else {
|
|
290
|
+
throw err;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
170
293
|
```
|
|
171
294
|
|
|
172
295
|
Error codes are as follows:
|
|
@@ -182,27 +305,6 @@ Error codes are as follows:
|
|
|
182
305
|
| >=500 | `InternalServerError` |
|
|
183
306
|
| N/A | `APIConnectionError` |
|
|
184
307
|
|
|
185
|
-
### Retries
|
|
186
|
-
|
|
187
|
-
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
|
|
188
|
-
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
|
|
189
|
-
429 Rate Limit, and >=500 Internal errors will all be retried by default.
|
|
190
|
-
|
|
191
|
-
You can use the `maxRetries` option to configure or disable this:
|
|
192
|
-
|
|
193
|
-
<!-- prettier-ignore -->
|
|
194
|
-
```js
|
|
195
|
-
// Configure the default for all requests:
|
|
196
|
-
const client = new NotDiamond({
|
|
197
|
-
maxRetries: 0, // default is 2
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
// Or, configure per-request:
|
|
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' }] }, {
|
|
202
|
-
maxRetries: 5,
|
|
203
|
-
});
|
|
204
|
-
```
|
|
205
|
-
|
|
206
308
|
### Timeouts
|
|
207
309
|
|
|
208
310
|
Requests time out after 1 minute by default. You can configure this with a `timeout` option:
|
|
@@ -214,9 +316,9 @@ const client = new NotDiamond({
|
|
|
214
316
|
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
|
|
215
317
|
});
|
|
216
318
|
|
|
217
|
-
// Override per-request:
|
|
218
|
-
await client.
|
|
219
|
-
timeout:
|
|
319
|
+
// Override per-request (note: prompt adaptation may take 10-30 minutes, so increase timeout accordingly):
|
|
320
|
+
await client.prompt.getAdaptStatus('your-adaptation-run-id', {
|
|
321
|
+
timeout: 120 * 1000, // 2 minutes
|
|
220
322
|
});
|
|
221
323
|
```
|
|
222
324
|
|
|
@@ -238,37 +340,59 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
|
|
|
238
340
|
```ts
|
|
239
341
|
const client = new NotDiamond();
|
|
240
342
|
|
|
241
|
-
const response = await client.
|
|
242
|
-
.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
{
|
|
343
|
+
const response = await client.prompt.adapt
|
|
344
|
+
.create({
|
|
345
|
+
fields: ['question'],
|
|
346
|
+
system_prompt: 'You are a helpful assistant.',
|
|
347
|
+
target_models: [
|
|
348
|
+
{
|
|
349
|
+
model: 'claude-sonnet-4-5-20250929',
|
|
350
|
+
provider: 'anthropic',
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
model: 'gemini-2.5-flash',
|
|
354
|
+
provider: 'google',
|
|
355
|
+
},
|
|
356
|
+
],
|
|
357
|
+
template: 'Question: {question}\nAnswer:',
|
|
358
|
+
train_goldens: [
|
|
359
|
+
{ fields: { question: 'What is 2+2?' }, answer: '4' },
|
|
360
|
+
//Add at least 25 examples...
|
|
247
361
|
],
|
|
248
|
-
|
|
249
|
-
{
|
|
250
|
-
{ role: 'user', content: 'Explain quantum computing in simple terms' },
|
|
362
|
+
test_goldens: [
|
|
363
|
+
{ fields: { question: 'What is 3*3?' }, answer: '9' },
|
|
251
364
|
],
|
|
252
365
|
})
|
|
253
366
|
.asResponse();
|
|
254
367
|
console.log(response.headers.get('X-My-Header'));
|
|
255
368
|
console.log(response.statusText); // access the underlying Response object
|
|
256
369
|
|
|
257
|
-
const { data:
|
|
258
|
-
.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
{
|
|
370
|
+
const { data: adaptResponse, response: raw } = await client.prompt.adapt
|
|
371
|
+
.create({
|
|
372
|
+
fields: ['question'],
|
|
373
|
+
system_prompt: 'You are a helpful assistant.',
|
|
374
|
+
target_models: [
|
|
375
|
+
{
|
|
376
|
+
model: 'claude-sonnet-4-5-20250929',
|
|
377
|
+
provider: 'anthropic',
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
model: 'gemini-2.5-flash',
|
|
381
|
+
provider: 'google',
|
|
382
|
+
},
|
|
263
383
|
],
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
{
|
|
384
|
+
template: 'Question: {question}\nAnswer:',
|
|
385
|
+
train_goldens: [
|
|
386
|
+
{ fields: { question: 'What is 2+2?' }, answer: '4' },
|
|
387
|
+
// Add at least 25 examples...
|
|
388
|
+
],
|
|
389
|
+
test_goldens: [
|
|
390
|
+
{ fields: { question: 'What is 3*3?' }, answer: '9' },
|
|
267
391
|
],
|
|
268
392
|
})
|
|
269
393
|
.withResponse();
|
|
270
394
|
console.log(raw.headers.get('X-My-Header'));
|
|
271
|
-
console.log(
|
|
395
|
+
console.log(adaptResponse.adaptation_run_id);
|
|
272
396
|
```
|
|
273
397
|
|
|
274
398
|
### Logging
|
|
@@ -281,7 +405,7 @@ console.log(response.providers);
|
|
|
281
405
|
|
|
282
406
|
The log level can be configured in two ways:
|
|
283
407
|
|
|
284
|
-
1. Via the `
|
|
408
|
+
1. Via the `NOTDIAMOND_LOG` environment variable
|
|
285
409
|
2. Using the `logLevel` client option (overrides the environment variable if set)
|
|
286
410
|
|
|
287
411
|
```ts
|
|
@@ -348,10 +472,14 @@ parameter. This library doesn't validate at runtime that the request matches the
|
|
|
348
472
|
send will be sent as-is.
|
|
349
473
|
|
|
350
474
|
```ts
|
|
351
|
-
client.
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
475
|
+
client.promptAdaptation.adapt({
|
|
476
|
+
fields: ['question'],
|
|
477
|
+
system_prompt: 'You are a helpful assistant.',
|
|
478
|
+
target_models: [{ model: 'claude-sonnet-4-5-20250929', provider: 'anthropic' }],
|
|
479
|
+
template: 'Question: {question}\nAnswer:',
|
|
480
|
+
train_goldens: [{ fields: { question: 'What is 2+2?' }, answer: '4' }],
|
|
481
|
+
// @ts-expect-error experimental_feature is not yet public
|
|
482
|
+
experimental_feature: true,
|
|
355
483
|
});
|
|
356
484
|
```
|
|
357
485
|
|
package/client.d.mts
CHANGED
|
@@ -6,12 +6,11 @@ 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 {
|
|
9
|
+
import { CustomRouter, CustomRouterTrainCustomRouterParams, CustomRouterTrainCustomRouterResponse } from "./resources/custom-router.mjs";
|
|
10
|
+
import { ModelRouter, ModelRouterSelectModelParams, ModelRouterSelectModelResponse } from "./resources/model-router.mjs";
|
|
10
11
|
import { Model, ModelListParams, ModelListResponse, Models } from "./resources/models.mjs";
|
|
11
|
-
import { PreferenceCreateParams, PreferenceCreateResponse, PreferenceDeleteResponse,
|
|
12
|
-
import {
|
|
13
|
-
import { JobStatus, Prompt, PromptGetAdaptResultsResponse, PromptGetAdaptStatusResponse } from "./resources/prompt/prompt.mjs";
|
|
14
|
-
import { Report } from "./resources/report/report.mjs";
|
|
12
|
+
import { PreferenceCreateParams, PreferenceCreateResponse, PreferenceDeleteResponse, PreferenceUpdateParams, PreferenceUpdateResponse, Preferences } from "./resources/preferences.mjs";
|
|
13
|
+
import { GoldenRecord, JobStatus, PromptAdaptation, PromptAdaptationAdaptParams, PromptAdaptationAdaptResponse, PromptAdaptationGetAdaptResultsResponse, PromptAdaptationGetAdaptStatusResponse, PromptAdaptationGetCostResponse, RequestProvider } from "./resources/prompt-adaptation.mjs";
|
|
15
14
|
import { type Fetch } from "./internal/builtin-types.mjs";
|
|
16
15
|
import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
|
|
17
16
|
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
|
|
@@ -24,7 +23,7 @@ export interface ClientOptions {
|
|
|
24
23
|
/**
|
|
25
24
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
26
25
|
*
|
|
27
|
-
* Defaults to process.env['
|
|
26
|
+
* Defaults to process.env['NOTDIAMOND_BASE_URL'].
|
|
28
27
|
*/
|
|
29
28
|
baseURL?: string | null | undefined;
|
|
30
29
|
/**
|
|
@@ -72,7 +71,7 @@ export interface ClientOptions {
|
|
|
72
71
|
/**
|
|
73
72
|
* Set the log level.
|
|
74
73
|
*
|
|
75
|
-
* Defaults to process.env['
|
|
74
|
+
* Defaults to process.env['NOTDIAMOND_LOG'] or 'warn' if it isn't set.
|
|
76
75
|
*/
|
|
77
76
|
logLevel?: LogLevel | undefined;
|
|
78
77
|
/**
|
|
@@ -83,7 +82,7 @@ export interface ClientOptions {
|
|
|
83
82
|
logger?: Logger | undefined;
|
|
84
83
|
}
|
|
85
84
|
/**
|
|
86
|
-
* API Client for interfacing with the
|
|
85
|
+
* API Client for interfacing with the Notdiamond API.
|
|
87
86
|
*/
|
|
88
87
|
export declare class NotDiamond {
|
|
89
88
|
#private;
|
|
@@ -91,17 +90,17 @@ export declare class NotDiamond {
|
|
|
91
90
|
baseURL: string;
|
|
92
91
|
maxRetries: number;
|
|
93
92
|
timeout: number;
|
|
94
|
-
logger: Logger
|
|
93
|
+
logger: Logger;
|
|
95
94
|
logLevel: LogLevel | undefined;
|
|
96
95
|
fetchOptions: MergedRequestInit | undefined;
|
|
97
96
|
private fetch;
|
|
98
97
|
protected idempotencyHeader?: string;
|
|
99
98
|
private _options;
|
|
100
99
|
/**
|
|
101
|
-
* API Client for interfacing with the
|
|
100
|
+
* API Client for interfacing with the Notdiamond API.
|
|
102
101
|
*
|
|
103
102
|
* @param {string | undefined} [opts.apiKey=process.env['NOT_DIAMOND_API_KEY'] ?? undefined]
|
|
104
|
-
* @param {string} [opts.baseURL=process.env['
|
|
103
|
+
* @param {string} [opts.baseURL=process.env['NOTDIAMOND_BASE_URL'] ?? https://api.notdiamond.ai] - Override the default base URL for the API.
|
|
105
104
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
106
105
|
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
|
107
106
|
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -174,19 +173,17 @@ export declare class NotDiamond {
|
|
|
174
173
|
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
175
174
|
static toFile: typeof Uploads.toFile;
|
|
176
175
|
modelRouter: API.ModelRouter;
|
|
177
|
-
report: API.Report;
|
|
178
176
|
preferences: API.Preferences;
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
promptAdaptation: API.PromptAdaptation;
|
|
178
|
+
customRouter: API.CustomRouter;
|
|
181
179
|
models: API.Models;
|
|
182
180
|
}
|
|
183
181
|
export declare namespace NotDiamond {
|
|
184
182
|
export type RequestOptions = Opts.RequestOptions;
|
|
185
|
-
export { ModelRouter as ModelRouter, type
|
|
186
|
-
export {
|
|
187
|
-
export {
|
|
188
|
-
export {
|
|
189
|
-
export { Pzn as Pzn, type PznSubmitSurveyResponseResponse as PznSubmitSurveyResponseResponse, type PznTrainCustomRouterResponse as PznTrainCustomRouterResponse, type PznSubmitSurveyResponseParams as PznSubmitSurveyResponseParams, type PznTrainCustomRouterParams as PznTrainCustomRouterParams, };
|
|
183
|
+
export { ModelRouter as ModelRouter, type ModelRouterSelectModelResponse as ModelRouterSelectModelResponse, type ModelRouterSelectModelParams as ModelRouterSelectModelParams, };
|
|
184
|
+
export { Preferences as Preferences, type PreferenceCreateResponse as PreferenceCreateResponse, type PreferenceUpdateResponse as PreferenceUpdateResponse, type PreferenceDeleteResponse as PreferenceDeleteResponse, type PreferenceCreateParams as PreferenceCreateParams, type PreferenceUpdateParams as PreferenceUpdateParams, };
|
|
185
|
+
export { PromptAdaptation as PromptAdaptation, type GoldenRecord as GoldenRecord, type JobStatus as JobStatus, type RequestProvider as RequestProvider, type PromptAdaptationAdaptResponse as PromptAdaptationAdaptResponse, type PromptAdaptationGetAdaptResultsResponse as PromptAdaptationGetAdaptResultsResponse, type PromptAdaptationGetAdaptStatusResponse as PromptAdaptationGetAdaptStatusResponse, type PromptAdaptationGetCostResponse as PromptAdaptationGetCostResponse, type PromptAdaptationAdaptParams as PromptAdaptationAdaptParams, };
|
|
186
|
+
export { CustomRouter as CustomRouter, type CustomRouterTrainCustomRouterResponse as CustomRouterTrainCustomRouterResponse, type CustomRouterTrainCustomRouterParams as CustomRouterTrainCustomRouterParams, };
|
|
190
187
|
export { Models as Models, type Model as Model, type ModelListResponse as ModelListResponse, type ModelListParams as ModelListParams, };
|
|
191
188
|
}
|
|
192
189
|
//# 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,EACL,
|
|
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,EACL,YAAY,EACZ,mCAAmC,EACnC,qCAAqC,EACtC;OACM,EACL,WAAW,EACX,4BAA4B,EAC5B,8BAA8B,EAC/B;OACM,EAAE,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,EAAE;OACrD,EACL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