A Flask-based chatbot that allows users to chat with fictional or real-world characters using Google's Gemini API. The app features a simple web interface where users can enter a character's name once and then engage in continuous conversation.
- 🌟 Chat with any character of your choice
- 💬 Simple web-based interface
- 📏 Limits response length for concise conversations
- ☁️ Easily deployable to Render
📁 nlp-character-chatbot
│── 📁 templates
│ └── index.html # Web interface for the chatbot
│── app.py # Flask application
│── requirements.txt # Dependencies
│── render.yaml (optional) # Render deployment config
│── README.md # Project documentation
Ensure you have Python 3.8+ installed on your machine.
git clone https://github.com/Swaraj-sync/ChatChar.git
cd ChatCharpip install -r requirements.txtYou need a valid Google Gemini API Key to run the chatbot. Set it as an environment variable:
export GEMINI_API_KEY="your_gemini_api_key"For Windows (Command Prompt):
set GEMINI_API_KEY=your_gemini_api_keypython app.pyThe app will be available at http://127.0.0.1:5000.
- Push your code to GitHub/GitLab.
- Log in to Render and create a new web service.
- Connect your repository.
- Set up the environment variable
GEMINI_API_KEY. - Configure build and start commands:
- Build Command:
pip install -r requirements.txt - Start Command:
gunicorn app:app
- Build Command:
- Deploy and get a public URL!
You can also test the chatbot via cURL or Postman:
curl -X POST -H "Content-Type: application/json" \
-d '{"character_name":"Sherlock Holmes","user_input":"How do you solve a case?"}' \
(https://chatchar-fuzu.onrender.com/)✅ Add chat history feature
✅ Improve response formatting
✅ Enhance UI with Bootstrap/Tailwind
Feel free to fork this repository, make improvements, and submit a pull request. Contributions are welcome!