Skip to main content
The datasets client methods are currently in ALPHA. The API may change without notice. A one-time warning is emitted on first use. The Update and AnnotateExamples methods are in BETA.
A dataset is a versioned collection of examples used for experiments and evaluations. The Get, Update, Delete, ListExamples, AppendExamples, DeleteExamples, and AnnotateExamples methods accept either a dataset 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. Datasets cannot be empty: Create requires at least one example, otherwise it returns datasets.ErrNoExamples.

List Datasets

List returns a paginated list of datasets. Space, when non-empty, restricts results to a single space. Signature:
Usage Example:

Get a Dataset

Get returns a single dataset, resolving by name or ID. Space is required when Dataset is a name. Signature:
Usage Example:

Create a Dataset

Create creates a new dataset in the given space and returns it. The parent space is resolved by name or ID. At least one example is required; an empty Examples slice returns datasets.ErrNoExamples without contacting the server. Signature:
Usage Example:

Update a Dataset

Update renames a dataset, resolving by name or ID, and returns the updated dataset. Space is required when Dataset is a name. Signature:
Usage Example:

Delete a Dataset

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

List Examples

ListExamples returns a paginated list of examples for a dataset, resolving the dataset by name or ID. DatasetVersionID is optional — when empty, the server uses the dataset’s latest version. Signature:
Usage Example:

Append Examples

AppendExamples appends new examples to a dataset version and returns the version they were written to along with the server-assigned example IDs. DatasetVersionID is optional — when empty, the server uses the dataset’s latest version. Signature:
Usage Example:

Delete Examples

DeleteExamples removes a batch of examples from a specific dataset version, resolving the dataset by name or ID. DatasetVersionID is required — deletions are always scoped to a specific version. The response reports which IDs were deleted (DeletedExampleIds) and which were not (NotDeletedExampleIds); when Completed is false the delete did not fully complete and the full request should be retried, which is safe because the operation is idempotent. Signature:
Usage Example:

Annotate Examples

AnnotateExamples writes human annotations to a batch of examples in a dataset. Annotations are upserted by annotation config name for each example, so re-annotating the same example with the same config name overwrites the previous value. Up to 1000 examples may be annotated per request. Signature:
Usage Example: