POST
/
metrics
import honeyhive
from honeyhive.models import components

s = honeyhive.HoneyHive(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.metrics.create_metric(request=components.Metric(
    name='<value>',
    task='<value>',
    type=components.MetricType.MODEL,
    description='Fully-configurable neutral framework',
    return_type=components.ReturnType.STRING,
))

if res is not None:
    # handle response
    pass

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Name of the metric

task
string
required

Name of the project associated with metric

type
enum<string>
required

Type of the metric - "custom", "model" or "human"

Available options:
custom,
model,
human
description
string
required

Short description of what the metric does

return_type
enum<string>
required

The data type of the metric value - "boolean", "float", "string"

Available options:
boolean,
float,
string
criteria
string

Criteria for human metrics

code_snippet
string

Associated code block for the metric

prompt
string

Evaluator prompt for the metric

enabled_in_prod
boolean

Whether to compute on all production events automatically

needs_ground_truth
boolean

Whether a ground truth (on metadata) is required to compute it

threshold
object

Threshold for numeric metrics to decide passing or failing in tests

pass_when
boolean

Threshold for boolean metrics to decide passing or failing in tests

_id
string

Unique idenitifier

event_name
string

Name of event that the metric is set to be computed on

event_type
string

Type of event that the metric is set to be computed on

Response

200

Metric created successfully