CustomJudgeSpec can be defined once and reused across multiple evaluator
instances or shared across a codebase.
Parameters
str | list[Message]
required
The evaluation prompt. Can be a plain string (wrapped
in a single user message) or a list of
Message dicts.Dict[str, OutputField]
required
Schema defining the expected output fields.
Dict[str, InputFieldSpec] | None
default:"None"
Optional metadata for template variables.
Dict[str, OutputField] | None
default:"None"
Optional schema for the LLM response before
transformation. Required when output fields use
transform.Example
Defining a reusable faithfulness evaluator spec:Attributes
The evaluation prompt — a plain string (wrapped in a single user
message) or a list of
Message dicts.Optional metadata for the
{{ placeholder }} template variables,
keyed by placeholder name.Optional schema for the raw LLM response before transformation;
required when any output field uses
transform.