At every turn of the conversation your Lambda function can access the dialog state stored in the JSON request. Using the Alexa Node.js SDK, it can be accessed with
In the next few exercises, you’ll see how you can use this property to direct the conversation.
ALEXA Ok, what genre of movie would you like? USER I'd like an action movie.
console.log(), print the dialog state in the JSON request.
this, and start with
We can use
dialogState in conditional statements as well. Write an
if statement that checks the value of
dialogState. If the state is NOT
'COMPLETED', using console.log(), print
'Conversation not completed yet!'.