Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -50,36 +50,41 @@ class IntermittentFastingPlan(BaseModel):
|
|
50 |
# ----- Prompt Template -----
|
51 |
prompt_template = Template(
|
52 |
"""
|
53 |
-
You are a top nutritionist. Based on the user's profile, create a personalized one-day meal plan. The user follows the "$meal_plan_type" pattern
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
Meal Plan Type Guide:
|
56 |
- "3 meals/day" β breakfast, lunch, dinner
|
57 |
- "4 meals/day" β breakfast, lunch, snack, dinner
|
58 |
- "Intermittent fasting (2 meals)" β lunch, dinner
|
59 |
|
60 |
-
Each meal should have **3 flexible options
|
61 |
-
- low budget
|
62 |
-
- medium budget
|
63 |
-
- high budget
|
64 |
|
65 |
Each option must include:
|
66 |
-
- Meal name
|
67 |
-
- Ingredients
|
68 |
- Cooking steps
|
69 |
- Basic nutrition info (calories, protein, carbs, fat)
|
70 |
-
- Short reason for choosing this meal based on the user's chosen package
|
71 |
|
72 |
User Profile:
|
73 |
- Age group: $age_group
|
74 |
- Height: $height inches
|
75 |
- Weight: $weight lbs
|
76 |
- Gender: $gender
|
77 |
-
-
|
78 |
-
-
|
79 |
-
- Allergies or restrictions: $allergies
|
80 |
- Goal/package: $package
|
81 |
|
82 |
-
Output format must be clean and JSON-like, without extra keys. Just the meals as per plan type with 3 budget-based options each.
|
83 |
"""
|
84 |
)
|
85 |
|
|
|
50 |
# ----- Prompt Template -----
|
51 |
prompt_template = Template(
|
52 |
"""
|
53 |
+
You are a top nutritionist specializing in personalized meal planning. Based on the user's profile, create a personalized one-day meal plan that STRICTLY adheres to their dietary preferences and COMPLETELY EXCLUDES any ingredients they are allergic to. The user follows the "$meal_plan_type" pattern.
|
54 |
+
|
55 |
+
IMPORTANT DIETARY GUIDELINES:
|
56 |
+
1. STRICTLY follow the user's dietary preference: $dietary_preference
|
57 |
+
2. ABSOLUTELY AVOID any ingredients listed in allergies/restrictions: $allergies
|
58 |
+
- Double-check each ingredient to ensure NO allergens are included
|
59 |
+
- If an ingredient could contain hidden allergens, choose a safe alternative
|
60 |
|
61 |
Meal Plan Type Guide:
|
62 |
- "3 meals/day" β breakfast, lunch, dinner
|
63 |
- "4 meals/day" β breakfast, lunch, snack, dinner
|
64 |
- "Intermittent fasting (2 meals)" β lunch, dinner
|
65 |
|
66 |
+
Each meal should have **3 flexible options** while maintaining dietary requirements:
|
67 |
+
- low budget (affordable while meeting dietary needs)
|
68 |
+
- medium budget (balanced options within dietary restrictions)
|
69 |
+
- high budget (premium ingredients following dietary preferences)
|
70 |
|
71 |
Each option must include:
|
72 |
+
- Meal name (clearly indicating it follows dietary preferences)
|
73 |
+
- Ingredients (all safe and compliant with dietary restrictions)
|
74 |
- Cooking steps
|
75 |
- Basic nutrition info (calories, protein, carbs, fat)
|
76 |
+
- Short reason for choosing this meal based on the user's chosen package and dietary needs
|
77 |
|
78 |
User Profile:
|
79 |
- Age group: $age_group
|
80 |
- Height: $height inches
|
81 |
- Weight: $weight lbs
|
82 |
- Gender: $gender
|
83 |
+
- Dietary preference: $dietary_preference (STRICT ADHERENCE REQUIRED)
|
84 |
+
- Allergies or restrictions: $allergies (MUST BE COMPLETELY AVOIDED)
|
|
|
85 |
- Goal/package: $package
|
86 |
|
87 |
+
Output format must be clean and JSON-like, without extra keys. Just the meals as per plan type with 3 budget-based options each. Every meal MUST comply with dietary preferences and exclude allergens.
|
88 |
"""
|
89 |
)
|
90 |
|