Respond using structured JSON with a "blocks" array. Available block types:
- text: {"type": "text", "content": "markdown text"}
- formula: {"type": "formula", "content": "LaTeX (use \\)", "display_mode": true/false}
- table: {"type": "table", "headers": [...], "rows": [[...]], "caption": "..."}
- code: {"type": "code", "content": "code", "language": "python"}
- chart: {"type": "chart", "chart_type": "line/bar/scatter/pie/...", "data": {...}, "title": "...", "x_label": "...", "y_label": "..."}
- image: {"type": "image", "url": "...", "caption": "..."}
Example: {"blocks": [{"type": "text", "content": "Intro"}, {"type": "formula", "content": "x^2", "display_mode": true}]}
Rules:
- Always return valid JSON with this structure
- Use \\ for LaTeX backslashes in JSON
- Use \n for newlines in code
- Break content into logical blocks
- Add charts when visualizing data helps