string
The name of the custom metric.
string
The user prompt for the metric.
StepType
= StepType.llm
(Optional) The node level for the metric, i.e. StepType.llm, StepType.trace. Defaults to StepType.llm.
boolean
= true
(Optional) Whether chain of thought is enabled. Defaults to true.
string
= 'gpt-4.1-mini'
(Optional) The model name to use. Defaults to ‘gpt-4.1-mini’.
number
= 3
(Optional) The number of judges to use. Defaults to 3.
string
= ''
(Optional) A description for the metric.
string
[] = []
(Optional) Tags to associate with the metric.
OutputType
= OutputType.BOOLEAN
(Optional) The output type for the metric. Defaults to OutputType.BOOLEAN.
Promise
<{
cot_enabled?
: null
| boolean
;
generated_scorer?
: | null
| {
chain_poll_template
: {
explanation_field_name?
: string
;
metric_description?
: null
| string
;
metric_few_shot_examples?
: object
[];
metric_system_prompt?
: null
| string
;
template
: string
;
value_field_name?
: string
;
};
id
: string
;
instructions?
: null
| string
;
name
: string
;
user_prompt?
: null
| string
;
};
id
: string
;
input_type?
: | null
| "basic"
| "llm_spans"
| "retriever_spans"
| "sessions_normalized"
| "sessions_trace_io_only"
| "tool_spans"
| "trace_input_only"
| "trace_io_only"
| "trace_normalized"
| "trace_output_only"
;
model_name?
: null
| string
;
num_judges?
: null
| number
;
output_type?
: | null
| "boolean"
| "categorical"
| "count"
| "discrete"
| "freeform"
| "percentage"
;
registered_scorer?
: | null
| {
id
: string
;
name
: string
;
};
scoreable_node_types?
: null
| string
[];
version
: number
;
}>
A promise that resolves when the metric is created.