dialogflow

Dialogflow v2 API + Actions v2 API: MalformedResponse 'final_response' must be set

流过昼夜 提交于 2019-12-18 06:09:47
问题 I'm trying to start working on Google Actions v2 API together with Dialgoflow v2 API. I have the following example (so far in Dialogflow -> Fulfillment Webhook) taken from official Google Actions Migration Guide , but unfortunately I keep getting MalformedResponse 'final_response' must be set error. 'use strict'; const functions = require('firebase-functions'); const { dialogflow } = require('actions-on-google'); const app = dialogflow(); app.intent('Default Welcome Intent', conv => { conv

Dialogflow v2 API + Actions v2 API: MalformedResponse 'final_response' must be set

你说的曾经没有我的故事 提交于 2019-12-18 06:09:05
问题 I'm trying to start working on Google Actions v2 API together with Dialgoflow v2 API. I have the following example (so far in Dialogflow -> Fulfillment Webhook) taken from official Google Actions Migration Guide , but unfortunately I keep getting MalformedResponse 'final_response' must be set error. 'use strict'; const functions = require('firebase-functions'); const { dialogflow } = require('actions-on-google'); const app = dialogflow(); app.intent('Default Welcome Intent', conv => { conv

Is it possible to play audio file or stream?

前提是你 提交于 2019-12-18 05:18:13
问题 Is it possible to play audio file or stream using actions-on-google-nodejs library? 回答1: Using SSML you can return an audio clip up to 120s. <speak> <audio src="https://actions.google.com/sounds/v1/animals/cat_purr_close.ogg"> <desc>a cat purring</desc> PURR (sound didn't load) </audio> </speak> Edit If you want to play audio the mp3 file (over 120s), you need to use Media Responses if (!conv.surface.capabilities.has('actions.capability.MEDIA_RESPONSE_AUDIO')) { conv.ask('Sorry, this device

Authenticate Google Calendar on API.AI with Google Actions

可紊 提交于 2019-12-18 04:23:16
问题 I am writing an API.AI app with Google Actions (will run on google assistant and google home). The app should be able to read\add events to the user's google calendar account. The backend is Google Cloud Functions, and I enabled the Calendar API in the developers console. The flow the user should experience is something like this: User : "Hey Google, when was my last meeting with Anna?" Agent : "Your last meeting with Anna was two days ago" User : "Set a meeting with Anna for the tomorrow"

Making an HTTP POST request from fulfillment in Dialogflow

和自甴很熟 提交于 2019-12-17 21:31:00
问题 I am writing a handler for an intent to generate a PDF. This API accepts a POST request with the JSON data and returns a link to the generated PDF. The intent triggers this code but the answer is not added to the agent. Is it possible that the request is not forwarded to the destination? The API seems to not get any requests. Any idea how to solve this? function fillDocument(agent) { const name = agent.parameters.name; const address = agent.parameters.newaddress; const doctype = agent

Use Async Functions in DialogFlow WebHook

一个人想着一个人 提交于 2019-12-17 16:37:53
问题 Referring to the solution posted here (DialogFlow V2 Webhook - Expects Speech responses Immediately and not after async requests) What I want to achieve is that the web hook should wait until I get a response from my api call. P.S: The API is working, its just that the bot doesn't wait for the response to come. Any help would be greatly appreciated. Thanks const rp = require('request-promise'); function convert(params){ return rp('https://data.fixer.io/api/convert?access_key=[my key]&from='+

How to save data between conversation in Dialogflow?

不问归期 提交于 2019-12-17 05:15:12
问题 I don't understand how you're supposed to save data. I tried using let conv = agent.conv() conv.data.data1=mydata //to save mydata = conv.data.data1 //to load agent.add(conv) but it crash my app. I saw that you could put info in var token = JSON.stringify(request.body.originalDetectIntentRequest.payload.conversation.conversationToken); but how do you put data in conversationToken in the response? What is your method? Thanks 回答1: Use the output context to save parameters { "fulfillmentText":

Dialogflow, Google Account Linking and ASP.NET Core API (Webhook)

断了今生、忘了曾经 提交于 2019-12-14 03:42:21
问题 I am a student working on a NLP app for the Google Home for my senior design project. I am wondering specifically: What is the correct way to implement Google Account Linking and what does Google Account linking provide for registering/authenticating users via Dialogflow (i.e. what the dataflow looks like from initial query to Google logging in, back to Dialogflow, then to my ASP.NET Core API handler). Does Account Linking return a bearer token in the header back to Dialogflow and thus, back

setting context with list of objects as prameters in dialogflow

拜拜、爱过 提交于 2019-12-14 02:49:15
问题 I have a list of values each having another KEY value corresponding to it, when i present this list to user, user has to select a value and agent has to call an external api with selected value's KEY. how can i achieve this in dialogflow? I tried to send the entire key value pair in the context and access it in the next intent but for some reason when i set a list(array) to context parameters dialogflow simply ignoring the fulfillment response. What is happening here and is there any good way

Malformed Response 'final_response' must be set

╄→尐↘猪︶ㄣ 提交于 2019-12-14 02:38:40
问题 I'm using DialogFlow's webhook thing and when I send my JSON response as follows: { "fulfillmentText": "This is a text response", "source": "example.com", "payload": { "google": { "richResponse": { "items": [ { "simpleResponse": { "textToSpeech": "this is a simple response" } } ] } } } } but I get the error MalformedResponse 'final_response' must be set. after the webserver responds. 回答1: That JSON response is valid for V2 of the Dialogflow webhook fulfillment protocol. Make sure you've done