Spaces:
Running
Running
File size: 1,085 Bytes
a527bf1 c72e92d 730a89b a527bf1 c72e92d 0af6dd0 c72e92d a527bf1 c72e92d a527bf1 c72e92d a527bf1 730a89b a527bf1 730a89b a527bf1 730a89b 0af6dd0 730a89b a527bf1 730a89b c72e92d 32b2c76 a527bf1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | def calculate_bmi(weight, height):
height_m = height / 100
return weight / (height_m ** 2)
def bmi_category(bmi):
if bmi < 18.5:
return "Underweight"
elif bmi < 25:
return "Normal Weight"
elif bmi < 30:
return "Overweight"
else:
return "Obese"
def build_prompt(name, age, gender, height, weight, goal, fitness_level, equipment):
bmi = calculate_bmi(weight, height)
bmi_status = bmi_category(bmi)
equipment_list = ", ".join(equipment) if equipment else "No Equipment"
prompt = f"""
You are a certified professional fitness trainer.
Create a structured 5-day personalized workout plan.
User Profile:
Name: {name}
Age: {age}
Gender: {gender}
Height: {height} cm
Weight: {weight} kg
BMI: {bmi:.2f} ({bmi_status})
Goal: {goal}
Fitness Level: {fitness_level}
Available Equipment: {equipment_list}
Instructions:
1. Divide the workout from Day 1 to Day 5
2. Include exercise names
3. Include sets and reps
4. Include rest time
5. Keep the plan beginner friendly if needed
"""
return prompt, bmi, bmi_status |