https://github.com/tdiprima/ai-chart-builder
AI-powered chart building
https://github.com/tdiprima/ai-chart-builder
ai-charting azure-openai data-visualization gpt-4o natural-language-interface openai-api plotly
Last synced: 3 months ago
JSON representation
AI-powered chart building
- Host: GitHub
- URL: https://github.com/tdiprima/ai-chart-builder
- Owner: tdiprima
- License: mit
- Created: 2025-03-31T19:10:01.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-11T18:31:31.000Z (6 months ago)
- Last Synced: 2025-06-07T07:36:42.747Z (4 months ago)
- Topics: ai-charting, azure-openai, data-visualization, gpt-4o, natural-language-interface, openai-api, plotly
- Language: Python
- Homepage:
- Size: 286 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# β‘ AI Chart Builder
Turn plain English into clean, dynamic charts β powered by GPT-4o, LLaMA 4, or whatever AI provider fits your vibe.
Built with Plotly + Dash. Just type your prompt ("Bar chart of sales by region"), and boom: chart.
## π§ What's Inside
- One unified script: `ai_chart_builder.py`
- Choose from **Azure OpenAI**, **OpenAI**, or **Groq (LLaMA 4)**
- Easy switch via a single `AI_PROVIDER` variable
- Web UI with prompt box + model picker
- Handles errors, shows retries, and gives you Plotly charts like magic---
## π Quickstart
### 1. Clone it
Download or clone the repo. Make sure you have Python 3.8+.### 2. Install deps
```bash
pip install dash dash-bootstrap-components pandas plotly pandas-datareader openai groq python-dotenv
```### 3. Set up `.env`
Create a `.env` file next to the script with any of these:```env
# Azure
AZURE_OPENAI_ENDPOINT=your_azure_endpoint
AZURE_OPENAI_KEY=your_key
OPENAI_API_VERSION=2023-05-15# Groq
GROQ_API_KEY=your_groq_key
```(OpenAI uses your default config β no extra setup needed.)
### 4. Pick your AI provider
At the top of `ai_chart_builder.py`:```python
AI_PROVIDER = "openai" # Options: "azure", "groq", "openai"
```Comment out the config blocks for the providers you *donβt* use.
### 5. Run it
```bash
python ai_chart_builder.py
```Open [http://localhost:8050](http://localhost:8050) and go wild.
---
## π Features
- π Easily switch between providers
- π Natural language β Plotly charts
- π§ Supports model selection (GPT-4o, 3.5, etc.)
- π§Ό Handles errors + retries
- ποΈβπ¨οΈ Clean Dash interface with spinner + logs---
## π€― Troubleshooting
- **API errors?** Check your `.env`.
- **No data?** Prompt might be too vague.
- **Weird chart?** Thatβs the AI being quirky. Try again or switch models.
- **Missing packages?** Reinstall with `pip`.---
## π Contribute
Fork, tweak, PR, repeat. Open to ideas, bug reports, and feature adds.
> *Heads-up:* Sometimes the model forgets to put the date in the title. Sometimes it hallucinates. Don't trust it with your taxes.
---
## π License
[MIT](LICENSE). Go nuts β just credit me when you use it.