Pandas AI Web 是一个基于 PandasAI 和 Gradio 开发的智能数据对话应用。只需上传 CSV 或 Excel 文件,选择 AI 模型,即可用自然语言与您的数据进行对话,获取数据洞察和可视化图表。
- 🌐 双语界面(中文/English)
- 🤖 多种 AI 模型支持:OpenAI、Azure OpenAI、本地 Ollama 模型
- 📊 支持 CSV、XLS、XLSX 文件格式
- 🔍 自动编码识别(UTF-8、GBK 等)
- 📈 智能图表生成(饼图、柱状图、折线图、雷达图等)
- 🎨 中文字符完美支持
- 💬 对话历史记录存储
- 🔄 会话管理与加载
- 🐳 Docker 容器化部署
- 📱 响应式界面设计
-
克隆仓库:
git clone https://github.com/sawyer-shi/pandas-ai-web.git cd pandas-ai-web
-
配置环境变量:
cp env.docker-example .env # 编辑 .env 文件,配置您的 API 密钥
-
启动服务:
docker-compose up -d
-
访问应用: 打开浏览器访问
http://localhost:7860
-
创建虚拟环境:
python -m venv .venv # Windows .venv\Scripts\activate # macOS/Linux source .venv/bin/activate
-
安装依赖:
pip install -r requirements.txt
-
配置环境变量:
cp env.example .env # 编辑 .env 文件
-
启动应用:
python main.py
- 选择 AI 模型(OpenAI、Azure OpenAI 或 Ollama)
- 上传 CSV 或 Excel 数据文件
- 在对话框中输入您的问题
- 查看 AI 生成的答案和图表
- 使用历史记录功能回顾之前的对话
- 数据统计分析:"这个数据集有多少行?"
- 数据可视化:"用柱状图展示销售数据"
- 趋势分析:"销售额的变化趋势如何?"
- 数据筛选:"显示销售额大于1000的记录"
- 对比分析:"比较不同地区的销售情况"
环境变量配置(.env
文件):
# 服务器配置
GRADIO_SERVER_PORT=7860
GRADIO_SHARE=false
# OpenAI 配置
OPENAI_API_KEY=your_openai_key
OPENAI_BASE_URL=https://api.openai.com/v1
# Azure OpenAI 配置
AZURE_OPENAI_API_KEY=your_azure_key
AZURE_OPENAI_ENDPOINT=your_azure_endpoint
AZURE_OPENAI_API_VERSION=2024-02-01
# Ollama 配置
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3
# 默认设置
DEFAULT_LLM_TYPE=Ollama
欢迎提交 Issue 和 Pull Request!
- Fork 本仓库
- 创建您的特性分支 (
git checkout -b feature/AmazingFeature
) - 提交您的更改 (
git commit -m 'Add some AmazingFeature'
) - 推送到分支 (
git push origin feature/AmazingFeature
) - 打开 Pull Request
本项目使用 MIT 许可证。详情请参阅 LICENSE 文件。
Pandas AI Web is an intelligent data conversation application built on PandasAI and Gradio. Simply upload a CSV or Excel file, select an AI model, and interact with your data using natural language to gain insights and visualizations.
- 🌐 Bilingual interface (Chinese/English)
- 🤖 Multiple AI model support: OpenAI, Azure OpenAI, local Ollama models
- 📊 Support for CSV, XLS, XLSX file formats
- 🔍 Automatic encoding detection (UTF-8, GBK, etc.)
- 📈 Smart chart generation (pie, bar, line, radar charts, etc.)
- 🎨 Perfect Chinese character support
- 💬 Chat history storage
- 🔄 Session management and loading
- 🐳 Docker containerized deployment
- 📱 Responsive interface design
-
Clone the repository:
git clone https://github.com/sawyer-shi/pandas-ai-web.git cd pandas-ai-web
-
Configure environment variables:
cp env.docker-example .env # Edit the .env file to configure your API keys
-
Start the service:
docker-compose up -d
-
Access the application: Open your browser and visit
http://localhost:7860
-
Create virtual environment:
python -m venv .venv # Windows .venv\Scripts\activate # macOS/Linux source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
cp env.example .env # Edit the .env file
-
Start the application:
python main.py
- Select AI model (OpenAI, Azure OpenAI, or Ollama)
- Upload CSV or Excel data file
- Enter your questions in the chat box
- View AI-generated answers and charts
- Use history feature to review previous conversations
- Data statistics: "How many rows are in this dataset?"
- Data visualization: "Show sales data with a bar chart"
- Trend analysis: "What's the trend in sales?"
- Data filtering: "Show records with sales > 1000"
- Comparative analysis: "Compare sales across different regions"
Environment variables (.env
file):
# Server configuration
GRADIO_SERVER_PORT=7860
GRADIO_SHARE=false
# OpenAI configuration
OPENAI_API_KEY=your_openai_key
OPENAI_BASE_URL=https://api.openai.com/v1
# Azure OpenAI configuration
AZURE_OPENAI_API_KEY=your_azure_key
AZURE_OPENAI_ENDPOINT=your_azure_endpoint
AZURE_OPENAI_API_VERSION=2024-02-01
# Ollama configuration
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3
# Default settings
DEFAULT_LLM_TYPE=Ollama
Issues and Pull Requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.