Import and Export a DatasetBeta
To reuse test cases you built in one workspace, export the Dataset as a ZIP archive and import it into another workspace. For example, you can check a pipeline in a staging workspace with the same conversations you collected in production.
About This Task
An export contains the Dataset and every conversation its test cases replay. The archive leaves out who ran each conversation, API keys, feedback, and pipeline logs.
Table-based test cases have no conversation. The archive carries their rows instead: each row's inputs and expected data. For background, see Table-Based Test Cases.
When you import an archive, the platform stores the conversations with the new Dataset. You can replay them in the workspace they were imported into, even though the conversations don't appear in search history.
The pipelines that test cases were recorded on often belong to another workspace or no longer exist. So an archive is imported as it is: its test cases belong to no pipeline, and each one runs on whichever pipeline version an Experiment picks.
Export a Dataset
- Open the Datasets list in Evaluation, and click the Dataset you want to export.
- Click Export.
The export starts. When it finishes, your browser downloads the archive as
<dataset-name>-<date>.zip, and a confirmation says that the download has started. - If a warning appears, read which test cases it names. The export leaves out test cases whose conversations are no longer complete in search history. To include them, fix the cause or remove them from the Dataset, and export again.
The Export button isn't available for a Dataset that has no test cases.
If the export fails, a notification says The Dataset could not be exported. Try again.
Import a Dataset
Before you start, make sure you have the exported .zip archive. You don't need to choose a pipeline.
- Open the Datasets list in Evaluation. A pipeline's Datasets tab lists every Dataset in the workspace, so you can also start there.
- Click Import. The button is next to New Dataset. If the list is empty, it's also in the empty state.
- In Archive, drop the exported
.zipfile or click to choose it. - Optional: In Name (optional), type a name for the new Dataset. If you leave it empty, the Dataset keeps the name from the archive.
- Click Import. When the import finishes, a confirmation appears and the new Dataset opens. If the import fails, a notification says that the Dataset could not be imported, and the dialog stays open so you can try again.
Import stays unavailable until you choose an archive.
To create a Dataset from rows you already have in a spreadsheet, import a CSV or XLSX table in the same dialog. Drop the file instead of an archive, choose each column's role and type, and the rows become the test cases of a new Dataset. You don't choose a pipeline for a table. When the import finishes, the new Dataset opens, as it does for an archive. If it fails, the dialog stays open so you can fix the file and try again. For the steps, see Add the Rows.
Work With Imported Test Cases
Imported test cases appear in the Dataset's test case table with an Imported tag. You can replay them in Experiments like any other test case.
An imported test case has no pipeline, so the Experiment you run decides which pipeline version replays it.
To read an imported conversation and open its traces, click View chat. For details, see View an Imported Conversation and Its Traces.
Import and Export a Dataset with the API
Export and import run in the background, so each request returns a transfer that you check until it ends:
- To export, send a
POSTrequest to/api/v2/workspaces/{workspace_id}/evaluation/datasets/{dataset_id}/exports. - To import, send a multipart
POSTrequest to/api/v2/workspaces/{workspace_id}/evaluation/datasets/importswithfileand an optionalname. Leave outpipeline_idwhen you want to replay the same test cases on different pipelines: without it, the test cases belong to no pipeline, so a suite replays each one on whichever pipeline it runs on. Thepipeline_idfield is deprecated: if you send it, every imported test case is bound to that pipeline, which must be in the workspace. If that pipeline is deleted before the import runs, the test cases belong to no pipeline. - To check a transfer, send a
GETrequest to/api/v2/workspaces/{workspace_id}/evaluation/datasets/transfers/{transfer_id}. When an export ends, download the archive from/api/v2/workspaces/{workspace_id}/evaluation/datasets/transfers/{transfer_id}/archive.
Related Information
Was this page helpful?