ask-sdk-model packages are included when we ran
I’m going to break up the explanation of the code so I can explain it in a digestable fashion.
Let’s start slow. First, I import the
I use the
ask-sdk-core when I register the intent handlers (described below). The
skillbuild.addRequestHandlers() registers handlers for launch, help, cancel and stop, session end, and the non-built-in Hello intent.
Anatomy of an Intent Handler
The intent handler requires two functions
canHandle(handlerInput) function returns true for all the request types it handles. In the case of the
LaunchRequestHandler it supports the
LaunchRequest request type. The
handle(handlerInput) function is the actual response to the intent. The function shows how the
handlerInput.responseBuilder function is used to build the response.
speak takes a string that is the text of the response.
reprompt takes a string that will be used to further the conversation if there hasn’t been any interaction after 8 seconds.
There are two other types of requests I’ll be handling in this tutorial and they are
SessionEndedRequest is used to cleanup any state we need for the session. I’m not sure there will be much to it as I don’t know if I will need any state for this Skill. I will explore
IntentRequest in the next post. It will be used for some default intents, but it is also the mechanism used to do the interesting, custom parts of the skill.
Please send me (email@example.com) any comments or corrections.