How to prepare the dataset to get output in JSON Format

I have to fine-tune the davinci model to give the output in a particular JSON format. How should I prepare the dataset for that?

Here is an example

{"messages": [{"role": "system", "content": "Given the description for a video or image, generate a JSON."}, {"role": "user", "content": "A video that is 1920x1080 and 3 seconds long, with the text 'This text is only visible for one second' in white on a black background. The text should only be visible for one second."}, {"role": "assistant", "content": "{\"output_format\": \"mp4\", \"width\": 1920, \"height\": 1080, \"duration\": \"3 s\", \"elements\": [{\"type\": \"text\", \"track\": 1, \"time\": \"0 s\", \"duration\": \"1 s\", \"x\": \"50%\", \"y\": \"50%\", \"background_color\": \"#000000\", \"font_color\": \"#ffffff\", \"text\": \"This text is only visible for one second\"}]}"}]}