guys if u want a data base i will update it in later verrsions
A beautiful, modern AI chatbot powered by Cohere AI with a stunning glassmorphism UI design.
- π¨ Beautiful Glassmorphism UI - Modern, responsive design with dark mode
- π¬ Multi-Conversation Support - Create and manage multiple chat sessions
- π§ AI-Powered Responses - Powered by Cohere's latest
command-a-03-2025model - π Chat History - Maintains conversation context across messages
- β‘ Real-time Responses - Instant AI responses with typing indicators
- π Fully Responsive - Works seamlessly on desktop, tablet, and mobile
- π― Quick Prompts - Pre-defined prompts for quick interactions
- πΎ Session Management - Persistent chat sessions during your browsing session
- Python 3.9 or higher
- Cohere API Key (free trial available at cohere.ai)
-
Clone or download the project
cd "C:\Users\sarja\Downloads\New folder (2)\ChatBot"
-
Install required packages
pip install -r requirements.txt
-
Configure your API key
- Open
app.py - Replace the API key on line 12:
COHERE_API_KEY = "your-api-key-here"
- Open
-
Run the application
python app.py
-
Open in browser
- Navigate to:
http://127.0.0.1:5000
- Navigate to:
ChatBot/
β
βββ static/
β βββ style.css # Main stylesheet with glassmorphism design
β βββ script.js # Frontend JavaScript logic
β
βββ templates/
β βββ index.html # Main HTML template
β
βββ app.py # Flask backend with Cohere API integration
βββ requirements.txt # Python dependencies
βββ README.md # This file
-
Backend:
- Flask 2.3.3 - Python web framework
- Cohere AI - Advanced language model API
- Python Sessions - Chat history management
-
Frontend:
- HTML5 - Structure
- CSS3 - Glassmorphism design with animations
- Vanilla JavaScript - Dynamic interactions
- Font Awesome - Icons
- Inter Font - Typography
- New Chat - Create fresh conversations
- Chat History - View all your conversations in the sidebar
- Clear Chat - Remove messages from current conversation
- Delete Chat - Remove entire conversation
- Clear All - Delete all conversations
- Dark Theme - Eye-friendly dark interface
- Animated Background - Floating gradient orbs
- Glassmorphism - Modern glass-like UI elements
- Responsive Grid - Adapts to any screen size
- Smooth Animations - Polished micro-interactions
In app.py, you can modify the AI behavior:
response = co.chat(
model="command-a-03-2025", # AI model
messages=messages
)Currently uses in-memory storage. For production, replace with a database:
# Current: In-memory dictionary
chat_histories = {}
# Production: Use MongoDB, PostgreSQL, etc.-
"ClientV2 not found"
- Solution: Upgrade Cohere
pip install --upgrade cohere
-
CSS not loading
- Solution: Hard refresh browser (
Ctrl+F5) - Check Flask static file paths in
index.html
- Solution: Hard refresh browser (
-
Model errors
- Ensure using
command-a-03-2025model - Verify API key is valid and has quota
- Ensure using
-
Port already in use
- Change port in
app.py:
app.run(debug=True, port=5001) # Use different port
- Change port in
GET /- Main application pagePOST /api/chat- Send message and get AI responsePOST /api/new-chat- Create new conversationPOST /api/clear-chat- Clear messages in chatPOST /api/delete-chat- Delete conversationGET /api/get-chats- Get all conversationsGET /api/get-chat/<chat_id>- Get specific conversation
- Database integration (MongoDB/PostgreSQL)
- User authentication
- File upload support
- Export chat history
- Voice input/output
- Multi-language support
- Custom AI personality settings
This project is open source and available for educational purposes.
- AI Model: Cohere AI
- Icons: Font Awesome
- Fonts: Google Fonts - Inter
For issues or questions:
- Check the Troubleshooting section
- Review Cohere Documentation
- Ensure all dependencies are installed correctly
Made with β€οΈ using Flask and Cohere AI