API Documentation
Chat Endpoint
POST /chat
Request Body
{
"message": "string",
"user_id": "string"
}
Response
{
"response": "string"
}
Example
Using curl:
curl -X POST "http://localhost:8000/chat" \
-H "Content-Type: application/json" \
-d '{
"message": "What should I eat after a workout?",
"user_id": "user123"
}'
Important Notes
- • The server must be running on localhost:8000
- • A valid Hugging Face API key is required in the .env file
- • Conversation history is stored in memory and resets on server restart
- • All responses are generated using the Mistral-7B-Instruct model