How can I show user input on Response section in Dialogflow

淺唱寂寞╮ 提交于 2019-12-13 05:08:47

问题


I would like to print out user input on a Response Section but for some reason I cannot seem to find how can I do this.

For example:

Bot: How old are you?
User: 40
Bot: Your age is 40.

I am also attaching a screenshot where I have a parameter but I just dont know to what to assing age.

Currently I get Your age is 100 as I manually added 100 as a value to age parameter. Any idea on this?


回答1:


To get the input from user you have to capture that age value in an entity. You can either use a system entity or create your own, but for your case to capture "age" sys.number-integer can be perfect!

Just add a training phrase in the intent as template phrase (see that "@" at the left), just click on the default " symbol beside the training phrase to switch to template mode as it will suit best for your need of matching age.

Training phrase: Parameter: Response:

Edit: for getting name(text) input you have to use @sys.any entity (make sure that you are using template mode (@) and not example mode("))

Training phrase & parameter: Response:



来源:https://stackoverflow.com/questions/50923322/how-can-i-show-user-input-on-response-section-in-dialogflow

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