Dataset Setup Guide
This guide walks you through creating datasets and importing your conversation data into TurnWise.Creating a Dataset
Via UI
-
Navigate to Datasets
- Click “Datasets” in the sidebar
- Or go to
/datasetsin your browser
-
Create New Dataset
- Click “New Dataset” button in the sidebar
- Fill in the form:
- Name: A descriptive name (e.g., “Customer Support Q1 2024”)
- Description: Optional details about the dataset
-
Save
- Click “Create” to save
- You’ll be redirected to the dataset view
Via API
Importing Conversations
Step 1: Prepare Your JSON File
Your file should follow the TurnWise data format:Step 2: Import via UI
-
Open Your Dataset
- Click on the dataset name
- You’ll see the dataset view
-
Click Import
- Click the “Import” button in the header
- A file upload dialog appears
-
Select File
- Drag and drop your JSON file
- Or click to browse and select
-
Import
- Click “Import” to start
- TurnWise validates your file
Step 3: Validation
TurnWise validates your file structure:1
JSON Parsing
Checks for valid JSON syntax
2
Structure Validation
Verifies required fields (conversations, messages, role)
3
Data Validation
Validates field types and values
Step 4: Handle Validation Errors
If validation fails, TurnWise provides detailed error messages:LLM-Powered Suggestions
Ifget_feedback=true (default), TurnWise uses AI to analyze your format and suggest transformations:
Step 5: Import Success
On successful import, you’ll see:- Conversations imported: Number of conversations added
- Messages imported: Total messages imported
- Steps imported: Total steps imported (if any)
- Errors: Any warnings or errors
Import Options
Import to Existing Dataset
Use this when you want to add more conversations to an existing dataset:Import with New Dataset
Create a dataset and import in one step:file: JSON fileuser_id: Your user IDname: Dataset namedescription: Optional descriptionget_feedback: Enable LLM feedback (default: true)
Common Import Issues
Issue: Invalid JSON
Error:Invalid JSON: Unexpected token
Solution:
- Check for syntax errors (missing commas, quotes, brackets)
- Validate JSON with a JSON validator
- Ensure file is UTF-8 encoded
Issue: Missing Required Fields
Error:Missing required field 'conversations'
Solution:
- Ensure root object has
conversationsarray - Each conversation must have
messagesarray - Each message must have
role
Issue: Invalid Role Values
Error:Invalid role value: 'bot'
Solution:
- Use only:
user,assistant,system,tool - Map your roles to TurnWise roles:
bot→assistanthuman→usersystem→system
Issue: Message Order
Note: Message order is automatically inferred from the array position. Keep messages in chronological order in the array.Issue: Large File Size
Error:File too large or timeout
Solution:
- Split large datasets into multiple files
- Import in batches
- Consider compressing JSON (though TurnWise doesn’t support gzip yet)
Import Best Practices
Validate Locally First
Test your JSON structure before importing
Start Small
Import a few conversations first to verify format
Use Descriptive Names
Name conversations clearly for easier identification
Include Metadata
Use
meta fields to store custom dataData Quality Tips
1. Consistent Formatting
Keep your data format consistent:- Same field names across conversations
- Consistent role values
- Sequential sequence numbers
2. Complete Conversations
Include full conversations:- Don’t truncate mid-conversation
- Include all messages
- Preserve message order
3. Rich Context
Include as much context as possible:- Message content
- Steps with thinking/reasoning
- Tool calls and results
- Agent definitions
4. Metadata
Usemeta fields for additional context:
- Timestamps
- User IDs
- Session IDs
- Custom tags
After Import
Once imported, you can:- View Conversations: Browse your conversations in the hierarchical table
- Create Metrics: Add evaluation metrics to measure quality
- Run Evaluations: Evaluate conversations, messages, or steps
- Export Results: Export evaluation results for analysis