Spaces:
Sleeping
Sleeping
Update static/script.js
Browse files- static/script.js +9 -8
static/script.js
CHANGED
@@ -48,26 +48,27 @@ function handleResponse(userInput) {
|
|
48 |
{ text: 'Vegetarian', class: 'green' },
|
49 |
{ text: 'Non-Vegetarian', class: 'red' }
|
50 |
];
|
51 |
-
|
52 |
-
botResponse = 'Great choice! 🍽️ We have some amazing vegetarian options! What\'s your dietary preference?';
|
53 |
options = [
|
54 |
-
{ text: 'Vegan', class: '' },
|
55 |
-
{ text: 'Gluten-Free', class: '' },
|
56 |
-
{ text: 'Vegetarian', class: '' },
|
57 |
{ text: 'Low Carb', class: '' },
|
58 |
{ text: 'Dairy-Free', class: '' },
|
59 |
{ text: 'Keto', class: '' },
|
60 |
{ text: 'Halal', class: '' }
|
61 |
];
|
62 |
-
} else if (lastMessage.includes('
|
63 |
-
botResponse = 'Great choice! 🍽️ We have some amazing
|
64 |
options = [
|
|
|
|
|
|
|
65 |
{ text: 'Low Carb', class: '' },
|
66 |
{ text: 'Dairy-Free', class: '' },
|
67 |
{ text: 'Keto', class: '' },
|
68 |
{ text: 'Halal', class: '' }
|
69 |
];
|
70 |
-
}
|
|
|
71 |
fetchIngredients(lastMessage); // Handle ingredient fetch based on dietary preference
|
72 |
return; // Exit early to fetch ingredients
|
73 |
}
|
|
|
48 |
{ text: 'Vegetarian', class: 'green' },
|
49 |
{ text: 'Non-Vegetarian', class: 'red' }
|
50 |
];
|
51 |
+
else if (lastMessage.includes('non-vegetarian') || lastMessage.includes('non veg') || lastMessage.includes('nonveg')) {
|
52 |
+
botResponse = 'Great choice! 🍽️ We have some amazing non-vegetarian options! What\'s your dietary preference?';
|
53 |
options = [
|
|
|
|
|
|
|
54 |
{ text: 'Low Carb', class: '' },
|
55 |
{ text: 'Dairy-Free', class: '' },
|
56 |
{ text: 'Keto', class: '' },
|
57 |
{ text: 'Halal', class: '' }
|
58 |
];
|
59 |
+
} else if (lastMessage.includes('vegetarian')) {
|
60 |
+
botResponse = 'Great choice! 🍽️ We have some amazing vegetarian options! What\'s your dietary preference?';
|
61 |
options = [
|
62 |
+
{ text: 'Vegan', class: '' },
|
63 |
+
{ text: 'Gluten-Free', class: '' },
|
64 |
+
{ text: 'Vegetarian', class: '' },
|
65 |
{ text: 'Low Carb', class: '' },
|
66 |
{ text: 'Dairy-Free', class: '' },
|
67 |
{ text: 'Keto', class: '' },
|
68 |
{ text: 'Halal', class: '' }
|
69 |
];
|
70 |
+
}
|
71 |
+
else if (lastMessage.includes('low carb') || lastMessage.includes('dairy-free') || lastMessage.includes('keto') || lastMessage.includes('halal') || lastMessage.includes('gluten-free') || lastMessage.includes('vegan') || lastMessage.includes('vegetarian')) {
|
72 |
fetchIngredients(lastMessage); // Handle ingredient fetch based on dietary preference
|
73 |
return; // Exit early to fetch ingredients
|
74 |
}
|