使用Dialogflow履行服务器时,轮播选择器的答复将发送到哪里? [英] Where will the reply of a Carousel Selector be sent when using Dialogflow fulfillment server?

查看:62
本文介绍了使用Dialogflow履行服务器时,轮播选择器的答复将发送到哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试弄清楚如何嵌入Google Actions响应,例如


I am trying to figure out how I can embed Google Actions responses, such as the carousel, in a webhook response for DialogFlow.

As epxlained in Is there a way to simply follow a URL in the Caroussel Selector?, the carousel selector can be used to present the user certain options. When the user clicks, the selected item will be sent back to the backend server. As said, I am using Dialogflow, so the fulfillment server will send the carousel list to the Assistant.

It is not clear to me on which REST endpoint the information about the selected item will be provided. Will this be on the Dialogflow webhook endpoint? Or do I have to provision a Google Actions webhook for this (with gactions CLI tool)?

In case of the latter, how can we prevent that this configuration will not clash with the Dialogflow configuration? As I am not using Google Actions for actual conversation flow, should I have a custom actions.json which does not listen to any welcome phrases?

解决方案

For starters - rest assured. You need only one webhook and that is the one that you're already using to work with Dialogflow. Responses will go through Dialogflow, but you need to make sure you've added an Intent to handle it.

The intent needs to be set to use an Event of actions_intent_OPTION. You should not give it any training phrases, but do make sure you set the Action and turn on the fulfillment selector.

When you handle this in your webhook, if you're using the Node.js API, the key of the option will be in a context named actions_intent_option. You can access it with something like this:

const param = app.getContextArgument('actions_intent_option', 'OPTION').value;

If you prefer to use JSON, you can find the information under

originalRequest.data.inputs[0].arguments[0].textValue

这篇关于使用Dialogflow履行服务器时,轮播选择器的答复将发送到哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆