honeyhive 0.6.1 → 0.6.3
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/dist/models/components/datapoint.d.ts +2 -9
- package/dist/models/components/datapoint.js +3 -24
- package/dist/models/components/updatedatapointrequest.d.ts +1 -3
- package/dist/models/components/updatedatapointrequest.js +2 -11
- package/dist/models/operations/adddatapoints.d.ts +3 -3
- package/dist/models/operations/createmodelevent.d.ts +1 -1
- package/dist/models/operations/createmodelevent.js +2 -2
- package/dist/models/operations/updateevent.d.ts +3 -0
- package/dist/models/operations/updateevent.js +15 -0
- package/dist/sdk/sdk.js +3 -3
- package/dist/sdk/tracer.d.ts +11 -1
- package/dist/sdk/tracer.js +138 -0
- package/docs/models/components/datapoint.md +2 -2
- package/docs/models/components/updatedatapointrequest.md +8 -8
- package/docs/models/operations/adddatapointsrequestbody.md +3 -3
- package/docs/models/operations/createmodeleventrequestbody.md +1 -1
- package/docs/models/operations/updateeventrequestbody.md +4 -1
- package/docs/sdks/datapoints/README.md +9 -3
- package/docs/sdks/datasets/README.md +1 -0
- package/docs/sdks/events/README.md +7 -1
- package/package.json +1 -1
- package/docs/models/components/history.md +0 -7
- package/docs/models/components/inputs.md +0 -9
- package/docs/models/components/updatedatapointrequesthistory.md +0 -7
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { SpeakeasyBase } from "../../internal/utils";
|
|
2
|
-
/**
|
|
3
|
-
* Arbitrary JSON object containing the inputs for the datapoint
|
|
4
|
-
*/
|
|
5
|
-
export declare class Inputs extends SpeakeasyBase {
|
|
6
|
-
}
|
|
7
|
-
export declare class History extends SpeakeasyBase {
|
|
8
|
-
}
|
|
9
2
|
export declare class Datapoint extends SpeakeasyBase {
|
|
10
3
|
/**
|
|
11
4
|
* UUID for the datapoint
|
|
@@ -21,11 +14,11 @@ export declare class Datapoint extends SpeakeasyBase {
|
|
|
21
14
|
/**
|
|
22
15
|
* Arbitrary JSON object containing the inputs for the datapoint
|
|
23
16
|
*/
|
|
24
|
-
inputs?:
|
|
17
|
+
inputs?: Record<string, any>;
|
|
25
18
|
/**
|
|
26
19
|
* Conversation history associated with the datapoint
|
|
27
20
|
*/
|
|
28
|
-
history?:
|
|
21
|
+
history?: Record<string, any>[];
|
|
29
22
|
groundTruth?: Record<string, any>;
|
|
30
23
|
/**
|
|
31
24
|
* Event id for the event from which the datapoint was created
|
|
@@ -27,28 +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.Datapoint =
|
|
30
|
+
exports.Datapoint = void 0;
|
|
31
31
|
var utils_1 = require("../../internal/utils");
|
|
32
32
|
var class_transformer_1 = require("class-transformer");
|
|
33
|
-
/**
|
|
34
|
-
* Arbitrary JSON object containing the inputs for the datapoint
|
|
35
|
-
*/
|
|
36
|
-
var Inputs = /** @class */ (function (_super) {
|
|
37
|
-
__extends(Inputs, _super);
|
|
38
|
-
function Inputs() {
|
|
39
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
-
}
|
|
41
|
-
return Inputs;
|
|
42
|
-
}(utils_1.SpeakeasyBase));
|
|
43
|
-
exports.Inputs = Inputs;
|
|
44
|
-
var History = /** @class */ (function (_super) {
|
|
45
|
-
__extends(History, _super);
|
|
46
|
-
function History() {
|
|
47
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
48
|
-
}
|
|
49
|
-
return History;
|
|
50
|
-
}(utils_1.SpeakeasyBase));
|
|
51
|
-
exports.History = History;
|
|
52
33
|
var Datapoint = /** @class */ (function (_super) {
|
|
53
34
|
__extends(Datapoint, _super);
|
|
54
35
|
function Datapoint() {
|
|
@@ -90,13 +71,11 @@ var Datapoint = /** @class */ (function (_super) {
|
|
|
90
71
|
__decorate([
|
|
91
72
|
(0, utils_1.SpeakeasyMetadata)(),
|
|
92
73
|
(0, class_transformer_1.Expose)({ name: "inputs" }),
|
|
93
|
-
(
|
|
94
|
-
__metadata("design:type", Inputs)
|
|
74
|
+
__metadata("design:type", Object)
|
|
95
75
|
], Datapoint.prototype, "inputs", void 0);
|
|
96
76
|
__decorate([
|
|
97
|
-
(0, utils_1.SpeakeasyMetadata)(
|
|
77
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
98
78
|
(0, class_transformer_1.Expose)({ name: "history" }),
|
|
99
|
-
(0, class_transformer_1.Type)(function () { return History; }),
|
|
100
79
|
__metadata("design:type", Array)
|
|
101
80
|
], Datapoint.prototype, "history", void 0);
|
|
102
81
|
__decorate([
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { SpeakeasyBase } from "../../internal/utils";
|
|
2
|
-
export declare class UpdateDatapointRequestHistory extends SpeakeasyBase {
|
|
3
|
-
}
|
|
4
2
|
export declare class UpdateDatapointRequest extends SpeakeasyBase {
|
|
5
3
|
/**
|
|
6
4
|
* Arbitrary JSON object containing the inputs for the datapoint
|
|
@@ -9,7 +7,7 @@ export declare class UpdateDatapointRequest extends SpeakeasyBase {
|
|
|
9
7
|
/**
|
|
10
8
|
* Conversation history associated with the datapoint
|
|
11
9
|
*/
|
|
12
|
-
history?:
|
|
10
|
+
history?: Record<string, any>[];
|
|
13
11
|
/**
|
|
14
12
|
* Expected output JSON object for the datapoint
|
|
15
13
|
*/
|
|
@@ -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.UpdateDatapointRequest =
|
|
30
|
+
exports.UpdateDatapointRequest = void 0;
|
|
31
31
|
var utils_1 = require("../../internal/utils");
|
|
32
32
|
var class_transformer_1 = require("class-transformer");
|
|
33
|
-
var UpdateDatapointRequestHistory = /** @class */ (function (_super) {
|
|
34
|
-
__extends(UpdateDatapointRequestHistory, _super);
|
|
35
|
-
function UpdateDatapointRequestHistory() {
|
|
36
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
37
|
-
}
|
|
38
|
-
return UpdateDatapointRequestHistory;
|
|
39
|
-
}(utils_1.SpeakeasyBase));
|
|
40
|
-
exports.UpdateDatapointRequestHistory = UpdateDatapointRequestHistory;
|
|
41
33
|
var UpdateDatapointRequest = /** @class */ (function (_super) {
|
|
42
34
|
__extends(UpdateDatapointRequest, _super);
|
|
43
35
|
function UpdateDatapointRequest() {
|
|
@@ -49,9 +41,8 @@ var UpdateDatapointRequest = /** @class */ (function (_super) {
|
|
|
49
41
|
__metadata("design:type", Object)
|
|
50
42
|
], UpdateDatapointRequest.prototype, "inputs", void 0);
|
|
51
43
|
__decorate([
|
|
52
|
-
(0, utils_1.SpeakeasyMetadata)(
|
|
44
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
53
45
|
(0, class_transformer_1.Expose)({ name: "history" }),
|
|
54
|
-
(0, class_transformer_1.Type)(function () { return UpdateDatapointRequestHistory; }),
|
|
55
46
|
__metadata("design:type", Array)
|
|
56
47
|
], UpdateDatapointRequest.prototype, "history", void 0);
|
|
57
48
|
__decorate([
|
|
@@ -21,15 +21,15 @@ export declare class AddDatapointsRequestBody extends SpeakeasyBase {
|
|
|
21
21
|
/**
|
|
22
22
|
* Name of the project associated with this dataset like `New Project`
|
|
23
23
|
*/
|
|
24
|
-
project
|
|
24
|
+
project: string;
|
|
25
25
|
/**
|
|
26
26
|
* List of JSON objects to be added as datapoints
|
|
27
27
|
*/
|
|
28
|
-
data
|
|
28
|
+
data: Record<string, any>[];
|
|
29
29
|
/**
|
|
30
30
|
* Mapping of keys in the data object to be used as inputs, ground truth, and history, everything else goes into metadata
|
|
31
31
|
*/
|
|
32
|
-
mapping
|
|
32
|
+
mapping: Mapping;
|
|
33
33
|
}
|
|
34
34
|
export declare class AddDatapointsRequest extends SpeakeasyBase {
|
|
35
35
|
/**
|
|
@@ -2,7 +2,7 @@ import { SpeakeasyBase } from "../../internal/utils";
|
|
|
2
2
|
import * as components from "../../models/components";
|
|
3
3
|
import { AxiosResponse } from "axios";
|
|
4
4
|
export declare class CreateModelEventRequestBody extends SpeakeasyBase {
|
|
5
|
-
|
|
5
|
+
modelEvent?: components.CreateModelEvent;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Model event created
|
|
@@ -61,10 +61,10 @@ var CreateModelEventRequestBody = /** @class */ (function (_super) {
|
|
|
61
61
|
}
|
|
62
62
|
__decorate([
|
|
63
63
|
(0, utils_1.SpeakeasyMetadata)(),
|
|
64
|
-
(0, class_transformer_1.Expose)({ name: "
|
|
64
|
+
(0, class_transformer_1.Expose)({ name: "model_event" }),
|
|
65
65
|
(0, class_transformer_1.Type)(function () { return components.CreateModelEvent; }),
|
|
66
66
|
__metadata("design:type", components.CreateModelEvent)
|
|
67
|
-
], CreateModelEventRequestBody.prototype, "
|
|
67
|
+
], CreateModelEventRequestBody.prototype, "modelEvent", void 0);
|
|
68
68
|
return CreateModelEventRequestBody;
|
|
69
69
|
}(utils_1.SpeakeasyBase));
|
|
70
70
|
exports.CreateModelEventRequestBody = CreateModelEventRequestBody;
|
|
@@ -6,6 +6,9 @@ export declare class UpdateEventRequestBody extends SpeakeasyBase {
|
|
|
6
6
|
feedback?: Record<string, any>;
|
|
7
7
|
metrics?: Record<string, any>;
|
|
8
8
|
outputs?: Record<string, any>;
|
|
9
|
+
config?: Record<string, any>;
|
|
10
|
+
userProperties?: Record<string, any>;
|
|
11
|
+
duration?: number;
|
|
9
12
|
}
|
|
10
13
|
export declare class UpdateEventResponse extends SpeakeasyBase {
|
|
11
14
|
/**
|
|
@@ -60,6 +60,21 @@ var UpdateEventRequestBody = /** @class */ (function (_super) {
|
|
|
60
60
|
(0, class_transformer_1.Expose)({ name: "outputs" }),
|
|
61
61
|
__metadata("design:type", Object)
|
|
62
62
|
], UpdateEventRequestBody.prototype, "outputs", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
65
|
+
(0, class_transformer_1.Expose)({ name: "config" }),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], UpdateEventRequestBody.prototype, "config", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
70
|
+
(0, class_transformer_1.Expose)({ name: "user_properties" }),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], UpdateEventRequestBody.prototype, "userProperties", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
75
|
+
(0, class_transformer_1.Expose)({ name: "duration" }),
|
|
76
|
+
__metadata("design:type", Number)
|
|
77
|
+
], UpdateEventRequestBody.prototype, "duration", void 0);
|
|
63
78
|
return UpdateEventRequestBody;
|
|
64
79
|
}(utils_1.SpeakeasyBase));
|
|
65
80
|
exports.UpdateEventRequestBody = UpdateEventRequestBody;
|
package/dist/sdk/sdk.js
CHANGED
|
@@ -49,9 +49,9 @@ var SDKConfiguration = /** @class */ (function () {
|
|
|
49
49
|
function SDKConfiguration(init) {
|
|
50
50
|
this.language = "typescript";
|
|
51
51
|
this.openapiDocVersion = "1.0.1";
|
|
52
|
-
this.sdkVersion = "0.4.
|
|
53
|
-
this.genVersion = "2.
|
|
54
|
-
this.userAgent = "speakeasy-sdk/typescript 0.4.
|
|
52
|
+
this.sdkVersion = "0.4.6";
|
|
53
|
+
this.genVersion = "2.347.4";
|
|
54
|
+
this.userAgent = "speakeasy-sdk/typescript 0.4.6 2.347.4 1.0.1 honeyhive";
|
|
55
55
|
Object.assign(this, init);
|
|
56
56
|
}
|
|
57
57
|
return SDKConfiguration;
|
package/dist/sdk/tracer.d.ts
CHANGED
|
@@ -5,12 +5,22 @@ interface InitParams {
|
|
|
5
5
|
source: string;
|
|
6
6
|
serverUrl?: string;
|
|
7
7
|
}
|
|
8
|
+
interface InitSessionIdParams {
|
|
9
|
+
apiKey: string;
|
|
10
|
+
sessionId: string;
|
|
11
|
+
serverUrl?: string;
|
|
12
|
+
}
|
|
8
13
|
export declare class HoneyHiveTracer {
|
|
9
14
|
private sdk;
|
|
10
|
-
|
|
15
|
+
sessionId: string | undefined;
|
|
11
16
|
private constructor();
|
|
12
17
|
private initSession;
|
|
18
|
+
private initSessionFromId;
|
|
13
19
|
static init({ apiKey, project, sessionName, source, serverUrl, }: InitParams): Promise<HoneyHiveTracer>;
|
|
20
|
+
static initFromSessionId({ apiKey, sessionId, serverUrl, }: InitSessionIdParams): Promise<HoneyHiveTracer>;
|
|
21
|
+
setFeedback(feedback: Record<string, any>): Promise<void>;
|
|
22
|
+
setMetric(metrics: Record<string, any>): Promise<void>;
|
|
23
|
+
setMetadata(metadata: Record<string, any>): Promise<void>;
|
|
14
24
|
trace(fn: () => void): void;
|
|
15
25
|
}
|
|
16
26
|
export {};
|
package/dist/sdk/tracer.js
CHANGED
|
@@ -131,6 +131,34 @@ var HoneyHiveTracer = /** @class */ (function () {
|
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
133
|
};
|
|
134
|
+
HoneyHiveTracer.prototype.initSessionFromId = function (sessionId, apiKey, serverUrl) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
136
|
+
return __generator(this, function (_a) {
|
|
137
|
+
this.sessionId = sessionId;
|
|
138
|
+
traceloop.initialize({
|
|
139
|
+
baseUrl: "".concat(serverUrl, "/opentelemetry"),
|
|
140
|
+
apiKey: apiKey,
|
|
141
|
+
disableBatch: true,
|
|
142
|
+
instrumentModules: {
|
|
143
|
+
openAI: openai_1.default,
|
|
144
|
+
anthropic: anthropic,
|
|
145
|
+
azureOpenAI: azureOpenAI,
|
|
146
|
+
cohere: cohere,
|
|
147
|
+
bedrock: bedrock,
|
|
148
|
+
google_aiplatform: google_aiplatform,
|
|
149
|
+
pinecone: pinecone,
|
|
150
|
+
langchain: {
|
|
151
|
+
chainsModule: ChainsModule,
|
|
152
|
+
agentsModule: AgentsModule,
|
|
153
|
+
toolsModule: ToolsModule,
|
|
154
|
+
},
|
|
155
|
+
chromadb: chromadb,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
return [2 /*return*/];
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
};
|
|
134
162
|
HoneyHiveTracer.init = function (_a) {
|
|
135
163
|
var apiKey = _a.apiKey, project = _a.project, sessionName = _a.sessionName, source = _a.source, _b = _a.serverUrl, serverUrl = _b === void 0 ? "https://api.honeyhive.ai" : _b;
|
|
136
164
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -151,6 +179,116 @@ var HoneyHiveTracer = /** @class */ (function () {
|
|
|
151
179
|
});
|
|
152
180
|
});
|
|
153
181
|
};
|
|
182
|
+
HoneyHiveTracer.initFromSessionId = function (_a) {
|
|
183
|
+
var apiKey = _a.apiKey, sessionId = _a.sessionId, _b = _a.serverUrl, serverUrl = _b === void 0 ? "https://api.honeyhive.ai" : _b;
|
|
184
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
185
|
+
var sdk, tracer;
|
|
186
|
+
return __generator(this, function (_c) {
|
|
187
|
+
switch (_c.label) {
|
|
188
|
+
case 0:
|
|
189
|
+
sdk = new sdk_1.HoneyHive({
|
|
190
|
+
bearerAuth: apiKey,
|
|
191
|
+
serverURL: serverUrl,
|
|
192
|
+
});
|
|
193
|
+
tracer = new HoneyHiveTracer(sdk);
|
|
194
|
+
return [4 /*yield*/, tracer.initSessionFromId(sessionId, apiKey, serverUrl)];
|
|
195
|
+
case 1:
|
|
196
|
+
_c.sent();
|
|
197
|
+
return [2 /*return*/, tracer];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
HoneyHiveTracer.prototype.setFeedback = function (feedback) {
|
|
203
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
204
|
+
var error_2;
|
|
205
|
+
return __generator(this, function (_a) {
|
|
206
|
+
switch (_a.label) {
|
|
207
|
+
case 0:
|
|
208
|
+
if (!this.sessionId) return [3 /*break*/, 5];
|
|
209
|
+
_a.label = 1;
|
|
210
|
+
case 1:
|
|
211
|
+
_a.trys.push([1, 3, , 4]);
|
|
212
|
+
return [4 /*yield*/, this.sdk.events.updateEvent({
|
|
213
|
+
eventId: this.sessionId,
|
|
214
|
+
feedback: feedback
|
|
215
|
+
})];
|
|
216
|
+
case 2:
|
|
217
|
+
_a.sent();
|
|
218
|
+
return [3 /*break*/, 4];
|
|
219
|
+
case 3:
|
|
220
|
+
error_2 = _a.sent();
|
|
221
|
+
console.error("Failed to set feedback:", error_2);
|
|
222
|
+
return [3 /*break*/, 4];
|
|
223
|
+
case 4: return [3 /*break*/, 6];
|
|
224
|
+
case 5:
|
|
225
|
+
console.error("Session ID is not initialized");
|
|
226
|
+
_a.label = 6;
|
|
227
|
+
case 6: return [2 /*return*/];
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
HoneyHiveTracer.prototype.setMetric = function (metrics) {
|
|
233
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
234
|
+
var error_3;
|
|
235
|
+
return __generator(this, function (_a) {
|
|
236
|
+
switch (_a.label) {
|
|
237
|
+
case 0:
|
|
238
|
+
if (!this.sessionId) return [3 /*break*/, 5];
|
|
239
|
+
_a.label = 1;
|
|
240
|
+
case 1:
|
|
241
|
+
_a.trys.push([1, 3, , 4]);
|
|
242
|
+
return [4 /*yield*/, this.sdk.events.updateEvent({
|
|
243
|
+
eventId: this.sessionId,
|
|
244
|
+
metrics: metrics
|
|
245
|
+
})];
|
|
246
|
+
case 2:
|
|
247
|
+
_a.sent();
|
|
248
|
+
return [3 /*break*/, 4];
|
|
249
|
+
case 3:
|
|
250
|
+
error_3 = _a.sent();
|
|
251
|
+
console.error("Failed to set metric:", error_3);
|
|
252
|
+
return [3 /*break*/, 4];
|
|
253
|
+
case 4: return [3 /*break*/, 6];
|
|
254
|
+
case 5:
|
|
255
|
+
console.error("Session ID is not initialized");
|
|
256
|
+
_a.label = 6;
|
|
257
|
+
case 6: return [2 /*return*/];
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
HoneyHiveTracer.prototype.setMetadata = function (metadata) {
|
|
263
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
264
|
+
var error_4;
|
|
265
|
+
return __generator(this, function (_a) {
|
|
266
|
+
switch (_a.label) {
|
|
267
|
+
case 0:
|
|
268
|
+
if (!this.sessionId) return [3 /*break*/, 5];
|
|
269
|
+
_a.label = 1;
|
|
270
|
+
case 1:
|
|
271
|
+
_a.trys.push([1, 3, , 4]);
|
|
272
|
+
return [4 /*yield*/, this.sdk.events.updateEvent({
|
|
273
|
+
eventId: this.sessionId,
|
|
274
|
+
metadata: metadata
|
|
275
|
+
})];
|
|
276
|
+
case 2:
|
|
277
|
+
_a.sent();
|
|
278
|
+
return [3 /*break*/, 4];
|
|
279
|
+
case 3:
|
|
280
|
+
error_4 = _a.sent();
|
|
281
|
+
console.error("Failed to set metadata:", error_4);
|
|
282
|
+
return [3 /*break*/, 4];
|
|
283
|
+
case 4: return [3 /*break*/, 6];
|
|
284
|
+
case 5:
|
|
285
|
+
console.error("Session ID is not initialized");
|
|
286
|
+
_a.label = 6;
|
|
287
|
+
case 6: return [2 /*return*/];
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
};
|
|
154
292
|
HoneyHiveTracer.prototype.trace = function (fn) {
|
|
155
293
|
if (this.sessionId) {
|
|
156
294
|
traceloop.withAssociationProperties({
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
| `projectId` | *string* | :heavy_minus_sign: | UUID for the project where the datapoint is stored |
|
|
11
11
|
| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A |
|
|
12
12
|
| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A |
|
|
13
|
-
| `inputs` |
|
|
14
|
-
| `history` | [
|
|
13
|
+
| `inputs` | Record<string, *any*> | :heavy_minus_sign: | Arbitrary JSON object containing the inputs for the datapoint |
|
|
14
|
+
| `history` | Record<string, *any*>[] | :heavy_minus_sign: | Conversation history associated with the datapoint |
|
|
15
15
|
| `groundTruth` | Record<string, *any*> | :heavy_minus_sign: | N/A |
|
|
16
16
|
| `linkedEvent` | *string* | :heavy_minus_sign: | Event id for the event from which the datapoint was created |
|
|
17
17
|
| `linkedEvals` | *string*[] | :heavy_minus_sign: | Ids of evaluations where the datapoint is included |
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
## Fields
|
|
5
5
|
|
|
6
|
-
| Field
|
|
7
|
-
|
|
|
8
|
-
| `inputs`
|
|
9
|
-
| `history`
|
|
10
|
-
| `groundTruth`
|
|
11
|
-
| `linkedEvals`
|
|
12
|
-
| `linkedDatasets`
|
|
13
|
-
| `metadata`
|
|
6
|
+
| Field | Type | Required | Description |
|
|
7
|
+
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
8
|
+
| `inputs` | Record<string, *any*> | :heavy_minus_sign: | Arbitrary JSON object containing the inputs for the datapoint |
|
|
9
|
+
| `history` | Record<string, *any*>[] | :heavy_minus_sign: | Conversation history associated with the datapoint |
|
|
10
|
+
| `groundTruth` | Record<string, *any*> | :heavy_minus_sign: | Expected output JSON object for the datapoint |
|
|
11
|
+
| `linkedEvals` | *string*[] | :heavy_minus_sign: | Ids of evaluations where the datapoint is included |
|
|
12
|
+
| `linkedDatasets` | *string*[] | :heavy_minus_sign: | Ids of all datasets that include the datapoint |
|
|
13
|
+
| `metadata` | Record<string, *any*> | :heavy_minus_sign: | Any additional metadata for the datapoint |
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
| Field | Type | Required | Description |
|
|
7
7
|
| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
8
|
-
| `project` | *string* | :
|
|
9
|
-
| `data` | Record<string, *any*>[] | :
|
|
10
|
-
| `mapping` | [operations.Mapping](../../models/operations/mapping.md) | :
|
|
8
|
+
| `project` | *string* | :heavy_check_mark: | Name of the project associated with this dataset like `New Project` |
|
|
9
|
+
| `data` | Record<string, *any*>[] | :heavy_check_mark: | List of JSON objects to be added as datapoints |
|
|
10
|
+
| `mapping` | [operations.Mapping](../../models/operations/mapping.md) | :heavy_check_mark: | Mapping of keys in the data object to be used as inputs, ground truth, and history, everything else goes into metadata |
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
|
|
6
6
|
| Field | Type | Required | Description | Example |
|
|
7
7
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
8
|
-
| `
|
|
8
|
+
| `modelEvent` | [components.CreateModelEvent](../../models/components/createmodelevent.md) | :heavy_minus_sign: | N/A | {<br/>"project": "New Project",<br/>"model": "gpt-4o",<br/>"provider": "openai",<br/>"messages": [<br/>{<br/>"role": "system",<br/>"content": "Hello, world!"<br/>}<br/>],<br/>"response": {<br/>"role": "assistant",<br/>"content": "Hello, world!"<br/>},<br/>"duration": 42,<br/>"usage": {<br/>"prompt_tokens": 10,<br/>"completion_tokens": 10,<br/>"total_tokens": 20<br/>},<br/>"cost": 0.00008,<br/>"error": null,<br/>"source": "playground",<br/>"event_name": "Model Completion",<br/>"hyperparameters": {<br/>"temperature": 0,<br/>"top_p": 1,<br/>"max_tokens": 1000,<br/>"presence_penalty": 0,<br/>"frequency_penalty": 0,<br/>"stop": [],<br/>"n": 1<br/>},<br/>"template": [<br/>{<br/>"role": "system",<br/>"content": "Hello, {{ name }}!"<br/>}<br/>],<br/>"template_inputs": {<br/>"name": "world"<br/>},<br/>"tools": {<br/>"type": "function",<br/>"function": {<br/>"name": "get_current_weather",<br/>"description": "Get the current weather",<br/>"parameters": {<br/>"type": "object",<br/>"properties": {<br/>"location": {<br/>"type": "string",<br/>"description": "The city and state, e.g. San Francisco, CA"<br/>},<br/>"format": {<br/>"type": "string",<br/>"enum": [<br/>"celsius",<br/>"fahrenheit"<br/>],<br/>"description": "The temperature unit to use. Infer this from the users location."<br/>}<br/>},<br/>"required": [<br/>"location",<br/>"format"<br/>]<br/>}<br/>}<br/>},<br/>"tool_choice": "none",<br/>"response_format": {<br/>"type": "text"<br/>}<br/>} |
|
|
@@ -9,4 +9,7 @@
|
|
|
9
9
|
| `metadata` | Record<string, *any*> | :heavy_minus_sign: | N/A |
|
|
10
10
|
| `feedback` | Record<string, *any*> | :heavy_minus_sign: | N/A |
|
|
11
11
|
| `metrics` | Record<string, *any*> | :heavy_minus_sign: | N/A |
|
|
12
|
-
| `outputs` | Record<string, *any*> | :heavy_minus_sign: | N/A |
|
|
12
|
+
| `outputs` | Record<string, *any*> | :heavy_minus_sign: | N/A |
|
|
13
|
+
| `config` | Record<string, *any*> | :heavy_minus_sign: | N/A |
|
|
14
|
+
| `userProperties` | Record<string, *any*> | :heavy_minus_sign: | N/A |
|
|
15
|
+
| `duration` | *number* | :heavy_minus_sign: | N/A |
|
|
@@ -179,7 +179,7 @@ Update a specific datapoint
|
|
|
179
179
|
|
|
180
180
|
```typescript
|
|
181
181
|
import { HoneyHive } from "honeyhive";
|
|
182
|
-
import { UpdateDatapointRequest
|
|
182
|
+
import { UpdateDatapointRequest } from "honeyhive/dist/models/components";
|
|
183
183
|
import { UpdateDatapointRequest } from "honeyhive/dist/models/operations";
|
|
184
184
|
|
|
185
185
|
async function run() {
|
|
@@ -192,8 +192,14 @@ const updateDatapointRequest: UpdateDatapointRequest = {
|
|
|
192
192
|
"query": "what's the temperature in Reykjavik?",
|
|
193
193
|
},
|
|
194
194
|
history: [
|
|
195
|
-
{
|
|
196
|
-
|
|
195
|
+
{
|
|
196
|
+
"role": "system",
|
|
197
|
+
"content": "You are a helpful web assistant that helps users answer questions about the world based on the information provided to you by Google's search API. Answer the questions as truthfully as you can. In case you are unsure about the correct answer, please respond with \"I apologize but I'm not sure.\"",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"role": "user",
|
|
201
|
+
"content": "what's the temperature in Reykjavik?\n\n\n--Google search API results below:---\n\n\"snippet\":\"2 Week Extended Forecast in Reykjavik, Iceland ; Feb 4, 29 / 20 °F · Snow showers early. Broken clouds. ; Feb 5, 27 / 16 °F · Light snow. Decreasing cloudiness.\",\"snippet_highlighted_words\":[\"Feb 4, 29 / 20 °F\"]",
|
|
202
|
+
},
|
|
197
203
|
],
|
|
198
204
|
groundTruth: {
|
|
199
205
|
"role": "assistant",
|
|
@@ -163,6 +163,12 @@ async function run() {
|
|
|
163
163
|
outputs: {
|
|
164
164
|
"key": "<value>",
|
|
165
165
|
},
|
|
166
|
+
config: {
|
|
167
|
+
"key": "<value>",
|
|
168
|
+
},
|
|
169
|
+
userProperties: {
|
|
170
|
+
"key": "<value>",
|
|
171
|
+
},
|
|
166
172
|
});
|
|
167
173
|
|
|
168
174
|
if (res.statusCode == 200) {
|
|
@@ -258,7 +264,7 @@ async function run() {
|
|
|
258
264
|
});
|
|
259
265
|
|
|
260
266
|
const res = await sdk.events.createModelEvent({
|
|
261
|
-
|
|
267
|
+
modelEvent: {
|
|
262
268
|
project: "New Project",
|
|
263
269
|
model: "gpt-4o",
|
|
264
270
|
provider: "openai",
|
package/package.json
CHANGED