@arizeai/phoenix-client/datasets entrypoint covers dataset creation (which upserts by name), record inspection, example appends, split management, and both global dataset-label resources and their dataset assignments.
Relevant Source Files
src/datasets/createDataset.tsfor the exact return shape and upsert-by-name behaviorsrc/datasets/datasetLabelTypes.tsfor the generated dataset-label request and response typessrc/datasets/datasetLabelAssignments.tsfor dataset label assignment helpers
Create A Dataset
id is optional. When you do provide it, give every example its own value:
example IDs are unique per dataset, so reusing one across examples in the same
dataset is an error. A stable, unique id is what createDataset() matches on
when it upserts, and what you can hand to the split helpers below instead of the
server-generated nodeId. Omit id and the server generates one for you.
Upsert Or Append
createDataset() upserts by name: re-running it with the same name updates the existing dataset to match the examples you pass, and an unchanged upload is a no-op. To keep existing examples and add more, use appendDatasetExamples() instead of re-running createDataset() with the extra examples.
createDataset() returns { datasetId }, so you can pass that object directly as the dataset selector for append or experiment calls.
Organize Datasets With Labels
Dataset label assignment helpers accept either a dataset name or a Phoenix GlobalID. Label IDs are Phoenix GlobalIDs returned by the dataset-label API or shown in Phoenix. The following workflow creates a shared label, applies it to a dataset, and then uses replacement to make the dataset’s organization declarative:replaceLabelsForDataset() treats
labelIds as the complete desired set.
Read Back Dataset State
UsegetDataset, getDatasetExamples, and getDatasetInfo to inspect datasets after creation.
Manage Splits On An Existing Dataset
UsecreateDatasetSplit, updateDatasetSplit, and deleteDatasetSplit to
manage train, test, validation, or other named subsets after a dataset exists.
Select the dataset by name or GlobalID. Example membership accepts either the
user-provided id or Phoenix nodeId returned by getDatasetExamples.
nodeId only — user-provided id values are accepted from the release that
follows 20.15.0, so pass nodeId when you target an older server.
Manage Dataset Label Resources
Dataset labels are reusable, global resources for organizing datasets. The datasets entrypoint provides typed helpers to list, get, create, update, and delete those resources.Create And Read Labels
Names are unique across Phoenix. Creating a label whose name already exists rejects with anHttpError whose status is 409.
List Labels With Cursor Pagination
listDatasetLabels() returns one page at a time. Pass nextCursor from one result as cursor on the next request.
Update Or Delete A Label
Updates are partial: omitted fields stay unchanged, anddescription: null clears the description. Deleting a global label also removes every assignment of that label.
Dataset assignments use the separate
/v1/datasets/{dataset_identifier}/labels routes. They control which existing labels are applied to a dataset and do not create, update, or delete the global resources documented here.
Source Map
src/datasets/createDataset.tssrc/datasets/appendDatasetExamples.tssrc/datasets/getDataset.tssrc/datasets/getDatasetExamples.tssrc/datasets/getDatasetInfo.tssrc/datasets/datasetLabelTypes.tssrc/datasets/listDatasetLabels.tssrc/datasets/getDatasetLabel.tssrc/datasets/createDatasetLabel.tssrc/datasets/updateDatasetLabel.tssrc/datasets/deleteDatasetLabel.tssrc/datasets/datasetLabelAssignments.tssrc/datasets/createDatasetSplit.tssrc/datasets/updateDatasetSplit.tssrc/datasets/deleteDatasetSplit.ts

