Nous.Eval.Scorers.Regex (nous v0.21.1)

Copy Markdown View Source

Passes when the output text matches regular expressions.

{Nous.Eval.Scorers.Regex, patterns: ["order #\\d+", "refund"], mode: :all}

Options

  • :patterns - non-empty list of regex sources (required). They are compiled once in init/1: an invalid pattern is a configuration error, never a "not found"
  • :mode - :all (default) or :any
  • :case_sensitive - default true

details.unmatched lists the indexes of the patterns that did not match. A failed run fails with reason "run_failed"; non-text output is an :invalid_config error.