feat: Auto-generate chart title and description (AI)
Closes #2424
This PR introduces a way to auto-generate chart title and description with AI (gemini-2.5-flash) by clicking a star icon when in annotations panel. This takes all relevant context into account (cube metadata, dimensions metadata, observations, chart type and filters) to produce quality outputs.
Notes
Currently, this feature uses a free-tier Gemini API key (max 250 requests per day). If we'd like to proceed with these features, we'd need to implement proper caching and get a proper API key (and maybe also test other LLM models).
How to test
- Go to this link.
- Select any dataset and starting making a chart.
- Click on "Add title" or "Add description".
- See there's a new star icon in the Markdown editor toolbar.
- ✅ Click on it to see the text gets automatically generated and added to the text box.
- ✅ Try auto-generating the text in a different language and see that it also works.
- ✅ Change filters, chart type, etc – significant changes – and regenerate the text again to see that it matches the new chart state.
TODO
- [ ] Pass GEMINI_API_KEY to Docker, add to all relevant places
- [ ] Add caching
- [ ] I added a CHANGELOG entry
- [ ] I made a self-review of my own code
- [ ] I wrote tests for the changes (if applicable)
- [ ] I wrote configurator and chart config migrations (if applicable)
Related: https://github.com/visualize-admin/visualization-tool/pull/1591
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| visualization-tool | Preview | Comment | Aug 20, 2025 2:30pm |