Reputation: 1683
I want to build the closed dialog model in Alexa skill. The example requirement is
Man: Alexa, what is the price of product1
Alexa: The price of product1 is 89 USD
Man: What is the size of it?
If I ask the size intent with "it" instead of product name, how alexa will understand the meaning of "it" is the product?
Upvotes: 0
Views: 481
Reputation: 26003
Within the scope of a single session, you can persist the product name as a session attribute, and retrieve it again when responding to the size question.
When handling the price intent, you'll want to save off the name of your product as a session attribute. Lets call that attribute 'ProductName'. Then when handling the size intent within the same session, simply check if the ProductName attribute has been defined, and prompt for it if not.
To make this conversation more robust, define the following sample utterances in your second intent (lets call it SizeIntent) to allow a ProductName custom slot:
SizeIntent What is the size of it
SizeIntent What is the size of {ProductName}
This defines a ProductName slot, so now you have two possible methods of input:
To decide which value to reference:
Upvotes: 2