Nous.Eval.ScoreInput (nous v0.21.1)

Copy Markdown View Source

What a scorer reads for one sample.

  • :case - the Nous.Eval.Case
  • :sample - the sample index, 0..k-1
  • :seed - the seed the sample ran with, or nil
  • :output - the agent's final output (string or structured value); nil when the run failed
  • :run_outcome - {:ok, result} | {:error, reason} | :killed

  • :trace - the sample's Nous.Eval.Trace
  • :usage - Nous.Usage summed over the whole run tree
  • :duration_ms - wall time of the sample
  • :track_trace - nil, or a function the eval runner sets that charges a trace id's model requests to the run's budget (Nous.Eval.run/2's :budget). A model-graded scorer calls it with the trace id of its own model runs before the first request, so every request, answered or failed, is paid for. Spend a scorer only reports in Score metadata is not charged.

A failed run is not a scorer error: output scorers fail the sample with reason: "run_failed", trace scorers score the partial trace.

Summary

Types

run_outcome()

@type run_outcome() :: {:ok, map()} | {:error, term()} | :killed

t()

@type t() :: %Nous.Eval.ScoreInput{
  case: Nous.Eval.Case.t(),
  duration_ms: non_neg_integer(),
  output: term(),
  run_outcome: run_outcome(),
  sample: non_neg_integer(),
  seed: integer() | nil,
  trace: Nous.Eval.Trace.t(),
  track_trace: (String.t() -> :ok) | nil,
  usage: Nous.Usage.t()
}