Skip to main content
The annotationconfigs client methods are currently in ALPHA. The API may change without notice. A one-time warning is emitted on first use.
An annotation config defines the shape of human annotations attached to spans or dataset examples. Each config is one of three types: categorical (a fixed set of labels), continuous (a numeric score range), or freeform (open text). The Get, UpdateCategorical, UpdateContinuous, UpdateFreeform, and Delete methods accept either a config name or an ID — when a name is passed, the parent Space (name or ID) is also required. Each config type has its own dedicated Create* and Update* method so required fields stay statically typed.

List Annotation Configs

List returns a paginated list of annotation configs. Space, when non-empty, accepts a space name or ID and restricts results to that space. Name, when non-empty, applies a case-insensitive substring filter on the annotation config name. Signature:
Usage Example:

Get an Annotation Config

Get returns a single annotation config, resolving by name or ID. The returned AnnotationConfig is a discriminated union — call ac.AsCategoricalAnnotationConfig(), AsContinuousAnnotationConfig(), or AsFreeformAnnotationConfig() to extract the typed variant after checking the discriminator. Signature:
Usage Example:

Create a Categorical Annotation Config

CreateCategorical creates a new categorical annotation config (a fixed set of labeled values a scorer can choose from), resolving the parent space by name or ID. Values is required; OptimizationDirection is optional and defaults to none on the server. Signature:
Usage Example:

Create a Continuous Annotation Config

CreateContinuous creates a new continuous annotation config (a numeric score within a fixed range), resolving the parent space by name or ID. MinimumScore and MaximumScore are required. Signature:
Usage Example:

Create a Freeform Annotation Config

CreateFreeform creates a new freeform annotation config (open-ended text feedback with no predefined scale), resolving the parent space by name or ID. Only Space and Name are required. Signature:
Usage Example:

Update a Categorical Annotation Config

UpdateCategorical patches an existing categorical annotation config, resolving by name or ID. All patch fields are optional — leave a field nil to preserve its current value. When non-nil, Values replaces the full set of allowed labels (2–100 items). Signature:
Usage Example:

Update a Continuous Annotation Config

UpdateContinuous patches an existing continuous annotation config, resolving by name or ID. All patch fields are optional — leave a field nil to preserve its current value. Signature:
Usage Example:

Update a Freeform Annotation Config

UpdateFreeform patches an existing freeform annotation config, resolving by name or ID. Only Name may be patched — leave it nil to preserve the current value. Signature:
Usage Example:

Delete an Annotation Config

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