Skip to main content
The evaluators client methods are currently in BETA. The API may change without notice. A one-time warning is emitted on first use.
An evaluator scores spans or examples. Each evaluator has one or more immutable versions; a version is a template (LLM-as-judge), a code (managed built-in or user-supplied Python), or a remote (customer-hosted HTTP endpoint backed by an EVALUATOR integration) configuration. The Get, Update, Delete, ListVersions, DeleteVersions, and CreateVersion methods accept either an evaluator name or an ID — when a name is passed, the parent Space (name or ID) is also required so the SDK can resolve the name to a unique ID. GetVersion takes a strict version ID. Set exactly one of VersionConfig.Template, VersionConfig.Code, or VersionConfig.Remote on Create and CreateVersion; within Code, set exactly one of Managed or Custom. Conflicting configurations return evaluators.ErrConflictingVersionConfig or evaluators.ErrConflictingCodeConfig without contacting the server. Typed convenience methods (CreateTemplateEvaluator, CreateCodeEvaluator, CreateRemoteEvaluator and the matching CreateTemplateVersion, CreateCodeVersion, CreateRemoteVersion) create one evaluator kind directly without assembling a VersionConfig.

List Evaluators

List returns a paginated list of evaluators. Defaults to a page size of 50. Space, when non-empty, filters by space (substring match on space name, or exact match if a base64 resource ID is passed). Signature:
Usage Example:

Get an Evaluator

Get returns a single evaluator (with one of its versions), resolving by name or ID. When VersionID is set, the response carries that specific version; otherwise the latest version is returned. Signature:
Usage Example:

Create an Evaluator

Create creates a new evaluator together with its initial version, resolving the parent space by name or ID. The evaluator’s type is derived from Version — set Version.Template for a template (LLM-based) evaluator or Version.Code for a code evaluator (with exactly one of Code.Managed or Code.Custom). Signature:
Usage Example:

Update an Evaluator

Update patches an existing evaluator’s metadata, resolving the target by name or ID, and returns the updated evaluator. Name and Description are pointers — nil preserves the existing value. Returns evaluators.ErrNoUpdateFields without contacting the server when no patch field is set. Signature:
Usage Example:

Delete an Evaluator

Delete removes an evaluator, resolving by name or ID. It returns only an error. Signature:
Usage Example:

List Versions

ListVersions returns a paginated list of versions for an evaluator, resolving the evaluator by name or ID. Defaults to a page size of 50. Signature:
Usage Example:

Delete Versions

DeleteVersions deletes a batch of versions (1–100 per request) belonging to an evaluator, resolving the evaluator by name or ID. The delete is partial-tolerant: version IDs that exist and belong to the evaluator are deleted, and requested IDs that were not deleted are returned in NotDeletedVersionIds. Completed reports that the request finished — it does not mean every requested ID was found and deleted. Signature:
Usage Example:

Create a Version

CreateVersion appends a new version to an existing evaluator, resolving the evaluator by name or ID. The new version’s kind (set via Version.Template, Version.Code, or Version.Remote) must match the parent evaluator’s type. Signature:
Usage Example:

Get a Version

GetVersion returns a single evaluator version by its ID. Version IDs are strict IDs — no name resolution is performed. The returned EvaluatorVersion is a discriminated union — call v.AsEvaluatorVersionTemplate() or v.AsEvaluatorVersionCode() to extract the typed variant after checking the discriminator. Signature:
Usage Example:

Create a Template Evaluator

CreateTemplateEvaluator creates a TEMPLATE (LLM-as-judge) evaluator together with its initial version in one call. It is equivalent to Create with Version.Template set, without assembling a VersionConfig. Signature:
Usage Example:

Create a Code Evaluator

CreateCodeEvaluator creates a CODE evaluator together with its initial version in one call. It is equivalent to Create with Version.Code set. Set exactly one of Config.Managed (a built-in managed evaluator) or Config.Custom (user-supplied Python); a conflicting configuration returns evaluators.ErrConflictingCodeConfig without contacting the server. Signature:
Usage Example:

Create a Remote Evaluator

CreateRemoteEvaluator creates a REMOTE evaluator backed by an existing EVALUATOR integration, together with its initial version. It is equivalent to Create with Version.Remote set. This method requires the enableRemoteEvalTasks feature flag on the account. Signature:
Usage Example:

Create a Template Version

CreateTemplateVersion appends a new TEMPLATE version to an existing evaluator, resolving the evaluator by name or ID. It is equivalent to CreateVersion with Version.Template set; the parent evaluator must be a template evaluator. Signature:
Usage Example:

Create a Code Version

CreateCodeVersion appends a new CODE version to an existing evaluator, resolving the evaluator by name or ID. It is equivalent to CreateVersion with Version.Code set. Set exactly one of Config.Managed or Config.Custom; a conflicting configuration returns evaluators.ErrConflictingCodeConfig without contacting the server. Signature:
Usage Example:

Create a Remote Version

CreateRemoteVersion appends a new REMOTE version to an existing evaluator, resolving the evaluator by name or ID, optionally switching to a different EVALUATOR integration. It is equivalent to CreateVersion with Version.Remote set. Signature:
Usage Example: