The Amazon Alexa Dialog Interface helps you manage multi-turn conversations with your user to gather the information needed to for your intent. Here is the official documentation by Amazon. Every conversation is connected to an intent and it is maintained until all the required slots are filled or confirmed by the user.
- Dialog State
- Dialog Delegate
- Control the Dialog in Your Code
To use the Dialog Interface, you need a dialog model, which you can create with the Skill Builder. In the dialog model, you select which slots are required for your intent and whether the user has to confirm them or the whole intent. You also define, which prompts Alexa should use and how the user might answer (utterances).
You can also check out a sample implementation of the Dialog Interface in the Jovo language model here: Alexa Dialog Interface Template
Please consider that you're not allowed to use the
AMAZON.LITERAL slot type.
If the Dialog Interface is enabled, you will get a
dialogState property with every request. It is used to determine whether the dialog has just
IN_PROGRESS or already
When the intent is invoked for the first time,
dialogState will be set to
STARTED. It is only set to
COMPLETED, if you let Alexa handle the whole conversation. We will get to that later on.
To check the dialog state, use:
Jovo also allows you to check for a specific state:
If you decide to delegate the conversation, Alexa will use the prompts you defined in your dialog model to fill the required slots. Alexa will also confirm both slots or the whole intent if you selected that in the dialog model.
To delegate the conversation, use:
Optionally you can also pass in an
Intent object as described here:
Control the Dialog in Your Code
The Dialog Interface allows you to jump in and control the conversation yourself. Keep in mind that the prompts you prepared in the Skill Builder are only used if you delegate the conversation to Alexa. The utterances are still being used.
You have the possibility the ask the user to fill a certain slot, confirm a slot, or confirm the whole intent. You can also update the intent if you have certain values, for example the user's name, saved in a database.
From now on, parameters which are between these
 brackets are optional. These parameters are
updatedIntent. If you don't specifiy a
repromptText, the speechText will be used twice.
To check, whether a slot has a value or not, use:
If you want the user to fill a slot, use:
To confirm a slot use:
To confirm the whole intent, use:
Updating an intent gives you the ability to change slot values or the confirmation status for slots or intents. Here's an example:
You already have the user's name stored in the database, so you don't want to ask for it again. Therefor you just update the intent and add the slot value.