train sl expects. Use rlcli import to flatten content blocks, normalize roles, filter short threads, and pipe the results directly into training.
Usage
Positional argument
Flags
Input format.
messages:{"messages": [...]}per line (default).openai: chat-completions dumps. Tool-calls turns are dropped.anthropic: Messages API dumps. Content blocks are flattened into plain text;tool_use,tool_result,image, andthinkingblocks are dropped. Top-levelsystemis kept as a system message.
Role normalization
rlcli normalizes roles as follows:human→userai/model→assistantsystem→systemtool,function,tool_result→ dropped
Content flattening
- Plain strings are kept as-is.
- Anthropic-style content blocks: only
type: "text"blocks are kept and joined with newlines. All other block types are dropped.
Validation
A conversation is kept only when it has at least--min-messages messages and at least one assistant message after normalization.
Errors
ImportFormatErroris raised with a line number on malformed JSON or unknown format strings.- If no usable conversations are found, the command exits with code
1.
Output
The command writes the normalized JSONL to stdout or--out and prints a count to stderr: