Fit_Plan_Module_2 / diet_builder.py
Amrutha04's picture
Update diet_builder.py
a7e88c2 verified
raw
history blame contribute delete
770 Bytes
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