Skip to main content

Interface: LocalMetricConfig

Defined in: src/types/metrics.types.ts 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 The step types that can have aggregated scores. Must not contain any types in scorableTypes. Can only contain ‘trace’ or ‘workflow’ step types.

Default

["trace"];

name

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

scorableTypes?

optional scorableTypes: string[];
Defined in: src/types/metrics.types.ts The step types that can be scored by this metric.

Default

["llm"];

scorerFn()

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

Parameters

traceOrSpan
Span | Trace

Returns

MetricValueType