Skip to content

MindGardenApp/backend-api-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Emotion Classifier & Supportive Chatbot API (Flask + Together AI)

This is a Flask-based backend API that leverages Together AI and LLaMA 3 (8B Chat) model to:

  1. Classify user emotions from journal entries or personal messages.
  2. Respond empathetically to user "curhatan" (emotional expressions) in Bahasa Indonesia.

πŸ“Œ Endpoints

POST /predict – Emotion Classification

Classifies a given text into one of six emotions: joy, anger, sadness, love, fear, or surprise.

βœ… Request

{
  "content": "Isi curhatan atau pesan pengguna di sini"
}

πŸ” Response

{
  "text": "Isi curhatan atau pesan pengguna di sini",
  "label": "joy",
  "score": 30,
  "raw_model_output": "1"
}

POST /curhat – Empathetic Response

Classifies a given text into one of six emotions: joy, anger, sadness, love, fear, or surprise.

βœ… Request

{
  "message": "Aku merasa lelah dan tidak tahu harus bagaimana lagi..."
}

πŸ” Response

{
  "reply": "Saya mengerti perasaanmu. Kadang kita memang butuh waktu untuk diri sendiri. Jangan menyerah, kamu tidak sendirian."
}

πŸ“„ Requirements

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages