Skip to main content
TrustTest ships two custom LLM-as-a-judge classes. There is no CustomEvaluator class. A case fails when the judge score is below threshold.

Import

Parameters

Both classes take the same constructor: threshold must sit inside score_range.

CustomEvaluatorExpected

Compares the model output to ExpectedResponseContext.expected_response.

CustomEvaluatorObjective

Uses ObjectiveContext (true_description / false_description) instead of a gold answer. Typical for catalog threat probes.
Do not mix ExpectedResponseContext evaluators and ObjectiveContext evaluators in the same EvaluatorSuite. See Evaluation strategy.