You can use different Dialog interface directives to ask the user for the information you need to fulfill their request. When ever there is an user interaction with your skill, you will get a request at your backend with the mapped intent and filled(or unfilled) slots. Even if you use dialog model and has filled in all the utterances for each slot, you will have to respond back with an appropriate directive to continue.
There are three ways in which you can handle a dialog model.
1. Delegating to Alexa
You can use the Dialog.Delegate
directive to let Alexa determine the next step in the dialog and uses the prompts that you have defined in the dialog model to elicit slot values, confirm slot values, or confirm the entire intent.
If you have unfilled slots just return a delegate
directive, Alexa will use the prompts defined in the interaction model to fill that slot. As long as the dialogState
property is not COMPLETE
you can continue delegating to Alexa.
Once the conversation is complete, the incoming IntentRequest
has a dialogState
of COMPLETED
. All required information is now available in the intent's slot values.
Note: With Dialog.Delegate
directive you cannot send outputSpeech
or reprompt
from your code. Instead those defined in interaction model will be used. And the COMPLETED
status is only possible when you use Dialog.Delegate
.
2. Control the Dialog
In each turn of the conversation you can take the control and ask for what you need rather than delegating it to Alexa. This is useful especially when you want slots to be filled a particular order or you want to confirm slots as you go or your slot's "mandate" property is dynamic in nature and so on.
You can use Dialog.ElicitSlot
directive to ask for a particular slot, Dialog.ConfirmSlot
to confirm a particular slot and Dialog.ConfirmIntent
to confirm an intent itself.
3. Combining both
When you receive an intent request you can return a delegate
directive or any other directive as you wish. Even if you delegate, at any point you can take over the dialog rather than continuing to delegate to Alexa.
More on the different directive here
Sample Interactions:
1. Using delegate
directive here
2. Using ElicitSlot
directive here
3. Using ConfirmSlot
directive here
4. Using ConfirmIntent
directive here