(metrics)
- getMetrics - Get all metrics
- createMetric - Create a new metric
- updateMetric - Update an existing metric
- deleteMetric - Delete a metric
Retrieve a list of all metrics
import { HoneyHive } from "honeyhive";
import { GetMetricsRequest } from "honeyhive/dist/models/operations";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const projectName: string = "<value>";
const res = await sdk.metrics.getMetrics(projectName);
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
projectName |
string | ✔️ | Project name associated with metrics |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetMetricsResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Add a new metric
import { HoneyHive } from "honeyhive";
import { MetricType, ReturnTypeT } from "honeyhive/dist/models/components";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const res = await sdk.metrics.createMetric({
name: "<value>",
task: "<value>",
type: MetricType.Model,
description: "Fully-configurable neutral framework",
returnType: ReturnTypeT.String,
threshold: {},
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.Metric | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.CreateMetricResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Edit a metric
import { HoneyHive } from "honeyhive";
import { MetricEditEventType, MetricEditReturnType, MetricEditType } from "honeyhive/dist/models/components";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const res = await sdk.metrics.updateMetric({
metricId: "<value>",
threshold: {},
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.MetricEdit | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.UpdateMetricResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Remove a metric
import { HoneyHive } from "honeyhive";
import { DeleteMetricRequest } from "honeyhive/dist/models/operations";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const metricId: string = "<value>";
const res = await sdk.metrics.deleteMetric(metricId);
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
metricId |
string | ✔️ | N/A |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.DeleteMetricResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |