honeyhive 0.5.1 → 0.6.1
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/README.md +355 -210
- package/dist/models/components/chatcompletionrequest.d.ts +37 -0
- package/dist/models/components/chatcompletionrequest.js +90 -0
- package/dist/models/components/chatcompletionresponse.d.ts +10 -0
- package/dist/models/components/chatcompletionresponse.js +79 -0
- package/dist/models/components/createdatapointrequest.d.ts +1 -1
- package/dist/models/components/createdatasetrequest.d.ts +1 -1
- package/dist/models/components/createmodelevent.d.ts +71 -0
- package/dist/models/components/createmodelevent.js +125 -0
- package/dist/models/components/createrunrequest.d.ts +42 -0
- package/dist/models/components/createrunrequest.js +88 -0
- package/dist/models/components/createrunresponse.d.ts +6 -0
- package/dist/models/components/createrunresponse.js +52 -0
- package/dist/models/components/datasetresponse.d.ts +50 -0
- package/dist/models/components/datasetresponse.js +106 -0
- package/dist/models/components/deleteresponse.d.ts +12 -0
- package/dist/models/components/deleteresponse.js +57 -0
- package/dist/models/components/deleterunresponse.d.ts +5 -0
- package/dist/models/components/deleterunresponse.js +50 -0
- package/dist/models/components/evaluation.d.ts +60 -0
- package/dist/models/components/evaluation.js +119 -0
- package/dist/models/components/evaluationloggingquery.d.ts +62 -0
- package/dist/models/components/evaluationloggingquery.js +113 -0
- package/dist/models/components/evaluationrun.d.ts +50 -0
- package/dist/models/components/evaluationrun.js +116 -0
- package/dist/models/components/evaluationupdaterequest.d.ts +55 -0
- package/dist/models/components/evaluationupdaterequest.js +105 -0
- package/dist/models/components/event.d.ts +1 -1
- package/dist/models/components/feedbackquery.d.ts +22 -0
- package/dist/models/components/feedbackquery.js +63 -0
- package/dist/models/components/feedbackresponse.d.ts +26 -0
- package/dist/models/components/feedbackresponse.js +72 -0
- package/dist/models/components/finetunedmodelresponse.d.ts +54 -0
- package/dist/models/components/finetunedmodelresponse.js +111 -0
- package/dist/models/components/generatequery.d.ts +54 -0
- package/dist/models/components/generatequery.js +103 -0
- package/dist/models/components/generation.d.ts +54 -0
- package/dist/models/components/generation.js +103 -0
- package/dist/models/components/generationloggingquery.d.ts +67 -0
- package/dist/models/components/generationloggingquery.js +125 -0
- package/dist/models/components/generationresponse.d.ts +22 -0
- package/dist/models/components/generationresponse.js +63 -0
- package/dist/models/components/getrunresponse.d.ts +5 -0
- package/dist/models/components/getrunresponse.js +47 -0
- package/dist/models/components/getrunsresponse.d.ts +5 -0
- package/dist/models/components/getrunsresponse.js +47 -0
- package/dist/models/components/index.d.ts +9 -0
- package/dist/models/components/index.js +9 -0
- package/dist/models/components/metriccomputerequest.d.ts +6 -0
- package/dist/models/components/metriccomputerequest.js +52 -0
- package/dist/models/components/metriccomputeresponse.d.ts +4 -0
- package/dist/models/components/metriccomputeresponse.js +45 -0
- package/dist/models/components/metriccreaterequest.d.ts +17 -0
- package/dist/models/components/metriccreaterequest.js +109 -0
- package/dist/models/components/metriccreateresponse.d.ts +4 -0
- package/dist/models/components/metriccreateresponse.js +45 -0
- package/dist/models/components/metricdeleteresponse.d.ts +4 -0
- package/dist/models/components/metricdeleteresponse.js +45 -0
- package/dist/models/components/metricresponse.d.ts +58 -0
- package/dist/models/components/metricresponse.js +112 -0
- package/dist/models/components/metricupdaterequest.d.ts +16 -0
- package/dist/models/components/metricupdaterequest.js +104 -0
- package/dist/models/components/metricupdateresponse.d.ts +4 -0
- package/dist/models/components/metricupdateresponse.js +45 -0
- package/dist/models/components/postconfigurationrequest.d.ts +1 -1
- package/dist/models/components/prompt.d.ts +16 -0
- package/dist/models/components/prompt.js +89 -0
- package/dist/models/components/promptcreationquery.d.ts +42 -0
- package/dist/models/components/promptcreationquery.js +88 -0
- package/dist/models/components/promptresponse.d.ts +50 -0
- package/dist/models/components/promptresponse.js +106 -0
- package/dist/models/components/promptupdatequery.d.ts +34 -0
- package/dist/models/components/promptupdatequery.js +78 -0
- package/dist/models/components/putconfigurationrequest.d.ts +1 -1
- package/dist/models/components/sessionendresponse.d.ts +14 -0
- package/dist/models/components/sessionendresponse.js +53 -0
- package/dist/models/components/sessioneventquery.d.ts +78 -0
- package/dist/models/components/sessioneventquery.js +133 -0
- package/dist/models/components/sessioneventresponse.d.ts +14 -0
- package/dist/models/components/sessioneventresponse.js +53 -0
- package/dist/models/components/sessioneventupdate.d.ts +56 -0
- package/dist/models/components/sessioneventupdate.js +135 -0
- package/dist/models/components/sessionfeedback.d.ts +14 -0
- package/dist/models/components/sessionfeedback.js +53 -0
- package/dist/models/components/sessionstartquery.d.ts +26 -0
- package/dist/models/components/sessionstartquery.js +68 -0
- package/dist/models/components/sessionstartresponse.d.ts +14 -0
- package/dist/models/components/sessionstartresponse.js +53 -0
- package/dist/models/components/sessiontrace.d.ts +11 -0
- package/dist/models/components/sessiontrace.js +50 -0
- package/dist/models/components/successresponse.d.ts +14 -0
- package/dist/models/components/successresponse.js +53 -0
- package/dist/models/components/successtraceresponse.d.ts +14 -0
- package/dist/models/components/successtraceresponse.js +53 -0
- package/dist/models/components/task.d.ts +7 -0
- package/dist/models/components/task.js +60 -0
- package/dist/models/components/taskcreationquery.d.ts +46 -0
- package/dist/models/components/taskcreationquery.js +104 -0
- package/dist/models/components/taskresponse.d.ts +54 -0
- package/dist/models/components/taskresponse.js +114 -0
- package/dist/models/components/taskupdatequery.d.ts +38 -0
- package/dist/models/components/taskupdatequery.js +86 -0
- package/dist/models/components/taskupdateresponse.d.ts +23 -0
- package/dist/models/components/taskupdateresponse.js +65 -0
- package/dist/models/components/testcase.d.ts +14 -0
- package/dist/models/components/testcase.js +103 -0
- package/dist/models/components/testcaseupdate.d.ts +7 -0
- package/dist/models/components/testcaseupdate.js +60 -0
- package/dist/models/components/toolupdate.d.ts +9 -0
- package/dist/models/components/toolupdate.js +69 -0
- package/dist/models/components/traceevent.d.ts +31 -0
- package/dist/models/components/traceevent.js +75 -0
- package/dist/models/components/updateresponse.d.ts +12 -0
- package/dist/models/components/updateresponse.js +57 -0
- package/dist/models/components/updaterunrequest.d.ts +32 -0
- package/dist/models/components/updaterunrequest.js +80 -0
- package/dist/models/components/updaterunresponse.d.ts +11 -0
- package/dist/models/components/updaterunresponse.js +50 -0
- package/dist/models/components/uploaddataset.d.ts +27 -0
- package/dist/models/components/uploaddataset.js +73 -0
- package/dist/models/errors/createeventbatch.d.ts +14 -0
- package/dist/models/errors/createeventbatch.js +70 -0
- package/dist/models/errors/createmodeleventbatch.d.ts +14 -0
- package/dist/models/errors/createmodeleventbatch.js +70 -0
- package/dist/models/errors/index.d.ts +2 -0
- package/dist/models/errors/index.js +2 -0
- package/dist/models/operations/adddatapoints.d.ts +68 -0
- package/dist/models/operations/adddatapoints.js +143 -0
- package/dist/models/operations/createeventbatch.d.ts +36 -0
- package/dist/models/operations/createeventbatch.js +125 -0
- package/dist/models/operations/createmodelevent.d.ts +31 -0
- package/dist/models/operations/createmodelevent.js +115 -0
- package/dist/models/operations/createmodeleventbatch.d.ts +31 -0
- package/dist/models/operations/createmodeleventbatch.js +115 -0
- package/dist/models/operations/createrun.d.ts +21 -0
- package/dist/models/operations/createrun.js +79 -0
- package/dist/models/operations/createtask.d.ts +21 -0
- package/dist/models/operations/createtask.js +79 -0
- package/dist/models/operations/deletedatasets.d.ts +22 -0
- package/dist/models/operations/deletedatasets.js +63 -0
- package/dist/models/operations/deletedatasetsname.d.ts +24 -0
- package/dist/models/operations/deletedatasetsname.js +91 -0
- package/dist/models/operations/deleteevaluationsid.d.ts +24 -0
- package/dist/models/operations/deleteevaluationsid.js +91 -0
- package/dist/models/operations/deleteevent.d.ts +20 -0
- package/dist/models/operations/deleteevent.js +67 -0
- package/dist/models/operations/deleteeventseventid.d.ts +20 -0
- package/dist/models/operations/deleteeventseventid.js +67 -0
- package/dist/models/operations/deletefinetunedmodelsid.d.ts +19 -0
- package/dist/models/operations/deletefinetunedmodelsid.js +63 -0
- package/dist/models/operations/deletemetrics.d.ts +19 -0
- package/dist/models/operations/deletemetrics.js +63 -0
- package/dist/models/operations/deletepromptsid.d.ts +22 -0
- package/dist/models/operations/deletepromptsid.js +63 -0
- package/dist/models/operations/deleterun.d.ts +24 -0
- package/dist/models/operations/deleterun.js +91 -0
- package/dist/models/operations/deletesession.d.ts +19 -0
- package/dist/models/operations/deletesession.js +63 -0
- package/dist/models/operations/deletesessionsessionid.d.ts +24 -0
- package/dist/models/operations/deletesessionsessionid.js +91 -0
- package/dist/models/operations/deletetask.d.ts +19 -0
- package/dist/models/operations/deletetask.js +63 -0
- package/dist/models/operations/deletetasks.d.ts +24 -0
- package/dist/models/operations/deletetasks.js +91 -0
- package/dist/models/operations/getconfigurations.d.ts +1 -1
- package/dist/models/operations/getconfigurations.js +2 -2
- package/dist/models/operations/getdatapoints.d.ts +1 -1
- package/dist/models/operations/getdatasets.d.ts +1 -1
- package/dist/models/operations/getevaluations.d.ts +21 -0
- package/dist/models/operations/getevaluations.js +79 -0
- package/dist/models/operations/getevaluationsid.d.ts +24 -0
- package/dist/models/operations/getevaluationsid.js +91 -0
- package/dist/models/operations/getevents.d.ts +1 -1
- package/dist/models/operations/geteventschart.d.ts +21 -0
- package/dist/models/operations/geteventschart.js +71 -0
- package/dist/models/operations/getfinetunedmodels.d.ts +25 -0
- package/dist/models/operations/getfinetunedmodels.js +95 -0
- package/dist/models/operations/getfinetunedmodelsid.d.ts +24 -0
- package/dist/models/operations/getfinetunedmodelsid.js +91 -0
- package/dist/models/operations/getgenerations.d.ts +26 -0
- package/dist/models/operations/getgenerations.js +99 -0
- package/dist/models/operations/getprompts.d.ts +31 -0
- package/dist/models/operations/getprompts.js +95 -0
- package/dist/models/operations/getrun.d.ts +24 -0
- package/dist/models/operations/getrun.js +91 -0
- package/dist/models/operations/getruns.d.ts +24 -0
- package/dist/models/operations/getruns.js +91 -0
- package/dist/models/operations/getsessionsessionid.d.ts +24 -0
- package/dist/models/operations/getsessionsessionid.js +91 -0
- package/dist/models/operations/getsessionsessionidexport.d.ts +24 -0
- package/dist/models/operations/getsessionsessionidexport.js +91 -0
- package/dist/models/operations/gettasks.d.ts +24 -0
- package/dist/models/operations/gettasks.js +91 -0
- package/dist/models/operations/gettestcases.d.ts +38 -0
- package/dist/models/operations/gettestcases.js +117 -0
- package/dist/models/operations/index.d.ts +9 -0
- package/dist/models/operations/index.js +9 -0
- package/dist/models/operations/postchat.d.ts +21 -0
- package/dist/models/operations/postchat.js +79 -0
- package/dist/models/operations/postdatasets.d.ts +30 -0
- package/dist/models/operations/postdatasets.js +91 -0
- package/dist/models/operations/postevaluations.d.ts +21 -0
- package/dist/models/operations/postevaluations.js +79 -0
- package/dist/models/operations/postevents.d.ts +31 -0
- package/dist/models/operations/postevents.js +115 -0
- package/dist/models/operations/postfeedback.d.ts +21 -0
- package/dist/models/operations/postfeedback.js +79 -0
- package/dist/models/operations/postfinetunedmodels.d.ts +32 -0
- package/dist/models/operations/postfinetunedmodels.js +100 -0
- package/dist/models/operations/postgenerations.d.ts +21 -0
- package/dist/models/operations/postgenerations.js +79 -0
- package/dist/models/operations/postgenerationslog.d.ts +21 -0
- package/dist/models/operations/postgenerationslog.js +79 -0
- package/dist/models/operations/postmetrics.d.ts +16 -0
- package/dist/models/operations/postmetrics.js +51 -0
- package/dist/models/operations/postmetricscompute.d.ts +16 -0
- package/dist/models/operations/postmetricscompute.js +51 -0
- package/dist/models/operations/postprompts.d.ts +21 -0
- package/dist/models/operations/postprompts.js +79 -0
- package/dist/models/operations/postsessionsessionidend.d.ts +24 -0
- package/dist/models/operations/postsessionsessionidend.js +91 -0
- package/dist/models/operations/postsessionsessionidevent.d.ts +25 -0
- package/dist/models/operations/postsessionsessionidevent.js +95 -0
- package/dist/models/operations/postsessionsessionidfeedback.d.ts +25 -0
- package/dist/models/operations/postsessionsessionidfeedback.js +95 -0
- package/dist/models/operations/postsessionsessionidtraces.d.ts +25 -0
- package/dist/models/operations/postsessionsessionidtraces.js +95 -0
- package/dist/models/operations/postsessionstart.d.ts +21 -0
- package/dist/models/operations/postsessionstart.js +79 -0
- package/dist/models/operations/posttasks.d.ts +21 -0
- package/dist/models/operations/posttasks.js +79 -0
- package/dist/models/operations/posttestcases.d.ts +29 -0
- package/dist/models/operations/posttestcases.js +86 -0
- package/dist/models/operations/processeventtrace.d.ts +36 -0
- package/dist/models/operations/processeventtrace.js +101 -0
- package/dist/models/operations/putdatasets.d.ts +16 -0
- package/dist/models/operations/putdatasets.js +51 -0
- package/dist/models/operations/putevaluationsid.d.ts +25 -0
- package/dist/models/operations/putevaluationsid.js +95 -0
- package/dist/models/operations/putevents.d.ts +31 -0
- package/dist/models/operations/putevents.js +121 -0
- package/dist/models/operations/putmetrics.d.ts +16 -0
- package/dist/models/operations/putmetrics.js +51 -0
- package/dist/models/operations/putpromptsid.d.ts +24 -0
- package/dist/models/operations/putpromptsid.js +91 -0
- package/dist/models/operations/putsessionsessionid.d.ts +25 -0
- package/dist/models/operations/putsessionsessionid.js +95 -0
- package/dist/models/operations/puttasks.d.ts +21 -0
- package/dist/models/operations/puttasks.js +79 -0
- package/dist/models/operations/puttestcases.d.ts +24 -0
- package/dist/models/operations/puttestcases.js +91 -0
- package/dist/models/operations/updaterun.d.ts +25 -0
- package/dist/models/operations/updaterun.js +95 -0
- package/dist/models/operations/updatetask.d.ts +25 -0
- package/dist/models/operations/updatetask.js +98 -0
- package/dist/sdk/configurations.d.ts +1 -1
- package/dist/sdk/configurations.js +2 -2
- package/dist/sdk/datapoint.d.ts +28 -0
- package/dist/sdk/datapoint.js +418 -0
- package/dist/sdk/datasets.d.ts +4 -0
- package/dist/sdk/datasets.js +74 -0
- package/dist/sdk/events.d.ts +21 -0
- package/dist/sdk/events.js +248 -0
- package/dist/sdk/prompts.d.ts +24 -0
- package/dist/sdk/prompts.js +362 -0
- package/dist/sdk/runs.d.ts +28 -0
- package/dist/sdk/runs.js +439 -0
- package/dist/sdk/sdk.d.ts +2 -0
- package/dist/sdk/sdk.js +5 -3
- package/dist/sdk/tasks.d.ts +24 -0
- package/dist/sdk/tasks.js +368 -0
- package/dist/sdk/testcases.d.ts +20 -0
- package/dist/sdk/testcases.js +308 -0
- package/dist/sdk/tracer.d.ts +14 -156
- package/dist/sdk/tracer.js +101 -331
- package/docs/models/components/createdatapointrequest.md +1 -1
- package/docs/models/components/createdatasetrequest.md +1 -1
- package/docs/models/components/createmodelevent.md +24 -0
- package/docs/models/components/createrunrequest.md +15 -0
- package/docs/models/components/createrunresponse.md +9 -0
- package/docs/models/components/deleterunresponse.md +9 -0
- package/docs/models/components/evaluationrun.md +18 -0
- package/docs/models/components/evaluationrunstatus.md +9 -0
- package/docs/models/components/event.md +1 -1
- package/docs/models/components/getrunresponse.md +8 -0
- package/docs/models/components/getrunsresponse.md +8 -0
- package/docs/models/components/postconfigurationrequest.md +1 -1
- package/docs/models/components/putconfigurationrequest.md +1 -1
- package/docs/models/components/results.md +9 -0
- package/docs/models/components/status.md +11 -0
- package/docs/models/components/updaterunrequest.md +14 -0
- package/docs/models/components/updaterunrequeststatus.md +9 -0
- package/docs/models/components/updaterunresponse.md +9 -0
- package/docs/models/errors/createeventbatchresponsebody.md +13 -0
- package/docs/models/errors/createmodeleventbatchresponsebody.md +13 -0
- package/docs/models/operations/adddatapointsrequest.md +9 -0
- package/docs/models/operations/adddatapointsrequestbody.md +10 -0
- package/docs/models/operations/adddatapointsresponse.md +11 -0
- package/docs/models/operations/adddatapointsresponsebody.md +11 -0
- package/docs/models/operations/createeventbatchrequestbody.md +9 -0
- package/docs/models/operations/createeventbatchresponse.md +11 -0
- package/docs/models/operations/createeventbatchresponsebody.md +12 -0
- package/docs/models/operations/createmodeleventbatchrequestbody.md +8 -0
- package/docs/models/operations/createmodeleventbatchresponse.md +11 -0
- package/docs/models/operations/createmodeleventbatchresponsebody.md +11 -0
- package/docs/models/operations/createmodeleventrequestbody.md +8 -0
- package/docs/models/operations/createmodeleventresponse.md +11 -0
- package/docs/models/operations/createmodeleventresponsebody.md +11 -0
- package/docs/models/operations/createrunresponse.md +11 -0
- package/docs/models/operations/deleterunrequest.md +8 -0
- package/docs/models/operations/deleterunresponse.md +11 -0
- package/docs/models/operations/getconfigurationsrequest.md +1 -1
- package/docs/models/operations/getdatapointsrequest.md +1 -1
- package/docs/models/operations/getdatasetsrequest.md +1 -1
- package/docs/models/operations/geteventsrequestbody.md +7 -7
- package/docs/models/operations/getrunrequest.md +8 -0
- package/docs/models/operations/getrunresponse.md +11 -0
- package/docs/models/operations/getrunsrequest.md +8 -0
- package/docs/models/operations/getrunsresponse.md +11 -0
- package/docs/models/operations/getsessionresponse.md +6 -6
- package/docs/models/operations/mapping.md +12 -0
- package/docs/models/operations/updateconfigurationrequest.md +4 -4
- package/docs/models/operations/updaterunrequest.md +9 -0
- package/docs/models/operations/updaterunresponse.md +11 -0
- package/docs/sdks/configurations/README.md +98 -18
- package/docs/sdks/datapoints/README.md +2 -2
- package/docs/sdks/datasets/README.md +65 -2
- package/docs/sdks/events/README.md +361 -3
- package/docs/sdks/runs/README.md +255 -0
- package/docs/sdks/session/README.md +12 -1
- package/package.json +13 -4
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
|
|
@@ -84,6 +102,9 @@ run();
|
|
|
84
102
|
* [createEvent](docs/sdks/events/README.md#createevent) - Create a new event
|
|
85
103
|
* [updateEvent](docs/sdks/events/README.md#updateevent) - Update an event
|
|
86
104
|
* [getEvents](docs/sdks/events/README.md#getevents) - Retrieve events based on filters
|
|
105
|
+
* [createModelEvent](docs/sdks/events/README.md#createmodelevent) - Create a new model event
|
|
106
|
+
* [createEventBatch](docs/sdks/events/README.md#createeventbatch) - Create a batch of events
|
|
107
|
+
* [createModelEventBatch](docs/sdks/events/README.md#createmodeleventbatch) - Create a batch of model events
|
|
87
108
|
|
|
88
109
|
### [metrics](docs/sdks/metrics/README.md)
|
|
89
110
|
|
|
@@ -113,6 +134,7 @@ run();
|
|
|
113
134
|
* [createDataset](docs/sdks/datasets/README.md#createdataset) - Create a dataset
|
|
114
135
|
* [updateDataset](docs/sdks/datasets/README.md#updatedataset) - Update a dataset
|
|
115
136
|
* [deleteDataset](docs/sdks/datasets/README.md#deletedataset) - Delete a dataset
|
|
137
|
+
* [addDatapoints](docs/sdks/datasets/README.md#adddatapoints) - Add datapoints to a dataset
|
|
116
138
|
|
|
117
139
|
### [projects](docs/sdks/projects/README.md)
|
|
118
140
|
|
|
@@ -121,6 +143,14 @@ run();
|
|
|
121
143
|
* [updateProject](docs/sdks/projects/README.md#updateproject) - Update an existing project
|
|
122
144
|
* [deleteProject](docs/sdks/projects/README.md#deleteproject) - Delete a project
|
|
123
145
|
|
|
146
|
+
### [runs](docs/sdks/runs/README.md)
|
|
147
|
+
|
|
148
|
+
* [createRun](docs/sdks/runs/README.md#createrun) - Create a new evaluation run
|
|
149
|
+
* [getRuns](docs/sdks/runs/README.md#getruns) - Get a list of evaluation runs
|
|
150
|
+
* [getRun](docs/sdks/runs/README.md#getrun) - Get details of an evaluation run
|
|
151
|
+
* [updateRun](docs/sdks/runs/README.md#updaterun) - Update an evaluation run
|
|
152
|
+
* [deleteRun](docs/sdks/runs/README.md#deleterun) - Delete an evaluation run
|
|
153
|
+
|
|
124
154
|
### [configurations](docs/sdks/configurations/README.md)
|
|
125
155
|
|
|
126
156
|
* [getConfigurations](docs/sdks/configurations/README.md#getconfigurations) - Retrieve a list of configurations
|
|
@@ -134,67 +164,128 @@ run();
|
|
|
134
164
|
|
|
135
165
|
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
|
|
136
166
|
|
|
137
|
-
| Error Object
|
|
138
|
-
|
|
|
139
|
-
| errors.
|
|
167
|
+
| Error Object | Status Code | Content Type |
|
|
168
|
+
| ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
|
169
|
+
| errors.CreateEventBatchResponseBody | 500 | application/json |
|
|
170
|
+
| errors.SDKError | 4xx-5xx | */* |
|
|
140
171
|
|
|
141
172
|
Example
|
|
142
173
|
|
|
143
174
|
```typescript
|
|
144
175
|
import { HoneyHive } from "honeyhive";
|
|
176
|
+
import { CreateEventRequestEventType } from "honeyhive/dist/models/components";
|
|
145
177
|
|
|
146
178
|
async function run() {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
const sdk = new HoneyHive({
|
|
180
|
+
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
let res;
|
|
185
|
+
try {
|
|
186
|
+
res = await sdk.events.createEventBatch({
|
|
187
|
+
events: [
|
|
188
|
+
{
|
|
189
|
+
project: "Simple RAG",
|
|
190
|
+
source: "playground",
|
|
191
|
+
eventName: "Model Completion",
|
|
192
|
+
eventType: CreateEventRequestEventType.Model,
|
|
193
|
+
eventId: "7f22137a-6911-4ed3-bc36-110f1dde6b66",
|
|
194
|
+
sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
|
|
195
|
+
parentId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
|
|
196
|
+
childrenIds: [
|
|
197
|
+
"<value>",
|
|
198
|
+
],
|
|
199
|
+
config: {
|
|
200
|
+
"model": "gpt-3.5-turbo",
|
|
201
|
+
"version": "v0.1",
|
|
202
|
+
"provider": "openai",
|
|
203
|
+
"hyperparameters": {
|
|
204
|
+
"temperature": 0,
|
|
205
|
+
"top_p": 1,
|
|
206
|
+
"max_tokens": 1000,
|
|
207
|
+
"presence_penalty": 0,
|
|
208
|
+
"frequency_penalty": 0,
|
|
209
|
+
"stop": [
|
|
210
|
+
"<value>",
|
|
211
|
+
],
|
|
212
|
+
"n": 1,
|
|
213
|
+
},
|
|
214
|
+
"template": [
|
|
215
|
+
{
|
|
216
|
+
"role": "system",
|
|
217
|
+
"content": "Answer the user's question only using provided context.
|
|
218
|
+
|
|
219
|
+
Context: {{ context }}",
|
|
182
220
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
221
|
+
{
|
|
222
|
+
"role": "user",
|
|
223
|
+
"content": "{{question}}",
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
"type": "chat",
|
|
227
|
+
},
|
|
228
|
+
inputs: {
|
|
229
|
+
"context": "Hello world",
|
|
230
|
+
"question": "What is in the context?",
|
|
231
|
+
"chat_history": [
|
|
232
|
+
{
|
|
233
|
+
"role": "system",
|
|
234
|
+
"content": "Answer the user's question only using provided context.
|
|
235
|
+
|
|
236
|
+
Context: Hello world",
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"role": "user",
|
|
240
|
+
"content": "What is in the context?",
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
},
|
|
244
|
+
outputs: {
|
|
245
|
+
"role": "assistant",
|
|
246
|
+
"content": "Hello world",
|
|
247
|
+
},
|
|
248
|
+
error: null,
|
|
249
|
+
startTime: 1714978764301,
|
|
250
|
+
endTime: 1714978765301,
|
|
251
|
+
duration: 999.8056,
|
|
252
|
+
metadata: {
|
|
253
|
+
"cost": 0.00008,
|
|
254
|
+
"completion_tokens": 23,
|
|
255
|
+
"prompt_tokens": 35,
|
|
256
|
+
"total_tokens": 58,
|
|
257
|
+
},
|
|
258
|
+
feedback: {
|
|
190
259
|
|
|
191
|
-
|
|
192
|
-
|
|
260
|
+
},
|
|
261
|
+
metrics: {
|
|
262
|
+
"Answer Faithfulness": 5,
|
|
263
|
+
"Answer Faithfulness_explanation": "The AI assistant's answer is a concise and accurate description of Ramp's API. It provides a clear explanation of what the API does and how developers can use it to integrate Ramp's financial services into their own applications. The answer is faithful to the provided context.",
|
|
264
|
+
"Number of words": 18,
|
|
265
|
+
},
|
|
266
|
+
userProperties: {
|
|
267
|
+
"user": "google-oauth2|111840237613341303366",
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
});
|
|
272
|
+
} catch (err) {
|
|
273
|
+
if (err instanceof errors.CreateEventBatchResponseBody) {
|
|
274
|
+
console.error(err) // handle exception
|
|
275
|
+
throw err;
|
|
193
276
|
}
|
|
277
|
+
else if (err instanceof errors.SDKError) {
|
|
278
|
+
console.error(err) // handle exception
|
|
279
|
+
throw err;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (res.statusCode == 200) {
|
|
284
|
+
// handle response
|
|
285
|
+
}
|
|
194
286
|
}
|
|
195
287
|
|
|
196
288
|
run();
|
|
197
|
-
|
|
198
289
|
```
|
|
199
290
|
<!-- End Error Handling [errors] -->
|
|
200
291
|
|
|
@@ -215,50 +306,68 @@ You can override the default server globally by passing a server index to the `s
|
|
|
215
306
|
import { HoneyHive } from "honeyhive";
|
|
216
307
|
|
|
217
308
|
async function run() {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
309
|
+
const sdk = new HoneyHive({
|
|
310
|
+
serverIdx: 0,
|
|
311
|
+
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
const res = await sdk.session.startSession({
|
|
315
|
+
session: {
|
|
316
|
+
project: "Simple RAG Project",
|
|
317
|
+
sessionName: "Playground Session",
|
|
318
|
+
source: "playground",
|
|
319
|
+
sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
|
|
320
|
+
childrenIds: [
|
|
321
|
+
"7f22137a-6911-4ed3-bc36-110f1dde6b66",
|
|
322
|
+
],
|
|
323
|
+
config: {
|
|
324
|
+
"key": "<value>",
|
|
325
|
+
},
|
|
326
|
+
inputs: {
|
|
327
|
+
"context": "Hello world",
|
|
328
|
+
"question": "What is in the context?",
|
|
329
|
+
"chat_history": [
|
|
330
|
+
{
|
|
331
|
+
"role": "system",
|
|
332
|
+
"content": "Answer the user's question only using provided context.
|
|
333
|
+
|
|
334
|
+
Context: Hello world",
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"role": "user",
|
|
338
|
+
"content": "What is in the context?",
|
|
339
|
+
},
|
|
340
|
+
],
|
|
341
|
+
},
|
|
342
|
+
outputs: {
|
|
343
|
+
"role": "assistant",
|
|
344
|
+
"content": "Hello world",
|
|
345
|
+
},
|
|
346
|
+
error: null,
|
|
347
|
+
duration: 824.8056,
|
|
348
|
+
userProperties: {
|
|
349
|
+
"user": "google-oauth2|111840237613341303366",
|
|
350
|
+
},
|
|
351
|
+
metrics: {
|
|
352
|
+
|
|
353
|
+
},
|
|
354
|
+
feedback: {
|
|
355
|
+
|
|
356
|
+
},
|
|
357
|
+
metadata: {
|
|
358
|
+
|
|
359
|
+
},
|
|
360
|
+
startTime: 1712025501605,
|
|
361
|
+
endTime: 1712025499832,
|
|
362
|
+
},
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
if (res.statusCode == 200) {
|
|
366
|
+
// handle response
|
|
367
|
+
}
|
|
258
368
|
}
|
|
259
369
|
|
|
260
370
|
run();
|
|
261
|
-
|
|
262
371
|
```
|
|
263
372
|
|
|
264
373
|
|
|
@@ -269,50 +378,68 @@ The default server can also be overridden globally by passing a URL to the `serv
|
|
|
269
378
|
import { HoneyHive } from "honeyhive";
|
|
270
379
|
|
|
271
380
|
async function run() {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
381
|
+
const sdk = new HoneyHive({
|
|
382
|
+
serverURL: "https://api.honeyhive.ai",
|
|
383
|
+
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
const res = await sdk.session.startSession({
|
|
387
|
+
session: {
|
|
388
|
+
project: "Simple RAG Project",
|
|
389
|
+
sessionName: "Playground Session",
|
|
390
|
+
source: "playground",
|
|
391
|
+
sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
|
|
392
|
+
childrenIds: [
|
|
393
|
+
"7f22137a-6911-4ed3-bc36-110f1dde6b66",
|
|
394
|
+
],
|
|
395
|
+
config: {
|
|
396
|
+
"key": "<value>",
|
|
397
|
+
},
|
|
398
|
+
inputs: {
|
|
399
|
+
"context": "Hello world",
|
|
400
|
+
"question": "What is in the context?",
|
|
401
|
+
"chat_history": [
|
|
402
|
+
{
|
|
403
|
+
"role": "system",
|
|
404
|
+
"content": "Answer the user's question only using provided context.
|
|
405
|
+
|
|
406
|
+
Context: Hello world",
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"role": "user",
|
|
410
|
+
"content": "What is in the context?",
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
},
|
|
414
|
+
outputs: {
|
|
415
|
+
"role": "assistant",
|
|
416
|
+
"content": "Hello world",
|
|
417
|
+
},
|
|
418
|
+
error: null,
|
|
419
|
+
duration: 824.8056,
|
|
420
|
+
userProperties: {
|
|
421
|
+
"user": "google-oauth2|111840237613341303366",
|
|
422
|
+
},
|
|
423
|
+
metrics: {
|
|
424
|
+
|
|
425
|
+
},
|
|
426
|
+
feedback: {
|
|
427
|
+
|
|
428
|
+
},
|
|
429
|
+
metadata: {
|
|
430
|
+
|
|
431
|
+
},
|
|
432
|
+
startTime: 1712025501605,
|
|
433
|
+
endTime: 1712025499832,
|
|
434
|
+
},
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
if (res.statusCode == 200) {
|
|
438
|
+
// handle response
|
|
439
|
+
}
|
|
312
440
|
}
|
|
313
441
|
|
|
314
442
|
run();
|
|
315
|
-
|
|
316
443
|
```
|
|
317
444
|
<!-- End Server Selection [server] -->
|
|
318
445
|
|
|
@@ -351,49 +478,67 @@ To authenticate with the API the `bearerAuth` parameter must be set when initial
|
|
|
351
478
|
import { HoneyHive } from "honeyhive";
|
|
352
479
|
|
|
353
480
|
async function run() {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
481
|
+
const sdk = new HoneyHive({
|
|
482
|
+
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
const res = await sdk.session.startSession({
|
|
486
|
+
session: {
|
|
487
|
+
project: "Simple RAG Project",
|
|
488
|
+
sessionName: "Playground Session",
|
|
489
|
+
source: "playground",
|
|
490
|
+
sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
|
|
491
|
+
childrenIds: [
|
|
492
|
+
"7f22137a-6911-4ed3-bc36-110f1dde6b66",
|
|
493
|
+
],
|
|
494
|
+
config: {
|
|
495
|
+
"key": "<value>",
|
|
496
|
+
},
|
|
497
|
+
inputs: {
|
|
498
|
+
"context": "Hello world",
|
|
499
|
+
"question": "What is in the context?",
|
|
500
|
+
"chat_history": [
|
|
501
|
+
{
|
|
502
|
+
"role": "system",
|
|
503
|
+
"content": "Answer the user's question only using provided context.
|
|
504
|
+
|
|
505
|
+
Context: Hello world",
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"role": "user",
|
|
509
|
+
"content": "What is in the context?",
|
|
510
|
+
},
|
|
511
|
+
],
|
|
512
|
+
},
|
|
513
|
+
outputs: {
|
|
514
|
+
"role": "assistant",
|
|
515
|
+
"content": "Hello world",
|
|
516
|
+
},
|
|
517
|
+
error: null,
|
|
518
|
+
duration: 824.8056,
|
|
519
|
+
userProperties: {
|
|
520
|
+
"user": "google-oauth2|111840237613341303366",
|
|
521
|
+
},
|
|
522
|
+
metrics: {
|
|
523
|
+
|
|
524
|
+
},
|
|
525
|
+
feedback: {
|
|
526
|
+
|
|
527
|
+
},
|
|
528
|
+
metadata: {
|
|
529
|
+
|
|
530
|
+
},
|
|
531
|
+
startTime: 1712025501605,
|
|
532
|
+
endTime: 1712025499832,
|
|
533
|
+
},
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
if (res.statusCode == 200) {
|
|
537
|
+
// handle response
|
|
538
|
+
}
|
|
393
539
|
}
|
|
394
540
|
|
|
395
541
|
run();
|
|
396
|
-
|
|
397
542
|
```
|
|
398
543
|
<!-- End Authentication [security] -->
|
|
399
544
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SpeakeasyBase } from "../../internal/utils";
|
|
2
|
+
export declare class ChatCompletionRequest extends SpeakeasyBase {
|
|
3
|
+
/**
|
|
4
|
+
* The project ID
|
|
5
|
+
*/
|
|
6
|
+
project: string;
|
|
7
|
+
/**
|
|
8
|
+
* The version of the chat
|
|
9
|
+
*/
|
|
10
|
+
version?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The chat history
|
|
13
|
+
*/
|
|
14
|
+
messages: Record<string, any>[];
|
|
15
|
+
/**
|
|
16
|
+
* The model to use
|
|
17
|
+
*/
|
|
18
|
+
model: string;
|
|
19
|
+
/**
|
|
20
|
+
* The provider
|
|
21
|
+
*/
|
|
22
|
+
provider?: string;
|
|
23
|
+
hyperparameters?: Record<string, any>;
|
|
24
|
+
functions?: Record<string, any>[];
|
|
25
|
+
/**
|
|
26
|
+
* The function call method
|
|
27
|
+
*/
|
|
28
|
+
functionCall?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The number of samples
|
|
31
|
+
*/
|
|
32
|
+
numSamples?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to stream output
|
|
35
|
+
*/
|
|
36
|
+
stream?: boolean;
|
|
37
|
+
}
|