Using Slots
As we saw with Alexa, having a set response is OK, but using slots to customize the interaction is much better. Go into the sayHello intent screen and scroll down to Slots. This is identical to the slot configuration in Alexa.
Give a name to the slot you want to get; in this case, we can ask them for their name so we call the slot usersName. We have to select a slot type and we can choose either GB_FIRST_NAME or US_FIRST_NAME. The last thing we need to do is to configure the prompt. Enter a question that will get them to enter their name, such as What is your name?. To add this slot, we need to click the blue plus button at the end of the line.
When we see the new line created, we can check that the Required checkbox is ticked ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access