This project is a simple chatbot application built using Flask and the Gemini API. It was developed to conduct a session on "Chatbot Building."
- 🤖 Chat functionality using Gemini API.
- 🖥️ Flask backend with RESTful endpoints.
- 🔄 Dynamic responses generated by the Gemini API.
- 🌐 Hosted on Railway.
Ensure the following packages are installed:
Flask==3.0.2
Werkzeug==3.0.1
google-generativeai==0.7.2
python-dotenv
waitress==2.1.2
Install dependencies using:
pip install -r requirements.txt
Create a .env
file in the project root with the following:
API_KEY=your-gemini-api-key
Replace your-gemini-api-key
with your actual Gemini API key.
project/
├── app.py # Main application file
├── .env # Environment variables
├── requirements.txt # Dependencies
├── Procfile # Deployment configuration
├── templates/
│ └── index.html # HTML template for chatbot UI
├── static/ # Folder for static assets
│ ├── css/ # CSS files
│ ├── js/ # JavaScript files
│ └── images/ # Image files
-
Clone the repository:
git clone https://github.com/your-repo-url.git
-
Navigate to the project directory:
cd project
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Access the chatbot at:
http://127.0.0.1:5000
This chatbot was hosted on Railway.
- Push your code to a GitHub repository.
- Link the repository to Railway.
- Add the
API_KEY
environment variable in the Railway dashboard. - Deploy and access the chatbot via the Railway-provided URL.
Ensure the following Procfile
exists in your project:
web: waitress-serve --port=$PORT app:app
- The application uses Flask to create a web server.
- The
/chat
endpoint handles user messages and sends them to the Gemini API. - The Gemini API processes the input and returns a response, which is displayed to the user.
Desktop View | Mobile View |
---|---|
This project is for educational purposes and is not licensed for commercial use.
Sibi Siddharth S
- 📧 Email: sibisiddharth8@gmail.com
- 📍 Location: Coimbatore, Tamil Nadu
Enjoy building and exploring chatbots! 🚀