So I am trying to create a conversation about Vitamins from Dialogflow. But, I keep getting the same error and because of that, the same response from the AI. So what we want to happen is, (User) - Give me more information about Vitamins (AI) - Sure. which Vitamin (User) - *here we specify which Vitamin, for example - * Vitamin A. (AI) - Then the AI gives us the specified response for Vitamin A
Please help
Here's our code in fulfillment
const functions = require('firebase-functions');
const {dialogflow} = require('actions-on-google')
const VITAMIN_INTENT = 'Vitamin'
const VITAMINS_ENTITY = 'Vitamins'
const app = dialogflow()
app.intent(VITAMIN_INTENT, (conv) => {
const vitamin_type = conv.parameters[VITAMINS_ENTITY].toLowerCase();
if (vitamin_type == 'Vitamin A') {
conv.ask("Sources: carrots, sweet potato, green leafy vegetable, squash")
} else if (vitamin_type == 'Vitamin B') {
conv.ask("Sources: Animal products (such as fish, poultry, meat, eggs, or dairy); Also found in fortified breakfast cereals and enriched soy or rice milk.")
} else if (vitamin_type == 'Vitamin B1') {
conv.ask("Sources: Sunflower seeds, asparagus, lettuce, mushrooms, black beans, navy beans, lentils, spinach, peas, pinto beans, lima beans, eggplant, Brussels sprouts, tomatoes, tuna, whole wheat, soybeans.")
} else if (vitamin_type == 'Vitamin B2') {
conv.ask("Sources:B2 ")
}
})
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app)