How can I show user input on Response section in D

2019-09-02 18:06发布

问题:

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: