I noticed that, at least with the models I tested (gpt 3.5, 4o and llama 3.1 8b), to get a response with just the JSON and then have it follow the exact structure so it correctly renders the topic and subtopics was the hardest part.
Ended up having to prompt I think twice (at the beginning and the end) so it finally followed the exact JSON structure.
Was there anything particularly interesting about how you built it or the prompts needed to get decent results?