In this section, you will learn how to manage multi-turn conversations with the Alexa Dialog Interface.
- Dialog State
- Jovo Language Model
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.
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).
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:
When using the Dialog Interface, you can decide between letting Alexa handle the conversation or controlling each step yourself. There is also the possibility to combine both options.
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:
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.
You can check out a sample implementation of the Dialog Interface in the Jovo language model here: Alexa Dialog Interface Template