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. UseManagedCodeConfigRequest for built-in checks (JSONParseable, Regex, KeywordMatch, ExactMatch) or CustomCodeConfigRequest 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.
Create a Remote Evaluator
Create a new remote evaluator with an initial version. Remote evaluators call a customer-hosted HTTP endpoint on each evaluation run. The endpoint must already exist as anEVALUATOR integration, and the enableRemoteEvalTasks feature flag must be enabled on the account.
Create a Decision Judge Evaluator
Create a new Decision Judge evaluator with an initial version. A Decision Judge evaluator asks a set of typed questions about each span and writes one result per question (eval.<evaluator name> <question name>.label / .score). It runs on spans only, and Decision Judge must be enabled for the account (otherwise the API returns 403).
Each question is a BOOLEAN, CHOICE, or SCORE question wrapped in a DecisionJudgeQuestionInput. Provide between 1 and 64 questions; question names must be unique within the evaluator (case-insensitive).
BOOLEAN takes optional true_means / false_means; CHOICE takes options (2ā255 labels mapped to when each applies) via DecisionJudgeChoiceCriteriaInput; SCORE takes levels (2ā10 descriptions from lowest to highest) via DecisionJudgeScoreCriteriaInput. You may also pass decision_judge_config as a plain dict with ai_integration_id, model_name, state_template, and questions keys.
Get an Evaluator
Retrieve an evaluator by name or ID. By default the latest version is returned. When using a name, providespace to disambiguate.
Get a Specific Version
Update an Evaluator
Update an evaluatorās metadata (name and/or description). To change the template configuration, create a new version instead.Delete an Evaluator
Delete an evaluator and all its versions. This operation is irreversible. There is no response from this call.Manage Versions
Evaluator versions are immutable once created. To change the template configuration, create a new version ā it becomes the latest version immediately.List Versions
List all versions for an evaluator.Get a Version
Retrieve a specific evaluator version by its ID.Create a New Template Version
Add a new template version to an existing template evaluator. The new version becomes the latest immediately.Create a New Code Version
Add a new code version to an existing code evaluator.Create a New Remote Version
Add a new remote version to an existing evaluator. The new version becomes the latest immediately. The referenced integration must be anEVALUATOR integration, and the enableRemoteEvalTasks feature flag must be enabled on the account.
Create a New Decision Judge Version
Add a new Decision Judge version to an existing Decision Judge evaluator. The new version becomes the latest immediately and replaces the whole configuration, including every question ā pass all the questions the version should ask.Delete Versions
Delete a batch of evaluator versions (1-100 IDs per request). This operation is irreversible. The delete is partial-tolerant: IDs that exist and belong to the evaluator are deleted, and requested IDs that were not deleted are returned innot_deleted_version_ids. Deleting a version pinned to a running online task un-pins that task (falls back to latest).