Skip to main content

Interface: LocalMetricConfig

Defined in: src/types/metrics.types.ts:120 Configuration for a local metric that is computed client-side. This interface defines metrics that are evaluated on the client rather than server-side. Local metrics are useful for custom scoring logic that needs to run in the client environment.

Properties

aggregatableTypes?

optional aggregatableTypes: string[];
Defined in: src/types/metrics.types.ts:143 The step types that can have aggregated scores. Defaults to [‘trace’] if not specified.

aggregatorFn()?

optional aggregatorFn: (scores: MetricValueType[]) => MetricValueType;
Defined in: src/types/metrics.types.ts:133 Optional aggregator function to combine scores from child spans. Takes an array of metric values and returns an aggregated value.

Parameters

scores
MetricValueType[]

Returns

MetricValueType

name

name: string;
Defined in: src/types/metrics.types.ts:122 The name of the metric

scorableTypes?

optional scorableTypes: string[];
Defined in: src/types/metrics.types.ts:138 The step types that can be scored by this metric. Defaults to [‘llm’] if not specified.

scorerFn()

scorerFn: (traceOrSpan: any) => MetricValueType;
Defined in: src/types/metrics.types.ts:128 The scoring function that computes the metric value. Takes a trace or span and returns a metric value.

Parameters

traceOrSpan
any

Returns

MetricValueType
I