Scores the output's similarity to the expected text as a Levenshtein ratio
over graphemes: 1 - distance / max(length), a float in 0.0..1.0.
{Nous.Eval.Scorers.Similarity, expected: "The capital is Paris", threshold: 0.9}Options
:expected- the expected text; when absent, the case'sexpected["output"]:threshold-passed?when the ratio is at least this (default0.8):max_len- the longest text (in graphemes) compared, default2_000. Levenshtein is quadratic, so a longer output or expectation is an:invalid_configerror instead of a long stall:case_sensitive(defaulttrue),:trim(defaulttrue),:collapse_whitespace(defaultfalse) - as inNous.Eval.Scorers.Equals
A failed run fails with reason "run_failed"; non-text output is an
:invalid_config error.