# `Nous.Eval.Scorers.Function`
[🔗](https://github.com/nyo16/nous/blob/v0.21.1/lib/nous/eval/scorers/function.ex#L1)

Wraps a one-argument function as a scorer, for Elixir-defined datasets
and tasks. It cannot be referenced from YAML/JSONL files.

    {Nous.Eval.Scorers.Function,
     name: "mentions_order", fun: fn input -> input.output =~ "order" end}

The function receives the `Nous.Eval.ScoreInput` and returns:

  * `true` / `false` - a `:pass` / `:fail` score
  * a number in `0.0..1.0` - a float score, `passed?` when at least
    `:threshold`
  * a `Nous.Eval.Score` or a list of them, or any
    `t:Nous.Eval.Scorer.result/0` (`{:ok, _}`, `{:skip, reason}`,
    `{:error, %Nous.Eval.ScorerError{}}`), passed through

Anything else, and any number outside `0.0..1.0`, is rejected by
`Nous.Eval.Scoring` as a scorer error.

## Options

  * `:fun` - the function (required)
  * `:name` - the score name (default `"function"`)
  * `:threshold` - for numeric returns (default `0.5`)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
