PengoSword123/emotionSteps
1
This is a FastAPI service that detects emotion in text and answers with a Retrieval-Augmented Generation (RAG) pipeline.
Setup (Windows PowerShell)
- Create and activate a virtual environment:
python -m venv .venv
. .venv\Scripts\Activate.ps1- Install dependencies:
pip install -r requirements.txt- (Optional) Set your Hugging Face token to use hosted models:
$env:HUGGINGFACEHUB_API_TOKEN = "hf_...your_token..."- Run the API:
python app.py- Test endpoints:
- Health:
GET http://localhost:8000/health - Process:
POST http://localhost:8000/processwith JSON body:
{ "message_text": "I am frustrated with my laptop." }The service will return the detected emotion, an answer, and proof links or snippets from the knowledge base.
