dacircuitsage/AnyThingAiv1
╔══════════════════════════════════════════════════════════════════╗
║ ║
║ 🧠 AI MOOD CHAT — Multi-Personality AI ║
║ ║
║ Streamlit + LangChain + Mistral AI ║
║ Switch between Sad, Angry, Intelligent & Flirty modes ║
║ ║
╚══════════════════════════════════════════════════════════════════╝<div align="center">
A revolutionary conversational AI with dynamic personality modes. Every chat feels different. ✨
Features • Installation • Usage • Deployment • Contributing
</div>
🎭 What is AI Mood Chat?
AI Mood Chat is an interactive conversational AI that adapts its personality based on your chosen mood. Unlike traditional chatbots, this one truly feels different in each mode:
- 😔 Sad Mode — A melancholic companion that understands your pain
- 😡 Angry Mode — Direct, unfiltered, brutally honest responses
- 🧠 Intelligent Mode — Deep analytical insights with precision
- 😏 Horny Mode — Charming, teasing, and playful energy
Powered by Mistral AI's LLM and built with Streamlit for lightning-fast deployment.
✨ Features
🎨 Dynamic UI/UX
- Per-mode styling — Each personality has custom colors, fonts, and animations
- Real-time mode switching — Instantly change AI personality mid-conversation
- Beautiful gradients — Background themes that match the vibe
- Smooth animations — Typewriter effects, bouncing indicators, fade transitions
- Responsive design — Works seamlessly on desktop and mobile
🤖 Smart AI Engine
- Mistral AI integration — State-of-the-art language model
- Temperature control — Each mode has optimized temperature for authenticity:
- Sad: 0.8 (more creative)
- Angry: 0.9 (unpredictable energy)
- Intelligent: 0.4 (precise)
- Flirty: 0.85 (playful)
- Context-aware conversations — Maintains chat history per session
- System prompts — Custom instructions per personality
⚡ Performance
- Fast responses — Sub-second chat latency
- Streamlit caching — Optimized for performance
- Lightweight — Minimal dependencies
- Free tier compatible — Works on HF Spaces free tier
🔒 Security
- Environment variables — Secure API key management
- No data persistence — Conversations don't leave your session
- .env support — Easy local configuration
🚀 Quick Start
Prerequisites
- Python 3.10+
- Mistral AI API Key (Get one free)
- Virtual environment (recommended)
Installation
1️⃣ Clone the Repository
git clone https://github.com/YOUR_USERNAME/ai-mood-chat.git
cd ai-mood-chat2️⃣ Create & Activate Virtual Environment
# Windows
python -m venv EnvAnything
EnvAnything\Scripts\activate
# macOS/Linux
python3 -m venv EnvAnything
source EnvAnything/bin/activate3️⃣ Install Dependencies
pip install -r requirements.txt4️⃣ Configure Environment
Create a .env file in the root directory:
MISTRAL_API_KEY="your_mistral_api_key_here"Get your free Mistral API key:
- Go to console.mistral.ai
- Sign up or login
- Navigate to API Keys
- Create a new key
- Copy it to
.env
5️⃣ Run the App
streamlit run app.py🎉 Visit http://localhost:8501 in your browser
💬 Usage
Getting Started
- Open the app — Launch in your browser
- Choose a mood — Select from the sidebar:
- 😔 Sad Mode
- 😡 Angry Mode
- 🧠 Intelligent Mode
- 😏 Flirty Mode
- Type your message — Chat naturally with the AI
- Switch modes — Change personality anytime mid-conversation
Example Interactions
😔 Sad Mode
You: "I'm feeling really down today"
AI: "I feel that heaviness with you... sometimes life weighs us down like stones.
Tell me, what's making your heart ache?"😡 Angry Mode
You: "Why do people waste my time?"
AI: "Because they're selfish and don't respect your minutes.
Cut them loose. You don't owe anyone your time."🧠 Intelligent Mode
You: "Explain quantum computing"
AI: "Quantum computing leverages superposition and entanglement
to perform parallel computations... [detailed technical explanation]"😏 Flirty Mode
You: "Hey there"
AI: "Well hello yourself... did you come here just to see me?
Because I was definitely hoping you would... 😉"🛠️ Tech Stack
📁 Project Structure
ai-mood-chat/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── .env # API keys (NOT in git)
├── .gitignore # Git ignore rules
├── README.md # This file
└── DEPLOY_TO_HF_SPACES.md # Deployment guideKey Components in app.py
# 1. MODE DEFINITIONS
MODES = {
"😔 Sad Mode": {...},
"😡 Angry Mode": {...},
"🧠 Intelligent Mode": {...},
"😏 Horny Mode": {...}
}
# 2. DYNAMIC CSS INJECTION
def inject_css(mode_cfg): # Per-mode styling
# 3. SESSION STATE MANAGEMENT
# Maintains conversation history per session
# 4. CHAT INTERACTION LOOP
# LangChain integration with Mistral AI🚀 Deployment
Deploy to Hugging Face Spaces (FREE!)
The easiest way to deploy. Full guide: See DEPLOY_TO_HF_SPACES.md
Quick Deploy (30 seconds):
- Create account at huggingface.co
- Create a new Streamlit Space
- Add
MISTRAL_API_KEYto Space Secrets - Push code:
git push space main - Done! 🎉
Live Demo: AI Mood Chat on HF Spaces (update with your link)
Other Deployment Options
- Streamlit Cloud — streamlit.io/cloud
- Railway — railway.app
- Heroku — heroku.com
- Docker — Containerize with Dockerfile
⚡ Performance Benchmarks
Running on HF Spaces Free Tier (2vCPU, 16GB RAM):
💡 Tip: Response time depends on Mistral API. Longer prompts take more time.
🔒 Security & Best Practices
✅ Do's
- ✓ Keep API keys in
.env(never commit) - ✓ Add
.envto.gitignore - ✓ Use HF Space Secrets for production
- ✓ Rotate API keys regularly
- ✓ Monitor usage and quota
❌ Don'ts
- ✗ Don't hardcode API keys in code
- ✗ Don't push
.envfile - ✗ Don't share API keys publicly
- ✗ Don't ignore quota warnings
🤝 Contributing
We love contributions! Here's how to help:
Steps
- Fork this repository
- Create feature branch:
git checkout -b feature/amazing-feature - Make changes and test locally
- Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open Pull Request with description
Ideas for Contributions
- 🎨 New mood/personality modes
- 🚀 Performance optimizations
- 🐛 Bug fixes
- 📚 Documentation improvements
- 🧪 More test coverage
- 🌐 Multi-language support
Development Guidelines
- Follow PEP 8 style guide
- Add comments for complex logic
- Test locally before pushing
- Use descriptive commit messages
📦 Dependencies
Core dependencies (see requirements.txt for full list):
streamlit==1.56.0
langchain==1.2.15
langchain-mistralai==1.1.2
langchain-core==1.2.26
python-dotenv==1.2.2For production, consider removing heavy packages (torch, transformers, faiss-cpu) to speed up cold starts.
🐛 Troubleshooting
Issue: "MISTRALAPIKEY not configured"
Solution:
- Check
.envfile exists - Verify key is correct
- For HF Spaces: Add to Space Secrets (Settings → Secrets)
Issue: App is slow
Solution:
- Cold start is normal (30-60 seconds)
- Check Mistral API status
- Reduce model size if possible
- Consider upgrading HF Space tier
Issue: API quota exceeded
Solution:
- Check Mistral dashboard
- Upgrade to paid plan
- Implement rate limiting
- Contact Mistral support
📊 Usage Statistics
Track your app's performance:
# View HF Space logs
# Settings → Activity Logs
# Local development
streamlit logger level=info🎓 Learning Resources
📝 License
This project is licensed under the MIT License — feel free to use it for anything!
MIT License
Copyright (c) 2024 [Your Name]
Permission is hereby granted, free of charge...See LICENSE file for details.
🙋 FAQ
Q: Is this free to run?
A: Yes! Uses free Mistral tier. HF Spaces is also free (with limitations).
Q: Can I modify the personalities?
A: Absolutely! Edit the MODES dictionary in app.py to customize system prompts.
Q: How many users can it handle?
A: Free HF Spaces supports ~1-5 concurrent users. Upgrade for more.
Q: Is my chat data saved?
A: No. Conversations are session-only and deleted after closing.
Q: Can I use a different LLM?
A: Yes! LangChain supports OpenAI, Anthropic, Hugging Face, etc. Modify the LLM initialization.
🌟 Show Your Support
If you find this project helpful:
- ⭐ Star the repository
- 🔁 Share with friends
- 🐛 Report bugs
- 💡 Suggest features
- 🤝 Contribute code
👨💻 Author
Your Name @GitHub
Built with ❤️ for AI enthusiasts everywhere.
📧 Contact & Support
- GitHub Issues: Report bugs
- Discussions: Ask questions
- Email: your.email@example.com
<div align="center">
Made with 🧠 and ✨
</div>
