Documentation Index
Fetch the complete documentation index at: https://turnwise.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Data Preparation
Preparing your conversation data correctly ensures smooth imports and better evaluation results. This guide covers best practices for structuring your data.Data Structure Guidelines
Minimal Valid Format
The simplest valid TurnWise file:Recommended Format
For better evaluation results, include more context:Field Guidelines
Conversations
Required:messages array
Recommended:
name: Human-readable identifierdescription: Context about the conversationmeta: Custom metadata (customer IDs, timestamps, tags)
agents: Agent definitions with tools (enables tool evaluation)
Messages
Required:role: One ofuser,assistant,system,tool
content: Message text content
steps: Reasoning steps (enables step-level evaluation)meta: Message metadata (timestamps, latency, etc.)
Steps
Required: At least one content field (thinking, tool_call, tool_result, output_content)
Recommended:
model_name: Model used for this stepagent_name: Agent that executed this step (for multi-agent systems)
thinking: Model’s reasoningtool_call: Tool invocation detailstool_result: Tool execution resultoutput_content: Final text outputoutput_structured: Structured output (JSON)
When to Use Steps
Use steps when you want to evaluate:Reasoning Quality
Evaluate if the agent’s thinking is sound
Tool Selection
Check if the right tools were used
Parameter Accuracy
Verify tool arguments are correct
Error Handling
See how agent responds to failures
When to Define Agents
Define agents when:- Tool Usage: Your agent uses tools
- Multi-Agent Systems: Multiple agents in one conversation
- Tool Evaluation: You want to evaluate tool selection/usage
- Documentation: Self-documenting data
Metadata Usage
Usemeta fields to store custom data:
Conversation Metadata
Message Metadata
Handling Large Datasets
Splitting Large Files
If you have thousands of conversations:- Split by Date: Group by time period
- Split by Category: Group by conversation type
- Split by Size: Keep files under 10MB
Batch Import
Import in batches:Performance Tips
- Compress JSON: Remove unnecessary whitespace
- Omit Optional Fields: If not needed, omit them
- Message Order: Message order is automatically inferred from array position
Data Quality Checklist
Before importing, verify:- Valid JSON syntax
- Root object has
conversationsarray - Each conversation has
messagesarray - Each message has
role - Roles are valid (
user,assistant,system,tool) - Messages are in chronological order (order is inferred from array position)
- Steps have at least one content field
- Tool calls match agent definitions (if agents defined)
Common Patterns
Pattern 1: Simple Chat
Pattern 2: With System Message
Pattern 3: With Steps
Pattern 4: With Tools
Next Steps
Setup Guide
Learn how to import your prepared data
Data Format
Understand the complete data format schema