Taming Alexa – part 1

Hello there, 

It’s time for a short Alexa session. As I stated in my previous post, I would like to provide an overview of the basics for developing a Skill for Alexa and simultaneously also learn more for the future. In general it usually works in the life the when one writes about a topic a more permanent memory mark is often attained.  

Let’s start by having a look at a basic structure and how it generally would make sense to build an Alexa skill. As Alexa is a service provided by Amazon, the first assumption is that everything probably is easiest to get up and running in the Amazon cloud. 

A good starting point is one of the entries in the Alexa documentation, e.g. the Fact Skill Tutorial. Let’s assume you already have created an Amazon Developer account like I did (if you didn’t, the registration can be completed at http://developer.amazon.com/alexa). First we browse to the developer console and select “Start a Skill“. 

On the opening page there are listed the existing Alexa Skills implemented by the developer. There also is a button for creating a new skill. So let’s proceed with it.

On the following page we provide a name to our skill, e.g. in this case I want to implement a simple skill that provides basic facts about marathon running. At this stage we basically provide a name to the skill, select a default language and a basic model for the skill. We can start with the option custom one

In the next step we get to choose which template we would like to use as starting point – in this case it will be a “Fact Skill“.

As a result, a basic skill is generated based on the selections. We then want to create a basic skill that we can later extend to support a wider range of functionalities. First we provide an invocation name with which the skill can be started. In this case I have changed the name to “marathon facts“.

The intents section contains the basic interactions (phrases with optional parameters) used to communicate with the skill. Every skill has the basic set of intents that is mandatory, e.g. help, stop, etc. Under each section one is able to provide sample utterances, variants for typical phrases expressed when using the skill. For now I changed the default values coming from the fact skill template to correspond with the fancy new marathon fact skill. First, save the model and then try to build it with the corresponding functionalities on the upper part of the Amazon developer page.

In the following step we’ll proceed by providing a simple Amazon AWS Lambda function. With AWS Lambda we can run code without having to manage an own server. The code uploaded or edited directly on Amazon can be triggered from an AWS service or any web or mobile app. We’ll start by signing in to the AWS developer console, and also basically by following the excellent tutorial provided by Amazon.

We want to create a new function: there is an option to create a function from scratch, use an existing function as basis (blueprint). We select to use the blueprint alexa-skills-kit-nodejs-factskill to get things up and running quickly. In the next phase a name and a role is assigned to the skill.

After confirming the basic configuration, the Lambda function is created and can be further modified. In the section “Designer” one adds a trigger that is used to start the function in the first place. We select there “Alexa Skills Kit” as trigger. A configuration has to be added there to make it work. By adding a Skill ID it is easy to verify the request comes from a desired source. The ID is easy to detect on the Skills page on AWS.

I will wrap up this story in the following post, and deliver some information about the testing etc. Until the next time, bye.

Leave a Reply

Your email address will not be published. Required fields are marked *