Dsxir.Metric.ScoreWithFeedback (dsxir v0.4.0)

Copy Markdown

Multi-objective score + feedback returned from a metric. Consumed by Dsxir.Optimizer.GEPA; transparent to Dsxir.Evaluate and other optimizers, which see only the aggregated scalar score.

score is either a scalar float() or a per-objective %{atom() => float()}. When a map, Dsxir.Metric.apply/4 aggregates it to scalar via the configured :objective_aggregator (default :mean, also accepts :min, :max, or a {module, fun} reference invoked as apply(module, fun, [score_map])).

feedback is nil, a free-form String.t(), or a per-predictor map %{atom() => String.t() | nil}. GEPA's reflective proposer accepts all three shapes; non-GEPA consumers ignore the field.

Summary

Types

predictor_feedback()

@type predictor_feedback() :: %{required(atom()) => String.t() | nil}

t()

@type t() :: %Dsxir.Metric.ScoreWithFeedback{
  feedback: nil | String.t() | predictor_feedback(),
  meta: map(),
  score: float() | %{required(atom()) => float()}
}