Subbu1304 commited on
Commit
cb057e8
·
verified ·
1 Parent(s): a273045

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -66,7 +66,7 @@ def process_message(message, history):
66
  if chat_state.step == "initial":
67
  if "yes" in message.lower() or "yeah" in message.lower():
68
  chat_state.step = "category"
69
- return "Great! Please select your preferred category: Veg, nonveg."
70
  return "I'm here to help you customize your food. Would you like to proceed? (Yes/No)"
71
 
72
  # Step 2: Category selection
@@ -74,9 +74,9 @@ def process_message(message, history):
74
  chat_state.category = message.lower()
75
  chat_state.step = "ingredient"
76
 
77
- if "veg" in message.lower():
78
  return f"Great! What main ingredient would you like? Available options: {', '.join(VEG_INGREDIENTS)}"
79
- elif "nonveg" in message.lower():
80
  return f"Great! What type of meat would you prefer? Available options: {', '.join(NONVEG_TYPES)}"
81
  return "Please select either Vegetarian or Non-Vegetarian."
82
 
@@ -95,7 +95,7 @@ def process_message(message, history):
95
  food_items = FOOD_DATABASE[category][chat_state.ingredient]
96
  food_item_names = [item['name'] for nutrition in food_items for item in food_items[nutrition]]
97
 
98
- # Show available food items
99
  chat_state.step = "nutrition"
100
  return f"Great! Here are the available food items for {message}:\n{', '.join(food_item_names)}\nNow, select your nutrition preference: {', '.join(NUTRITION_OPTIONS)}"
101
 
 
66
  if chat_state.step == "initial":
67
  if "yes" in message.lower() or "yeah" in message.lower():
68
  chat_state.step = "category"
69
+ return "Great! Please select your preferred category: Vegetarian, Non-Vegetarian."
70
  return "I'm here to help you customize your food. Would you like to proceed? (Yes/No)"
71
 
72
  # Step 2: Category selection
 
74
  chat_state.category = message.lower()
75
  chat_state.step = "ingredient"
76
 
77
+ if "vegetarian" in message.lower():
78
  return f"Great! What main ingredient would you like? Available options: {', '.join(VEG_INGREDIENTS)}"
79
+ elif "non-vegetarian" in message.lower():
80
  return f"Great! What type of meat would you prefer? Available options: {', '.join(NONVEG_TYPES)}"
81
  return "Please select either Vegetarian or Non-Vegetarian."
82
 
 
95
  food_items = FOOD_DATABASE[category][chat_state.ingredient]
96
  food_item_names = [item['name'] for nutrition in food_items for item in food_items[nutrition]]
97
 
98
+ # Show available food items and move to nutrition selection
99
  chat_state.step = "nutrition"
100
  return f"Great! Here are the available food items for {message}:\n{', '.join(food_item_names)}\nNow, select your nutrition preference: {', '.join(NUTRITION_OPTIONS)}"
101