An interactive AI-powered chatbot built using Google Gemini API and Streamlit. This project allows users to chat with Google’s Gemini model through a clean and responsive web interface.
- 💬 Real-time chat with Google Gemini AI
- 🧠 Context-aware responses using session history
- 🎨 Clean UI using Streamlit theme configuration
- 🔐 Secure API key handling using
.envfile - ⚡ Lightweight and easy to run locally
- Python
- Streamlit
- Google Gemini API
- python-dotenv
GeminiAI_ChatBot/
│
├── app.py
├── requirements.txt
├── .env
├── .streamlit/
│ └── config.toml
└── README.md
- Python 3.9 or higher
- A Google Gemini API key
👉 Get your API key from: https://ai.google.dev/
git clone https://github.com/srinidhi-2006-bit/GeminiAI_ChatBot.git
cd Gemini_ChatBotpython -m venv venv
venv\Scripts\activate # Windowspip install -r requirements.txtIn the project root, create a file named .env and add:
GEMINI_API_KEY=your_api_key_here
---
### 5️⃣ Streamlit Theme Configuration (Optional)
Create a folder `.streamlit` and inside it create `config.toml`:
```toml
[theme]
primaryColor = "#4F46E5"
backgroundColor = "#0E1117"
secondaryBackgroundColor = "#262730"
textColor = "#FAFAFA"
font = "sans serif"streamlit run app.pyOpen in browser: 👉 http://localhost:8501
-
Type a greeting like “Hi”
-
Ask questions like:
- What is Artificial Intelligence?
- Explain machine learning in simple terms
- What are the latest AI trends?
If you encounter an error like:
RESOURCE_EXHAUSTED (429)
It means:
- You have reached the free-tier quota limit
- Please wait and retry, or
- Enable billing in Google AI Studio for higher usage limits
🔗 More info: https://ai.google.dev/gemini-api/docs/rate-limits