This project contains an Azure Function that provides dog food recommendations based on a dog's breed, weight, age, and health conditions. The function is accessible via an HTTP POST request which expects a json and returns a list of recommended dog food options.
-
POST Endpoint:
recommendation/dogs
to get dog food recommendations. -
Input Parameters: Breed, Animal Weight, Age, Health Conditions.
// Input Example { "breed": "German Shepherd", "animalWeight": 30, "age": 5, "conditions": ["Joint Care", "Food Allergy"] }
-
Output: A list of recommended dog foods based on the input criteria.
// Output Example
[
{
"name": "Royal Canin® Breed Health Nutrition® German Shepherd Adult Dry Dog Food",
"brand": "Royal Canin",
"price": 122.99,
"calories": 327
},
{
"name": "Blue Buffalo® Basics™ Small Breed Adult Dry Dog Food - Natural, Turkey",
"brand": "Blue Buffalo",
"price": 30.99,
"calories": 453
},
{
"name": "Royal Canin® Size Health Nutrition Large Adult 5+ Dry Dog Food",
"brand": "Royal Canin",
"price": 122.99,
"calories": 414
}
]
- Clone the repository to your local machine.
- Navigate to the project directory.
- Create a new virtual environment:
python -m venv .venv
- Activate the virtual environment:
# Windows
.venv\Scripts\activate
# Linux / MacOS
source .venv/bin/activate
- Install the dependencies:
pip install -r requirements.txt
- Start the function locally by running:
func start
- The function will be available at
http://localhost:7071/api/recommendation/dogs
.
You can test the function using this CURL command:
curl -X POST http://localhost:7071/api/recommendation/dogs \
-H "Content-Type: application/json" \
-d '{"breed": "German Shepherd", "animalWeight": 30, "age": 5, "conditions": ["Joint Care", "Food Allergy"]}'