Aludel.Evals.Metric.Registry (aludel v0.7.0)

Copy Markdown View Source

Registry for the built-in evaluation metrics.

New metric modules are added here without changing suite execution or result aggregation code.

Summary

Functions

Evaluates a registered assertion against generated output or metric context.

Looks up the metric module registered for a type identifier.

Lists the registered metric type identifiers accepted by assertions.

Functions

evaluate(input, assertion)

@spec evaluate(Aludel.Evals.Metric.Context.t() | String.t(), map()) ::
  {:ok, Aludel.Evals.Metric.Result.t()} | :error

Evaluates a registered assertion against generated output or metric context.

Returns :error when the assertion has no registered "type".

fetch(type)

@spec fetch(String.t()) :: {:ok, module()} | :error

Looks up the metric module registered for a type identifier.

types()

@spec types() :: [String.t()]

Lists the registered metric type identifiers accepted by assertions.