The
evaluators client methods are currently in BETA. The API may change without notice. A one-time warning is emitted on first use.{variable} placeholders that reference span or trace attributes to automatically score your LLM application’s outputs.
Key Capabilities
- Create template-based LLM-as-judge evaluators within a space
- Version evaluators with commit messages (versions are immutable once created)
- Retrieve evaluators with their latest or a specific version
- List, update, and delete evaluators
- List and retrieve individual evaluator versions
List Evaluators
List all evaluators you have access to, with optional filtering by space.Create a Template (LLM-as-Judge) Evaluator
Create a new template evaluator with an initial version. Evaluator names must be unique within the target space.Create a Code Evaluator
Create a new code evaluator with an initial version. UseManagedCodeConfig for built-in checks (JSONParseable, Regex, KeywordMatch, ExactMatch) or CustomCodeConfig for user-supplied Python.
name must match the regex ^[a-zA-Z0-9_\s\-&()]+$.
Template Variables
Template strings use{variable} placeholders (f-string format) that reference span or trace attributes (e.g., {input.value}, {output.value}, {attributes.my_custom_attr}).
Classification vs. Freeform Output
- Classification — Provide
classification_choicesas adict[str, float]mapping label → numeric score (e.g.,{"relevant": 1, "irrelevant": 0}). The evaluator outputs one of these labels along with its score. - Freeform — Omit
classification_choices. The evaluator produces a numeric score without predefined labels.
Get an Evaluator
Retrieve an evaluator by name or ID. By default the latest version is returned. When using a name, providespace to disambiguate.