Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -169,12 +169,12 @@ def process_command(command):
|
|
| 169 |
if closest_match and closest_match[1] > 70:
|
| 170 |
matched_item = closest_match[0]
|
| 171 |
cart[matched_item] = cart.get(matched_item, 0) + 1
|
| 172 |
-
return f"{matched_item.capitalize()} added to your cart. Current cart: {dict(cart)}."
|
| 173 |
return "Sorry, I couldn't recognize the item. Could you try again?"
|
| 174 |
elif "final order" in command:
|
| 175 |
if cart:
|
| 176 |
total = sum(prices[item] * count for item, count in cart.items())
|
| 177 |
-
response = f"Your final order is: {', '.join(f'{item} x{count}' for item, count in cart.items())}. Your total bill is ${total}. Thank you for ordering!"
|
| 178 |
cart.clear()
|
| 179 |
return response
|
| 180 |
return "Your cart is empty. Please add items to your cart first."
|
|
|
|
| 169 |
if closest_match and closest_match[1] > 70:
|
| 170 |
matched_item = closest_match[0]
|
| 171 |
cart[matched_item] = cart.get(matched_item, 0) + 1
|
| 172 |
+
return f"{matched_item.capitalize()} added to your cart. Current cart: {dict(cart)}. To finalize say final order"
|
| 173 |
return "Sorry, I couldn't recognize the item. Could you try again?"
|
| 174 |
elif "final order" in command:
|
| 175 |
if cart:
|
| 176 |
total = sum(prices[item] * count for item, count in cart.items())
|
| 177 |
+
response = f"Your final order is: {', '.join(f'{item} x{count}' for item, count in cart.items())}. Your total bill is ${total}. Thank you for ordering! To exist this conversation say nothing or good bye!"
|
| 178 |
cart.clear()
|
| 179 |
return response
|
| 180 |
return "Your cart is empty. Please add items to your cart first."
|