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, during the import, you choose one pipeline to replay every imported test case on.
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 and a pipeline in the workspace to replay the test cases on.
- Open the Datasets list in Evaluation. If you open it from a pipeline, that pipeline is preselected in the import dialog.
- 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. - In Replay on, choose the pipeline to replay every imported test case on.
- 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 both an archive and a pipeline.
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.
Because the conversation of an imported test case isn't in search history, View chat is disabled for it. Hover over the button to see the reason.
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/importswithfile,pipeline_id, and an optionalname. - 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?