How to reply back a user with his/her name using Dialogflow?

十年热恋 提交于 2019-12-24 07:58:58

问题


I want to know how to reply back a user with his/ her name? For example:

AppName: Hello, may I ask your name?

User: My name is John

AppName: Welcome John to $appname

I want to do this without webhook or fulfillment. I just want to do with Dialogflow.


回答1:


You can create an Intent in Dialogflow that takes the user's name as a parameter. You then reference this parameter using $parameter_name in the reply string. If you want this maintained for future calls in your conversation, you can add an outgoing context. It might look something like this:




回答2:


Normally you would send a permission request from the fulfillment code, but you can not do this from Dialogflow at the moment. You can only trigger a permission request from the fulfillment. By the way, even if the feature existed, neither Dialogflow or Actions on Google would save the info for you. So you would have to ask for it in each session. If you get it in the fulfillment you will need to ask for it only once because you can save it.




回答3:


If you want to use it in other intents taking this context as an input, you have to refer to it as #context_name.parameter_name like this :



来源:https://stackoverflow.com/questions/48027819/how-to-reply-back-a-user-with-his-her-name-using-dialogflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!