Spaces:
Sleeping
Sleeping
Update static/script.js
Browse files- static/script.js +8 -7
static/script.js
CHANGED
|
@@ -47,13 +47,7 @@ function handleResponse(userInput) {
|
|
| 47 |
{ text: 'Vegetarian', class: 'green' },
|
| 48 |
{ text: 'Non-Vegetarian', class: 'red' }
|
| 49 |
];
|
| 50 |
-
}
|
| 51 |
-
conversation.push({ role: 'user', message: 'Vegetarian' });
|
| 52 |
-
console.log("Food preference selected: Vegetarian");
|
| 53 |
-
botResponse = 'Great choice! 🍽️ Here are some vegetarian ingredients:';
|
| 54 |
-
fetchIngredients('vegetarian');
|
| 55 |
-
return;
|
| 56 |
-
} else if (lastMessage.includes('non-vegetarian')) {
|
| 57 |
conversation.push({ role: 'user', message: 'Non-Vegetarian' });
|
| 58 |
console.log("Food preference selected: Non-Vegetarian");
|
| 59 |
botResponse = 'Great choice! 🍽️ Please select a non-vegetarian option:';
|
|
@@ -62,6 +56,13 @@ function handleResponse(userInput) {
|
|
| 62 |
{ text: 'Beef', class: '' },
|
| 63 |
{ text: 'Lamb', class: '' }
|
| 64 |
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
} else if (lastMessage.includes('chicken') || lastMessage.includes('beef') || lastMessage.includes('lamb')) {
|
| 66 |
conversation.push({ role: 'user', message: lastMessage });
|
| 67 |
console.log(`Non-veg option selected: ${lastMessage}`);
|
|
|
|
| 47 |
{ text: 'Vegetarian', class: 'green' },
|
| 48 |
{ text: 'Non-Vegetarian', class: 'red' }
|
| 49 |
];
|
| 50 |
+
}else if (lastMessage.includes('non-vegetarian')) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
conversation.push({ role: 'user', message: 'Non-Vegetarian' });
|
| 52 |
console.log("Food preference selected: Non-Vegetarian");
|
| 53 |
botResponse = 'Great choice! 🍽️ Please select a non-vegetarian option:';
|
|
|
|
| 56 |
{ text: 'Beef', class: '' },
|
| 57 |
{ text: 'Lamb', class: '' }
|
| 58 |
];
|
| 59 |
+
}
|
| 60 |
+
else if (lastMessage.includes('vegetarian')) {
|
| 61 |
+
conversation.push({ role: 'user', message: 'Vegetarian' });
|
| 62 |
+
console.log("Food preference selected: Vegetarian");
|
| 63 |
+
botResponse = 'Great choice! 🍽️ Here are some vegetarian ingredients:';
|
| 64 |
+
fetchIngredients('vegetarian');
|
| 65 |
+
return;
|
| 66 |
} else if (lastMessage.includes('chicken') || lastMessage.includes('beef') || lastMessage.includes('lamb')) {
|
| 67 |
conversation.push({ role: 'user', message: lastMessage });
|
| 68 |
console.log(`Non-veg option selected: ${lastMessage}`);
|