dialogflow-fulfillment

Cannot Read Context in Dialogflow Fulfillment (Suddenly Undefined)

坚强是说给别人听的谎言 提交于 2019-12-12 11:06:41
问题 We built a Dialogflow agent using google cloud functions as webhook which worked properly until yesterday evening. At that time I exported the agent and reimported it later on and it worked for a while. What stopped working is that agent.context.get('...'); (also agent.getContext('...') ) does return undefined even if the context is set according to the UI and raw API response. As an example I have an intent which has a required slot shop , webhook for slot filling enabled. When I test the

Can't get conv.data to save a parameter in Actions on Google

断了今生、忘了曾经 提交于 2019-12-11 10:14:19
问题 As you can see in: Console Log from SaveLocation - AskLocationPermission it doesn't save the location_type to the conv.data . While user storage works great I want to correctly use conv.data and conv.user.storage . You can see in the Example of conversation that the parameter is fulfilled, but it doesn't get saved to the conv.data . How it should work is when user says that he wants to save this location as his home or work, it should look into the conv.user.storage if he has home or work

DialogFlow Fulfilment - How to get both original and default value for a parameter

橙三吉。 提交于 2019-12-11 05:45:03
问题 I am trying to get a time value from an intent as both $time and $time.original. I need the $time value to do some processing on it and I need the $time.original to show the output back to user. For example, if user says, 'are you open tomorrow?', I want to respond 'Yes, we are open tomorrow?' but on the back end, I need the value of date 'tomorrow' to do the processing. Any help would be appreciated. 回答1: First, you would need @sys.date entity if you want to catch value of entities like

Webhook call failed. Error: Failed to parse webhook JSON response: Expect message object but got: [Chinese letters]

允我心安 提交于 2019-12-02 07:03:15
I'm building my own WebhookClient for dialog flow. My code is the following (using Azure Functions, similar to Firebase Functions): module.exports = async function(context, req) { const agent = new WebhookClient({ request: context.req, response: context.res }); function welcome(agent) { agent.add(`Welcome to my agent!!`); } let intentMap = new Map(); intentMap.set("Look up person", welcome); agent.handleRequest(intentMap); } I tested the query and the response payload looks like this: { "fulfillmentText": "Welcome to my agent!!", "outputContexts": [] } And the headers in the response look like