This is a Flask-based backend API that leverages Together AI and LLaMA 3 (8B Chat) model to:
- Classify user emotions from journal entries or personal messages.
- Respond empathetically to user "curhatan" (emotional expressions) in Bahasa Indonesia.
Classifies a given text into one of six emotions: joy, anger, sadness, love, fear, or surprise.
{
"content": "Isi curhatan atau pesan pengguna di sini"
}{
"text": "Isi curhatan atau pesan pengguna di sini",
"label": "joy",
"score": 30,
"raw_model_output": "1"
}Classifies a given text into one of six emotions: joy, anger, sadness, love, fear, or surprise.
{
"message": "Aku merasa lelah dan tidak tahu harus bagaimana lagi..."
}{
"reply": "Saya mengerti perasaanmu. Kadang kita memang butuh waktu untuk diri sendiri. Jangan menyerah, kamu tidak sendirian."
}To run this project, you'll need the following Python packages:
| Package | Version | Description |
|---|---|---|
Flask |
3.1.1 | Web framework to build the API server |
python-dotenv |
1.1.1 | Load environment variables from .env |
requests |
2.32.4 | Make HTTP requests to Together API |
gunicorn |
latest | Production WSGI server for deployment |
Install all dependencies using:
pip install -r requirements.txt