honeyhive 0.5.0 → 0.6.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 (35) hide show
  1. package/README.md +299 -208
  2. package/dist/models/components/createdatapointrequest.d.ts +2 -13
  3. package/dist/models/components/createdatapointrequest.js +4 -17
  4. package/dist/models/components/updatedatapointrequest.d.ts +0 -8
  5. package/dist/models/components/updatedatapointrequest.js +0 -10
  6. package/dist/models/operations/getconfigurations.d.ts +0 -11
  7. package/dist/models/operations/getconfigurations.js +1 -13
  8. package/dist/models/operations/getdatapoints.d.ts +4 -11
  9. package/dist/models/operations/getdatapoints.js +5 -13
  10. package/dist/models/operations/getdatasets.d.ts +2 -2
  11. package/dist/models/operations/getdatasets.js +6 -6
  12. package/dist/sdk/configurations.d.ts +1 -1
  13. package/dist/sdk/configurations.js +1 -2
  14. package/dist/sdk/datapoints.d.ts +1 -1
  15. package/dist/sdk/datapoints.js +2 -2
  16. package/dist/sdk/datasets.d.ts +1 -1
  17. package/dist/sdk/sdk.js +3 -3
  18. package/dist/sdk/tracer.d.ts +9 -156
  19. package/dist/sdk/tracer.js +85 -340
  20. package/docs/models/components/createdatapointrequest.md +9 -10
  21. package/docs/models/components/updatedatapointrequest.md +0 -2
  22. package/docs/models/operations/getconfigurationsrequest.md +5 -6
  23. package/docs/models/operations/getdatapointsrequest.md +5 -5
  24. package/docs/models/operations/getdatasetsrequest.md +1 -1
  25. package/docs/models/operations/typet.md +5 -5
  26. package/docs/models/operations/updatedatapointrequest.md +4 -4
  27. package/docs/sdks/configurations/README.md +98 -20
  28. package/docs/sdks/datapoints/README.md +19 -16
  29. package/docs/sdks/datasets/README.md +3 -3
  30. package/docs/sdks/events/README.md +35 -3
  31. package/docs/sdks/session/README.md +12 -1
  32. package/package.json +13 -4
  33. package/docs/models/components/createdatapointrequesttype.md +0 -11
  34. package/docs/models/operations/getconfigurationsqueryparamtype.md +0 -11
  35. package/docs/models/operations/queryparamtype.md +0 -11
package/README.md CHANGED
@@ -25,49 +25,67 @@ yarn add https://github.com/honeyhiveai/typescript-sdk
25
25
  import { HoneyHive } from "honeyhive";
26
26
 
27
27
  async function run() {
28
- const sdk = new HoneyHive({
29
- bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
30
- });
31
-
32
- const res = await sdk.session.startSession({
33
- session: {
34
- project: "Simple RAG Project",
35
- sessionName: "Playground Session",
36
- source: "playground",
37
- sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
38
- childrenIds: ["7f22137a-6911-4ed3-bc36-110f1dde6b66"],
39
- config: {
40
- key: "<value>",
41
- },
42
- inputs: {
43
- context: "Hello world",
44
- question: "What is in the context?",
45
- chat_history: "<value>",
46
- },
47
- outputs: {
48
- role: "assistant",
49
- content: "Hello world",
50
- },
51
- error: null,
52
- duration: 824.8056,
53
- userProperties: {
54
- user: "google-oauth2|111840237613341303366",
55
- },
56
- metrics: {},
57
- feedback: {},
58
- metadata: {},
59
- startTime: 1712025501605,
60
- endTime: 1712025499832,
61
- },
62
- });
63
-
64
- if (res.statusCode == 200) {
65
- // handle response
66
- }
28
+ const sdk = new HoneyHive({
29
+ bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
30
+ });
31
+
32
+ const res = await sdk.session.startSession({
33
+ session: {
34
+ project: "Simple RAG Project",
35
+ sessionName: "Playground Session",
36
+ source: "playground",
37
+ sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
38
+ childrenIds: [
39
+ "7f22137a-6911-4ed3-bc36-110f1dde6b66",
40
+ ],
41
+ config: {
42
+ "key": "<value>",
43
+ },
44
+ inputs: {
45
+ "context": "Hello world",
46
+ "question": "What is in the context?",
47
+ "chat_history": [
48
+ {
49
+ "role": "system",
50
+ "content": "Answer the user's question only using provided context.
51
+
52
+ Context: Hello world",
53
+ },
54
+ {
55
+ "role": "user",
56
+ "content": "What is in the context?",
57
+ },
58
+ ],
59
+ },
60
+ outputs: {
61
+ "role": "assistant",
62
+ "content": "Hello world",
63
+ },
64
+ error: null,
65
+ duration: 824.8056,
66
+ userProperties: {
67
+ "user": "google-oauth2|111840237613341303366",
68
+ },
69
+ metrics: {
70
+
71
+ },
72
+ feedback: {
73
+
74
+ },
75
+ metadata: {
76
+
77
+ },
78
+ startTime: 1712025501605,
79
+ endTime: 1712025499832,
80
+ },
81
+ });
82
+
83
+ if (res.statusCode == 200) {
84
+ // handle response
85
+ }
67
86
  }
68
87
 
69
88
  run();
70
-
71
89
  ```
72
90
  <!-- End SDK Example Usage [usage] -->
73
91
 
@@ -144,57 +162,76 @@ Example
144
162
  import { HoneyHive } from "honeyhive";
145
163
 
146
164
  async function run() {
147
- const sdk = new HoneyHive({
148
- bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
149
- });
150
-
151
- let res;
152
- try {
153
- res = await sdk.session.startSession({
154
- session: {
155
- project: "Simple RAG Project",
156
- sessionName: "Playground Session",
157
- source: "playground",
158
- sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
159
- childrenIds: ["7f22137a-6911-4ed3-bc36-110f1dde6b66"],
160
- config: {
161
- key: "<value>",
162
- },
163
- inputs: {
164
- context: "Hello world",
165
- question: "What is in the context?",
166
- chat_history: "<value>",
167
- },
168
- outputs: {
169
- role: "assistant",
170
- content: "Hello world",
171
- },
172
- error: null,
173
- duration: 824.8056,
174
- userProperties: {
175
- user: "google-oauth2|111840237613341303366",
176
- },
177
- metrics: {},
178
- feedback: {},
179
- metadata: {},
180
- startTime: 1712025501605,
181
- endTime: 1712025499832,
182
- },
183
- });
184
- } catch (err) {
185
- if (err instanceof errors.SDKError) {
186
- console.error(err); // handle exception
187
- throw err;
188
- }
165
+ const sdk = new HoneyHive({
166
+ bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
167
+ });
168
+
169
+
170
+ let res;
171
+ try {
172
+ res = await sdk.session.startSession({
173
+ session: {
174
+ project: "Simple RAG Project",
175
+ sessionName: "Playground Session",
176
+ source: "playground",
177
+ sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
178
+ childrenIds: [
179
+ "7f22137a-6911-4ed3-bc36-110f1dde6b66",
180
+ ],
181
+ config: {
182
+ "key": "<value>",
183
+ },
184
+ inputs: {
185
+ "context": "Hello world",
186
+ "question": "What is in the context?",
187
+ "chat_history": [
188
+ {
189
+ "role": "system",
190
+ "content": "Answer the user's question only using provided context.
191
+
192
+ Context: Hello world",
193
+ },
194
+ {
195
+ "role": "user",
196
+ "content": "What is in the context?",
197
+ },
198
+ ],
199
+ },
200
+ outputs: {
201
+ "role": "assistant",
202
+ "content": "Hello world",
203
+ },
204
+ error: null,
205
+ duration: 824.8056,
206
+ userProperties: {
207
+ "user": "google-oauth2|111840237613341303366",
208
+ },
209
+ metrics: {
210
+
211
+ },
212
+ feedback: {
213
+
214
+ },
215
+ metadata: {
216
+
217
+ },
218
+ startTime: 1712025501605,
219
+ endTime: 1712025499832,
220
+ },
221
+ });
222
+ } catch (err) {
223
+ if (err instanceof errors.SDKError) {
224
+ console.error(err) // handle exception
225
+ throw err;
189
226
  }
227
+ }
190
228
 
191
- if (res.statusCode == 200) {
192
- // handle response
193
- }
229
+ if (res.statusCode == 200) {
230
+ // handle response
231
+ }
194
232
  }
195
233
 
196
234
  run();
197
-
198
235
  ```
199
236
  <!-- End Error Handling [errors] -->
200
237
 
@@ -215,50 +252,68 @@ You can override the default server globally by passing a server index to the `s
215
252
  import { HoneyHive } from "honeyhive";
216
253
 
217
254
  async function run() {
218
- const sdk = new HoneyHive({
219
- serverIdx: 0,
220
- bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
221
- });
222
-
223
- const res = await sdk.session.startSession({
224
- session: {
225
- project: "Simple RAG Project",
226
- sessionName: "Playground Session",
227
- source: "playground",
228
- sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
229
- childrenIds: ["7f22137a-6911-4ed3-bc36-110f1dde6b66"],
230
- config: {
231
- key: "<value>",
232
- },
233
- inputs: {
234
- context: "Hello world",
235
- question: "What is in the context?",
236
- chat_history: "<value>",
237
- },
238
- outputs: {
239
- role: "assistant",
240
- content: "Hello world",
241
- },
242
- error: null,
243
- duration: 824.8056,
244
- userProperties: {
245
- user: "google-oauth2|111840237613341303366",
246
- },
247
- metrics: {},
248
- feedback: {},
249
- metadata: {},
250
- startTime: 1712025501605,
251
- endTime: 1712025499832,
252
- },
253
- });
254
-
255
- if (res.statusCode == 200) {
256
- // handle response
257
- }
255
+ const sdk = new HoneyHive({
256
+ serverIdx: 0,
257
+ bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
258
+ });
259
+
260
+ const res = await sdk.session.startSession({
261
+ session: {
262
+ project: "Simple RAG Project",
263
+ sessionName: "Playground Session",
264
+ source: "playground",
265
+ sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
266
+ childrenIds: [
267
+ "7f22137a-6911-4ed3-bc36-110f1dde6b66",
268
+ ],
269
+ config: {
270
+ "key": "<value>",
271
+ },
272
+ inputs: {
273
+ "context": "Hello world",
274
+ "question": "What is in the context?",
275
+ "chat_history": [
276
+ {
277
+ "role": "system",
278
+ "content": "Answer the user's question only using provided context.
279
+
280
+ Context: Hello world",
281
+ },
282
+ {
283
+ "role": "user",
284
+ "content": "What is in the context?",
285
+ },
286
+ ],
287
+ },
288
+ outputs: {
289
+ "role": "assistant",
290
+ "content": "Hello world",
291
+ },
292
+ error: null,
293
+ duration: 824.8056,
294
+ userProperties: {
295
+ "user": "google-oauth2|111840237613341303366",
296
+ },
297
+ metrics: {
298
+
299
+ },
300
+ feedback: {
301
+
302
+ },
303
+ metadata: {
304
+
305
+ },
306
+ startTime: 1712025501605,
307
+ endTime: 1712025499832,
308
+ },
309
+ });
310
+
311
+ if (res.statusCode == 200) {
312
+ // handle response
313
+ }
258
314
  }
259
315
 
260
316
  run();
261
-
262
317
  ```
263
318
 
264
319
 
@@ -269,50 +324,68 @@ The default server can also be overridden globally by passing a URL to the `serv
269
324
  import { HoneyHive } from "honeyhive";
270
325
 
271
326
  async function run() {
272
- const sdk = new HoneyHive({
273
- serverURL: "https://api.honeyhive.ai",
274
- bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
275
- });
276
-
277
- const res = await sdk.session.startSession({
278
- session: {
279
- project: "Simple RAG Project",
280
- sessionName: "Playground Session",
281
- source: "playground",
282
- sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
283
- childrenIds: ["7f22137a-6911-4ed3-bc36-110f1dde6b66"],
284
- config: {
285
- key: "<value>",
286
- },
287
- inputs: {
288
- context: "Hello world",
289
- question: "What is in the context?",
290
- chat_history: "<value>",
291
- },
292
- outputs: {
293
- role: "assistant",
294
- content: "Hello world",
295
- },
296
- error: null,
297
- duration: 824.8056,
298
- userProperties: {
299
- user: "google-oauth2|111840237613341303366",
300
- },
301
- metrics: {},
302
- feedback: {},
303
- metadata: {},
304
- startTime: 1712025501605,
305
- endTime: 1712025499832,
306
- },
307
- });
308
-
309
- if (res.statusCode == 200) {
310
- // handle response
311
- }
327
+ const sdk = new HoneyHive({
328
+ serverURL: "https://api.honeyhive.ai",
329
+ bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
330
+ });
331
+
332
+ const res = await sdk.session.startSession({
333
+ session: {
334
+ project: "Simple RAG Project",
335
+ sessionName: "Playground Session",
336
+ source: "playground",
337
+ sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
338
+ childrenIds: [
339
+ "7f22137a-6911-4ed3-bc36-110f1dde6b66",
340
+ ],
341
+ config: {
342
+ "key": "<value>",
343
+ },
344
+ inputs: {
345
+ "context": "Hello world",
346
+ "question": "What is in the context?",
347
+ "chat_history": [
348
+ {
349
+ "role": "system",
350
+ "content": "Answer the user's question only using provided context.
351
+
352
+ Context: Hello world",
353
+ },
354
+ {
355
+ "role": "user",
356
+ "content": "What is in the context?",
357
+ },
358
+ ],
359
+ },
360
+ outputs: {
361
+ "role": "assistant",
362
+ "content": "Hello world",
363
+ },
364
+ error: null,
365
+ duration: 824.8056,
366
+ userProperties: {
367
+ "user": "google-oauth2|111840237613341303366",
368
+ },
369
+ metrics: {
370
+
371
+ },
372
+ feedback: {
373
+
374
+ },
375
+ metadata: {
376
+
377
+ },
378
+ startTime: 1712025501605,
379
+ endTime: 1712025499832,
380
+ },
381
+ });
382
+
383
+ if (res.statusCode == 200) {
384
+ // handle response
385
+ }
312
386
  }
313
387
 
314
388
  run();
315
-
316
389
  ```
317
390
  <!-- End Server Selection [server] -->
318
391
 
@@ -351,49 +424,67 @@ To authenticate with the API the `bearerAuth` parameter must be set when initial
351
424
  import { HoneyHive } from "honeyhive";
352
425
 
353
426
  async function run() {
354
- const sdk = new HoneyHive({
355
- bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
356
- });
357
-
358
- const res = await sdk.session.startSession({
359
- session: {
360
- project: "Simple RAG Project",
361
- sessionName: "Playground Session",
362
- source: "playground",
363
- sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
364
- childrenIds: ["7f22137a-6911-4ed3-bc36-110f1dde6b66"],
365
- config: {
366
- key: "<value>",
367
- },
368
- inputs: {
369
- context: "Hello world",
370
- question: "What is in the context?",
371
- chat_history: "<value>",
372
- },
373
- outputs: {
374
- role: "assistant",
375
- content: "Hello world",
376
- },
377
- error: null,
378
- duration: 824.8056,
379
- userProperties: {
380
- user: "google-oauth2|111840237613341303366",
381
- },
382
- metrics: {},
383
- feedback: {},
384
- metadata: {},
385
- startTime: 1712025501605,
386
- endTime: 1712025499832,
387
- },
388
- });
389
-
390
- if (res.statusCode == 200) {
391
- // handle response
392
- }
427
+ const sdk = new HoneyHive({
428
+ bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
429
+ });
430
+
431
+ const res = await sdk.session.startSession({
432
+ session: {
433
+ project: "Simple RAG Project",
434
+ sessionName: "Playground Session",
435
+ source: "playground",
436
+ sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
437
+ childrenIds: [
438
+ "7f22137a-6911-4ed3-bc36-110f1dde6b66",
439
+ ],
440
+ config: {
441
+ "key": "<value>",
442
+ },
443
+ inputs: {
444
+ "context": "Hello world",
445
+ "question": "What is in the context?",
446
+ "chat_history": [
447
+ {
448
+ "role": "system",
449
+ "content": "Answer the user's question only using provided context.
450
+
451
+ Context: Hello world",
452
+ },
453
+ {
454
+ "role": "user",
455
+ "content": "What is in the context?",
456
+ },
457
+ ],
458
+ },
459
+ outputs: {
460
+ "role": "assistant",
461
+ "content": "Hello world",
462
+ },
463
+ error: null,
464
+ duration: 824.8056,
465
+ userProperties: {
466
+ "user": "google-oauth2|111840237613341303366",
467
+ },
468
+ metrics: {
469
+
470
+ },
471
+ feedback: {
472
+
473
+ },
474
+ metadata: {
475
+
476
+ },
477
+ startTime: 1712025501605,
478
+ endTime: 1712025499832,
479
+ },
480
+ });
481
+
482
+ if (res.statusCode == 200) {
483
+ // handle response
484
+ }
393
485
  }
394
486
 
395
487
  run();
396
-
397
488
  ```
398
489
  <!-- End Authentication [security] -->
399
490
 
@@ -1,11 +1,4 @@
1
1
  import { SpeakeasyBase } from "../../internal/utils";
2
- /**
3
- * Type of datapoint - "event" or "session"
4
- */
5
- export declare enum CreateDatapointRequestType {
6
- Event = "event",
7
- Session = "session"
8
- }
9
2
  export declare class CreateDatapointRequest extends SpeakeasyBase {
10
3
  /**
11
4
  * UUID for the project to which the datapoint belongs
@@ -16,9 +9,9 @@ export declare class CreateDatapointRequest extends SpeakeasyBase {
16
9
  */
17
10
  inputs: Record<string, any>;
18
11
  /**
19
- * Type of datapoint - "event" or "session"
12
+ * Conversation history associated with the datapoint
20
13
  */
21
- type: CreateDatapointRequestType;
14
+ history?: Record<string, any>[];
22
15
  /**
23
16
  * Expected output JSON object for the datapoint
24
17
  */
@@ -27,10 +20,6 @@ export declare class CreateDatapointRequest extends SpeakeasyBase {
27
20
  * Event id for the event from which the datapoint was created
28
21
  */
29
22
  linkedEvent?: string;
30
- /**
31
- * Ids of evaluations where the datapoint is included
32
- */
33
- linkedEvals?: string[];
34
23
  /**
35
24
  * Ids of all datasets that include the datapoint
36
25
  */
@@ -27,17 +27,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
27
27
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.CreateDatapointRequest = exports.CreateDatapointRequestType = void 0;
30
+ exports.CreateDatapointRequest = void 0;
31
31
  var utils_1 = require("../../internal/utils");
32
32
  var class_transformer_1 = require("class-transformer");
33
- /**
34
- * Type of datapoint - "event" or "session"
35
- */
36
- var CreateDatapointRequestType;
37
- (function (CreateDatapointRequestType) {
38
- CreateDatapointRequestType["Event"] = "event";
39
- CreateDatapointRequestType["Session"] = "session";
40
- })(CreateDatapointRequestType = exports.CreateDatapointRequestType || (exports.CreateDatapointRequestType = {}));
41
33
  var CreateDatapointRequest = /** @class */ (function (_super) {
42
34
  __extends(CreateDatapointRequest, _super);
43
35
  function CreateDatapointRequest() {
@@ -55,9 +47,9 @@ var CreateDatapointRequest = /** @class */ (function (_super) {
55
47
  ], CreateDatapointRequest.prototype, "inputs", void 0);
56
48
  __decorate([
57
49
  (0, utils_1.SpeakeasyMetadata)(),
58
- (0, class_transformer_1.Expose)({ name: "type" }),
59
- __metadata("design:type", String)
60
- ], CreateDatapointRequest.prototype, "type", void 0);
50
+ (0, class_transformer_1.Expose)({ name: "history" }),
51
+ __metadata("design:type", Array)
52
+ ], CreateDatapointRequest.prototype, "history", void 0);
61
53
  __decorate([
62
54
  (0, utils_1.SpeakeasyMetadata)(),
63
55
  (0, class_transformer_1.Expose)({ name: "ground_truth" }),
@@ -68,11 +60,6 @@ var CreateDatapointRequest = /** @class */ (function (_super) {
68
60
  (0, class_transformer_1.Expose)({ name: "linked_event" }),
69
61
  __metadata("design:type", String)
70
62
  ], CreateDatapointRequest.prototype, "linkedEvent", void 0);
71
- __decorate([
72
- (0, utils_1.SpeakeasyMetadata)(),
73
- (0, class_transformer_1.Expose)({ name: "linked_evals" }),
74
- __metadata("design:type", Array)
75
- ], CreateDatapointRequest.prototype, "linkedEvals", void 0);
76
63
  __decorate([
77
64
  (0, utils_1.SpeakeasyMetadata)(),
78
65
  (0, class_transformer_1.Expose)({ name: "linked_datasets" }),
@@ -22,14 +22,6 @@ export declare class UpdateDatapointRequest extends SpeakeasyBase {
22
22
  * Ids of all datasets that include the datapoint
23
23
  */
24
24
  linkedDatasets?: string[];
25
- /**
26
- * Whether the datapoint is saved or detected
27
- */
28
- saved?: boolean;
29
- /**
30
- * session or event - specify the type of datapoint
31
- */
32
- type?: string;
33
25
  /**
34
26
  * Any additional metadata for the datapoint
35
27
  */
@@ -69,16 +69,6 @@ var UpdateDatapointRequest = /** @class */ (function (_super) {
69
69
  (0, class_transformer_1.Expose)({ name: "linked_datasets" }),
70
70
  __metadata("design:type", Array)
71
71
  ], UpdateDatapointRequest.prototype, "linkedDatasets", void 0);
72
- __decorate([
73
- (0, utils_1.SpeakeasyMetadata)(),
74
- (0, class_transformer_1.Expose)({ name: "saved" }),
75
- __metadata("design:type", Boolean)
76
- ], UpdateDatapointRequest.prototype, "saved", void 0);
77
- __decorate([
78
- (0, utils_1.SpeakeasyMetadata)(),
79
- (0, class_transformer_1.Expose)({ name: "type" }),
80
- __metadata("design:type", String)
81
- ], UpdateDatapointRequest.prototype, "type", void 0);
82
72
  __decorate([
83
73
  (0, utils_1.SpeakeasyMetadata)(),
84
74
  (0, class_transformer_1.Expose)({ name: "metadata" }),