Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,13 +48,13 @@ def restaurant_voice_assistant(audio, state_json):
|
|
| 48 |
response += f"{item}: ${price:.2f}\n"
|
| 49 |
response += "\nPlease tell me the item you would like to add to your cart."
|
| 50 |
state["menu_shown"] = True
|
| 51 |
-
elif
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
elif "menu" in input_text.lower():
|
| 59 |
response = "Here is our menu again:\n"
|
| 60 |
for item, price in menu_items.items():
|
|
|
|
| 48 |
response += f"{item}: ${price:.2f}\n"
|
| 49 |
response += "\nPlease tell me the item you would like to add to your cart."
|
| 50 |
state["menu_shown"] = True
|
| 51 |
+
elif any(item.lower() in input_text.lower() for item in menu_items):
|
| 52 |
+
# Check if input matches a menu item
|
| 53 |
+
for item in menu_items:
|
| 54 |
+
if item.lower() in input_text.lower():
|
| 55 |
+
cart.append(item)
|
| 56 |
+
response = f"{item} has been added to your cart. Would you like to add anything else?"
|
| 57 |
+
break
|
| 58 |
elif "menu" in input_text.lower():
|
| 59 |
response = "Here is our menu again:\n"
|
| 60 |
for item, price in menu_items.items():
|