Recipe_Finder / recipe_suggestions.py
PrashanthB461's picture
Create recipe_suggestions.py
a053615 verified
raw
history blame contribute delete
681 Bytes
# Recipe suggestions module
def get_recipe_suggestion(ingredients):
ingredient_list = ingredients.split(",")
# Here, you would ideally load a more complex model or recipe database.
recipes = {
"rice, milk, jaggery": "Kheer (Indian Rice Pudding)",
"tomato, onion, garlic, rice": "Tomato Rice",
"flour, sugar, butter": "Cookies"
}
# Search for a match in the recipe dictionary
for key, dish in recipes.items():
if all(ingredient.strip().lower() in ingredients.lower() for ingredient in key.split(',')):
return f"Suggested Dish: {dish}"
return "No dish found for these ingredients. Please try again!"