I am using Dialogflow V2 API.
Everything works perfectly in testing via Actions on Google simulator. Please find pic attached.
However, when attempted using the console (right column) within Dialogflow, and also the web integration link, it does not work.
Agent is able to detect appropriate entity from user input, but unable to call intent declared in webhook. https://bot.dialogflow.com/acc64a26-8d1d-4459-8ce0-24c890acb6d7
I have attempted to post in Dialogflow forum but there was an error posting. Similar case for raising support withing Dialogflow.
Image of Google simulator agent (works):
Image of public link agent (fails):
Image of Response declared in both webhook js file and within console:
Please find part of my index.js webhook below. I am using Dialogflow's inline editor.
'use strict';
const functions = require('firebase-functions')
const { dialogflow } = require('actions-on-google')
const app = dialogflow()
app.intent('Default Welcome Intent', conv => {
conv.ask('Welcome to Zera! We provide medicine and drug advice. What seems to be bothering you today?')
})
app.intent('QSpecific Problem', (conv, {SpecificProb}) => {
conv.contexts.set('specificprob', 10, {SpecificProb: SpecificProb})
conv.ask(`Do you have these problems before?`)
})
app.intent('QRecurring', (conv, {Recurring}) => {
conv.contexts.set('recurring', 10, {Recurring: Recurring})
if (Recurring === "Recur") {
conv.ask(`Have you taken any medication for this?`);
} else {
const specProb = conv.contexts.get('specificprob')
conv.ask(`How long have you been having this ${specProb.parameters.SpecificProb}?`)
}
})
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app)