CustomEvaluatorExpected. Use this class when each test case has a gold answer (ExpectedResponseContext). Use CustomEvaluatorObjective when you only have pass/fail descriptions (ObjectiveContext). There is no CustomEvaluator class.
Custom evaluators are useful when built-in judges do not cover your rubric, or when you need a specialized scoring scale. See the custom evaluator API for both classes.
Creating a Custom Evaluator
CustomEvaluatorExpected takes a name, judge instructions, a score scale, and a pass threshold. A case fails when the score is below threshold.
Custom Evaluator Parameters
name: A descriptive name for your evaluatordescription: A detailed description of what the evaluator checksinstructions: Detailed instructions for the LLM judge on how to evaluate responsesthreshold: The minimum score needed to pass the evaluationscore_range: The range of possible scores (min, max)scores: A list of score definitions with descriptions