Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -304,13 +304,20 @@ def chat_with_diet_bot(message, history):
|
|
304 |
state.user_profile[key] = value
|
305 |
|
306 |
if state.current_step == "greeting":
|
307 |
-
|
308 |
-
|
|
|
|
|
|
|
|
|
309 |
|
310 |
elif state.current_step == "request_diet_plan":
|
311 |
if any(word in message.lower() for word in ["yes", "sure", "okay", "please", "diet", "plan"]):
|
312 |
response = "Great! What type of diet are you following? (e.g., vegetarian, vegan, keto, paleo, gluten-free, or no specific diet)"
|
313 |
state.current_step = "ask_dietary_preference"
|
|
|
|
|
|
|
314 |
|
315 |
elif state.current_step == "ask_dietary_preference":
|
316 |
if state.user_profile["dietary_preference"]:
|
|
|
304 |
state.user_profile[key] = value
|
305 |
|
306 |
if state.current_step == "greeting":
|
307 |
+
if any(word in message.lower() for word in ["hello", "hi", "hey", "diet", "plan", "meal"]):
|
308 |
+
response = "Hello! I'm your diet planning assistant. Would you like me to create a personalized diet plan for you?"
|
309 |
+
state.current_step = "request_diet_plan"
|
310 |
+
else:
|
311 |
+
response = "Hello! I can help create a personalized meal plan based on your preferences and goals. Would you like me to help with that?"
|
312 |
+
state.current_step = "request_diet_plan"
|
313 |
|
314 |
elif state.current_step == "request_diet_plan":
|
315 |
if any(word in message.lower() for word in ["yes", "sure", "okay", "please", "diet", "plan"]):
|
316 |
response = "Great! What type of diet are you following? (e.g., vegetarian, vegan, keto, paleo, gluten-free, or no specific diet)"
|
317 |
state.current_step = "ask_dietary_preference"
|
318 |
+
else:
|
319 |
+
response = "I'm here to help with diet planning whenever you're ready."
|
320 |
+
state.current_step = "greeting"
|
321 |
|
322 |
elif state.current_step == "ask_dietary_preference":
|
323 |
if state.user_profile["dietary_preference"]:
|