Before you begin
Before you start, make sure you have:- atlanai SDK: Installed with tracing, as in Run your first eval.
- API key and workspace ID: In
ATLAN_API_KEYandATLAN_WORKSPACE_ID. The key must be able to create datasets in the workspace.
1
Check if you need dataset
Stay with inline cases for local iteration. Move to a dataset when results must be compared across runs.
An inline case is a mapping with
input (any JSON value) and optional expected, metadata, tags, and id. Set id on every inline case you may want to resume or compare. If inline cases are enough, skip to Write code scorers.2
Shape each record
Each record field reaches your task or scorer as follows:
If the question is not under
question, set input_key when you create the dataset: push_dataset(client, name, records, input_key="prompt"). It cannot change on a later push. Each record shows input[input_key] as display_input, so tables in the app and coding agents know which field is the question. To pass a whole object to your task, nest it under the key: {"question": {"text": "...", "locale": "fr"}}.Record where each case came from with source_kind and source_ref. Set them on the first push; a later push does not change them.Use
label for curation state, such as needs_review, and categories for the scenario.3
Push cases to dataset
push_dataset (pushDataset in TypeScript) creates the dataset on the first call and syncs its records on every later call. An unchanged record is left alone, so pushing the same suite on every CI run creates no empty versions. A run’s snapshot holds at most 10,000 records, so split a larger suite into several datasets.- Python
- TypeScript
['created', 'created']. Later pushes report unchanged or updated per record.Dataset names are unique in the workspace, and pushing to an existing name adds to that dataset. If the name might be taken, check suite.created and each record’s action.4
Run eval on dataset
Pass the dataset ID, or its exact name, to Results carry only the record ID as
Eval. A missing or ambiguous name fails rather than picking a close match.case_id. Keep the names map from suite.records to print readable failures.When the run starts, it records a snapshot of every live record’s version, and runs from that snapshot. Editing a record’s input, expected outcome, label, categories, or extra adds a new version, so a correction changes only later runs; an edit to only its display name or description lands on the current version. Earlier versions stay readable at GET /eval/v1/datasets/{dataset_id}/records/{record_id}/versions/{n}. See Eval object fields.5
Verify dataset records
- Check in the app: Open Evals, then Datasets, and select the dataset. It lists one record per case you pushed.
- Check in code: List records with
client.datasets.records.list. It acceptsq(a substring over input, expected, label, and categories),label,category,source_kind, andsource_ref.
ValueError naming input_key, a record is missing the question key. See Eval errors.6
Create CSV-backed dataset (optional)
A dataset can instead be backed by an uploaded CSV file, for example one created in the app. The CSV needs a unique, non-empty Read a version’s content back with
case_id column and a column named after the dataset’s input_key. Files are limited to 32 MiB, 100,000 rows, and 256 columns. Each upload is a new dataset version.Reserve an upload, send the bytes, then create the dataset with the upload key:GET /eval/v1/datasets/{id}/versions/{n}/content.The SDK works with a CSV-backed dataset directly, so you do not need your own runner to run one:- Run it: Pass it to
Evalas you would a record-backed dataset.Evalreads the pinned version the experiment’s snapshot points at, each row becomes a case, and each result names its row bycase_idinstead ofdataset_record_id. - Update it: Push a suite with
push_dataset(Python) orpushDataset(TypeScript). The SDK appends a new CSV version with the changed and new cases and leaves the other rows as they are, so a push where every case comes backunchangedwrites no version. If the dataset changed since the SDK read it, the push fails; reload it and push again. - Read its content:
client.datasets.versions.get_content(dataset_id, version)in Python, orclient.datasets.versions.getContent(datasetId, version)in TypeScript, returns the CSV text of one version.
input object, a number, or a boolean; cells in a CSV you upload yourself stay text. To record a CSV dataset’s runs from your own harness instead, see Record runs from your own harness.Troubleshooting
Dataset failures include a dataset with no cases, a CSV file that fails Atlan’s checks, a record without theinput_key, and a transient record_push_failed. See Eval errors.
Next steps
- Write code scorers: Score each case’s output against its expected value.
See also
- Eval object fields: Dataset and record fields, versions, and snapshots.
- Turn production failures into test cases: Add a reviewed session to a dataset.
- Eval options and errors: Limits and API routes.