A Flask-based chatbot that uses Google's Gemini AI for conversations and OpenWeather API for weather information. It also supports file uploads and querying document contents.
- Chat with Gemini AI
- Get weather information for any city
- Upload and query documents (supports PDF)
- Web interface with multiple themes
- Clone the repository
git clone <your-repo-url>
cd CHATBOT- Create a virtual environment and activate it
python -m venv env
# On Windows
env\Scripts\activate
# On Unix or MacOS
source env/bin/activate- Install dependencies
pip install -r requirements.txt-
Set up environment variables
- Copy
.env.exampleto.env - Add your API keys:
- Get a Gemini API key from Google AI Studio
- Get an OpenWeather API key from OpenWeather
- Copy
-
Run the application
python chatbot_flask.pyThe application will be available at http://localhost:5000
Create a .env file in the root directory with the following variables:
GEMINI_API_KEY=your_gemini_api_key_here
OPENWEATHER_KEY=your_openweather_api_key_here
chatbot_flask.py: Main Flask applicationstatic/: Static files (images, styles)templates/: HTML templatesuploaded_files/: Directory for uploaded documentsrequirements.txt: Project dependencies