Nous.Eval.Case (nous v0.21.1)

Copy Markdown View Source

One evaluation case: an input for the agent, what is expected of the answer, and the scorers that judge it.

Cases come from a Nous.Eval.Dataset (Elixir lists, YAML or JSONL; schema id nous.case/1). Every case has a stable string id: runs, baselines and comparisons match cases by it, so renaming an id makes it a new case.

Fields

  • :id - stable, unique within the dataset (string)
  • :input - the prompt (string) or a message list ([Nous.Message.t()]) sent with Nous.run(agent, messages: ...); for a simulated case (nous.sim_case/1), the Nous.Eval.Simulator.Scenario the simulated user plays (see Nous.Eval.Simulator)
  • :expected - free-form expectations the scorers read (string keys when loaded from YAML/JSONL)
  • :scorers - case-specific scorers (Nous.Eval.Scorer.Spec), added to the task's default scorers
  • :threshold - pass threshold for the weighted mean of the soft (required: false) scorers; nil means the default 0.5
  • :tags - strings, for selecting cases
  • :split - "train" | "val" | "test" | nil; assigned from :group when not given (see Nous.Eval.Dataset)

  • :group - cases that must land in the same split (paraphrases, near-duplicates); defaults to the id
  • :metadata - anything else; carried into the run record

Summary

Functions

The split names a case may carry.

Types

split()

@type split() :: String.t() | nil

t()

@type t() :: %Nous.Eval.Case{
  expected: map(),
  group: String.t() | nil,
  id: String.t(),
  input: String.t() | [Nous.Message.t()] | Nous.Eval.Simulator.Scenario.t(),
  metadata: map(),
  scorers: [Nous.Eval.Scorer.Spec.t()],
  split: split(),
  tags: [String.t()],
  threshold: float() | nil
}

Functions

splits()

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

The split names a case may carry.