Spaces:
Running
Running
Update prompt_builder.py
Browse files- prompt_builder.py +4 -5
prompt_builder.py
CHANGED
|
@@ -13,7 +13,7 @@ def bmi_category(bmi):
|
|
| 13 |
return "Obese"
|
| 14 |
|
| 15 |
|
| 16 |
-
def build_prompt(name, gender, height, weight, goal, fitness_level, equipment):
|
| 17 |
|
| 18 |
bmi = calculate_bmi(weight, height)
|
| 19 |
bmi_status = bmi_category(bmi)
|
|
@@ -22,11 +22,11 @@ def build_prompt(name, gender, height, weight, goal, fitness_level, equipment):
|
|
| 22 |
|
| 23 |
prompt = f"""
|
| 24 |
You are a certified professional fitness trainer.
|
| 25 |
-
|
| 26 |
Create a structured 5-day personalized workout plan.
|
| 27 |
|
| 28 |
User Profile:
|
| 29 |
- Name: {name}
|
|
|
|
| 30 |
- Gender: {gender}
|
| 31 |
- Height: {height} cm
|
| 32 |
- Weight: {weight} kg
|
|
@@ -40,9 +40,8 @@ Instructions:
|
|
| 40 |
2. Include exercise name.
|
| 41 |
3. Include sets and reps.
|
| 42 |
4. Include rest period.
|
| 43 |
-
5. Adjust intensity based on BMI category.
|
| 44 |
-
6. Avoid unsafe exercises for beginners.
|
| 45 |
7. Keep the plan professional and easy to follow.
|
| 46 |
"""
|
| 47 |
-
|
| 48 |
return prompt, bmi, bmi_status
|
|
|
|
| 13 |
return "Obese"
|
| 14 |
|
| 15 |
|
| 16 |
+
def build_prompt(name, age, gender, height, weight, goal, fitness_level, equipment):
|
| 17 |
|
| 18 |
bmi = calculate_bmi(weight, height)
|
| 19 |
bmi_status = bmi_category(bmi)
|
|
|
|
| 22 |
|
| 23 |
prompt = f"""
|
| 24 |
You are a certified professional fitness trainer.
|
|
|
|
| 25 |
Create a structured 5-day personalized workout plan.
|
| 26 |
|
| 27 |
User Profile:
|
| 28 |
- Name: {name}
|
| 29 |
+
- Age: {age}
|
| 30 |
- Gender: {gender}
|
| 31 |
- Height: {height} cm
|
| 32 |
- Weight: {weight} kg
|
|
|
|
| 40 |
2. Include exercise name.
|
| 41 |
3. Include sets and reps.
|
| 42 |
4. Include rest period.
|
| 43 |
+
5. Adjust intensity based on BMI category AND age.
|
| 44 |
+
6. Avoid unsafe exercises for beginners or older users.
|
| 45 |
7. Keep the plan professional and easy to follow.
|
| 46 |
"""
|
|
|
|
| 47 |
return prompt, bmi, bmi_status
|