# tinker_cookbook.supervised.FromConversationFileBuilder ## *class* [**tinker_cookbook.supervised.FromConversationFileBuilder**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/data.py#L231)(*[ChatDatasetBuilder](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/supervised/chatdatasetbuilder/index.md)*) Build a supervised dataset from a JSONL file of chat conversations. Each line of the file must be a JSON object with a `"messages"` key whose value is a list of chat messages (dicts with `"role"` and `"content"`). ```python builder = FromConversationFileBuilder( file_path="data/conversations.jsonl", test_size=50, common_config=ChatDatasetBuilderCommonConfig( model_name_for_tokenizer="Qwen/Qwen3-8B", renderer_name="qwen3", max_length=2048, batch_size=8, ), ) train_ds, test_ds = builder() ``` **Fields:** - [**file_path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/data.py#L259) (*str*) - [**test_size**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/data.py#L260) (*int*, default: `0`) - [**shuffle_seed**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/data.py#L261) (*int*, default: `0`) ### [**__call__**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/data.py#L263)() Load the JSONL file and return (train_dataset, test_dataset). **Returns:** *tuple\[[SupervisedDataset](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/supervised/superviseddataset/index.md), [SupervisedDataset](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/supervised/superviseddataset/index.md) | None\]* – Training dataset and an optional held-out evaluation dataset. **Raises:** - DataFormatError: If any line in the file lacks a `"messages"` key.