Datasets SDK
Create and manage evaluation datasets. Datasets are collections of test cases used for prompt evaluation, each containing input variables and expected outputs.Dataset Architecture
Datasets are scoped to a prompt group (all versions of a prompt share the sameprompt_group_id). A dataset created for prompt v1.0.0 is automatically available when testing v2.0.0.
List All Datasets
prompt_id, prompt_group_id, name, or created_by:
List Datasets for a Prompt
Create Dataset
Datasets are created for a specific prompt (by prompt ID):mutagent-sdk-python/src/mutagent/prompt_datasets.py—PromptDatasets.create_prompt_datasetmutagent-sdk-python/src/mutagent/models/name_description_metadata2.py—NameDescriptionMetadata2
NameDescriptionMetadata2 fields
| Field | Type | Required | Description |
|---|---|---|---|
name | str | Yes | Dataset name |
description | str | No | Dataset description |
metadata | Any | No | Arbitrary metadata |
labels | list[str] | No | Classification labels |
Get Dataset
Update Dataset
Delete Dataset
Useforce=True to delete a dataset that still contains items:
Clone Dataset
Clone a dataset to another prompt. Provide eithertarget_prompt_id or target_prompt_group_id:
Export Dataset
Export a dataset with all items and metadata:Dataset Items
Dataset items are managed via theprompt_dataset_items namespace.
List Items
Add Single Item
Bulk Add Items
Get Item
Update Item
Delete Item
Two-Step Upload Pattern
For uploading datasets from files (JSON, JSONL, CSV), create dataset metadata first, then bulk insert items:Method Reference
Dataset Methods (client.prompt_datasets)
| Method | Description |
|---|---|
list_prompt_datasets(...) | List all datasets with filters |
list_datasets_for_prompt(id_) | List datasets for a prompt |
create_prompt_dataset(id_, body) | Create dataset for a prompt |
get_prompt_dataset(id_) | Get dataset by ID |
update_prompt_dataset(id_, body) | Update dataset |
delete_prompt_dataset(id_, force?) | Delete dataset |
clone_prompt_dataset(id_, body) | Clone dataset to another prompt |
export_prompt_dataset(id_) | Export dataset with all items |
Item Methods (client.prompt_dataset_items)
| Method | Description |
|---|---|
list_prompt_dataset_items(id_) | List dataset items |
create_prompt_dataset_item(id_, body) | Add single item |
bulk_create_prompt_dataset_items(id_, body) | Add multiple items |
get_prompt_dataset_item(id_) | Get item by ID |
update_prompt_dataset_item(id_, body) | Update item |
delete_prompt_dataset_item(id_) | Delete item |