Learn
Control Dialog in Lambda
Review
Congrats on finishing Dialog Management! You’ve come a long way and learned a lot.
Dialog management is a great way to elicit and confirm the set of required slots and the intent needed to perform a task, since it greatly reduces the necessary coding in the Lambda function.
You can write prompts and user utterances in the Developer Console. If you’d like to customize the prompts or perform complex logic, you can use properties in the JSON request and directives in your Lambda function.
This specific lesson focused on the properties and directives in your Lambda function:
Confirmation Status
confirmationStatus
is the confirmation status of slots:this.event.request.intent.slots.YOUR_SLOT_NAME.confirmationStatus- and intents:this.event.request.intent.confirmationStatus
- It can take one of three values:
'COMPLETED'
,'DENIED'
, or'NONE'
Directives
- The
:elicitSlot
directive is used to prompt the user for the value of a slot - The
:confirmSlot
directive is used to confirm the slot value the user has provided - The
:confirmIntent
directive is used to confirm the intent the user has provided - Use directives with this general form:this.emit(directive, [slotName,] speechOutput, reprompt, updatedIntent);
slotName
is not included when using:confirmIntent
Updated Intent
updatedIntent
is the last parameter in calls tothis.emit
- We can use this parameter to overwrite values or set default values for the intent
- Capture the original intent using:
make changes to its values, then pass it as the last argument toconst updatedIntent = this.event.request.intent;this.emit
More Alexa Resources
- For more Alexa news, subscribe to the Alexa developer newsletter to stay up-to-date on new features, tutorials, and events.
- Alexa Developer Forums
- Alexa Voice Design Guide
- Alexa Blogs on Dialog Management
- Alexa code samples and templates on GitHub
- AlexaDevs on Twitter
Instructions
Good work finishing this lesson! Feel free to review before moving on.