This project is a Django-based RESTful API that provides endpoints for querying a chatbot powered by GPT-3.5 to answer questions related to healthy foods.
-
Clone the repository:
git clone https://github.com/your-username/django-rest-project.git
-
Create a virtual environment:
cd django-rest-project python3 -m venv env source env/bin/activate
-
Install the dependencies
pip install -r requirements.txt
-
Run database migrations
python manage.py migrate
-
Start the development server:
python manage.py runserver
-
Access the API in your browser at http://localhost:8000/chatbot_api/.
No Authorizations are required for accessing below mentioned api endpoints
-
/chatbot_api/food_search/:
POST: Make a query if a food item matches your diet plan.
Request Body{ "food":"<food-item-name>", "diet":"<diet-plan-name>" }
Response
{ "response":"<text-response>", }
-
/chatbot_api/diet_selector/:
POST: Suggest a diet plan according to user requirements.
Request Body{ "age": "", "sex": "", "height": "", "weight": "", "to_gain_or_loose": "", "vegan_or_non": "" }
Response
{ "response":"<text-response>", }