Skip to content

Latest commit

 

History

History
189 lines (131 loc) · 7.41 KB

README.md

File metadata and controls

189 lines (131 loc) · 7.41 KB

Metrics

(metrics)

Available Operations

getMetrics

Retrieve a list of all metrics

Example Usage

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();

Parameters

Parameter Type Required Description
projectName string ✔️ Project name associated with metrics
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetMetricsResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

createMetric

Add a new metric

Example Usage

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();

Parameters

Parameter Type Required Description
request components.Metric ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.CreateMetricResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

updateMetric

Edit a metric

Example Usage

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();

Parameters

Parameter Type Required Description
request components.MetricEdit ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.UpdateMetricResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

deleteMetric

Remove a metric

Example Usage

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();

Parameters

Parameter Type Required Description
metricId string ✔️ N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.DeleteMetricResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /