Spaces:
Sleeping
Sleeping
| def build_diet_prompt(name, gender, age, height, weight, goal): | |
| bmi = weight / ((height / 100) ** 2) | |
| # Custom instructions based on Goal | |
| if goal == "Weight Loss": | |
| diet_type = "Low carb, high protein, 500 calorie deficit" | |
| elif goal == "Build Muscle": | |
| diet_type = "High carb, high protein, 300 calorie surplus" | |
| else: | |
| diet_type = "Balanced macros, maintenance calories" | |
| prompt = f""" | |
| Act as a professional nutritionist for {name} ({gender}, {age}yo). | |
| Stats: BMI {bmi:.1f}, Goal: {goal}, Strategy: {diet_type}. | |
| STRICT FORMAT (One meal per line): | |
| Meal Name | Time | Ingredients | Calories | |
| Provide 4 unique meals. Use the | separator exactly. No conversational text. | |
| """ | |
| return prompt |