Alexa, amazon’s voice-based basic abetment like Siri for the iPhone, and Cortana for Microsoft Windows, is a cloud-based service. When first introduced, it was in the form of ‘Amazon Echo.’ Fast advanced and this voice assistant is now part of assorted accessories including: music devices, robots, mobile phones, vacuum cleaners, among other things. Its skills are voice-driven and the interface amid users and Alexa is called ‘Skills.’

Creating Alexa skills

Alexa skills are built by two altered components:

  • The voice controls or actions
  • The functionality

In this commodity we’ll appraise how to set up both, starting with the functionality.

The functionality is simply some code that will be accomplished when Alexa is tasked with our custom accomplishments (or skill). This code for our purposes will run on AWS Lambda, a annual analogous altogether with Alexa, it’s cost-efficient and super easy to set up.

Here are all the steps we need to take into annual when architecture an Alexa skill:

  1. Set Up AWS (Amazon Web Services) Lambda
  2. Create a free Alexa Developer Account
  3. Create a sample of Alexa Skill
  4. Test the newly created Alexa skill

So let’s start with the first step:

Setting up an AWS (Amazon Web Services) Lambda

  1. Go to the Amazon Web Casework administration console and create a new annual if you don’t have one already. Click on the “Complete Sign Up” button.

webrok

  1. After adding the adapted data in all the adapted fields, login to the AWS administration console. Keep in mind that AWS is a paid service, though they offer a trial period of 1 year with assertive limitations, but it’s more than enough for what we want to do.
  2. After the acknowledged login, the AWS administration animate dashboard will be displayed to you.
  3. Different web based casework are accessible of AWS portal. From the find casework list, search for the “Lambda” service. Select the “Lambda” service.

webrok

  1. Lambda annual only works in the US East (N. Virginia), EU (Ireland), US West (Oregon), and Asia Pacific (Tokyo). Make sure to choose one of the given regions before creating the Lambda service.
  2. After allotment the “Lambda” annual you will be redirected to the Functions screen. Choose the “Create function” option.

webrok

  1. Click on the “Use a blueprint” option and search for the “Alexa-skills-kit-color-expert-python”.

webrok

It’s worth noting we’ll use a adapt for sample, a adapt is an already developed sample which can be easily added to your AWS lambda account. If you want to build your own skills, you can either affairs the lambda yourself, or use the adapt and update it to your needs.

There are blueprints for Python, NodeJS and other programming languages, in our case we will use one based off Python, though we will ignore the code for this tutorial and focus more on the Alexa side of things.

  1. If the after-effects are not displayed under the “Use a blueprint” section, then select the third option “Browse serverless app repository” and search for the “Alexa-skills-kit-color-expert-python.”

webrok

  1. Now enter the “TopicNameParameter” and click on the “Deploy” button.

webrok

  1. Now click on the “Logical ID” text.

webrok

  1. The action code will be displayed to you. Copy the “ARN” code displayed to you on the “top right corner”.

webrok

Creating your free Alexa Developer Account

Now we have to create an Alexa Developer Account. Go to the Amazon developer portal and create an annual if you don’t have an annual already. While creating the new account, add the adapted data in all adapted fields.

Just sign in to the Amazon developer portal if you have signed up already.

Create a sample of Alexa Skill

Here is where we build the actual Alexa interface, that is how we’re going to talk to Alexa to solve our problems and acquaint with our Lambda function.

Follow all these steps carefully:

  1. Now choose the “Alexa” option from the dashboard and select “Alexa Skills Kit.” You will be redirected to the “Alexa developer console.”

webrok

  1. Click on the “Create Skill” button.

webrok

  1. Enter the skill name, choose the language, and click on the “Create Skill” option.

webrok

The skill name can be annihilation you want, keep it allusive to what you are trying to achieve. But don’t abash the name with the phrase you will use to invoke Alexa to accomplish the task. The name is only for your reference.

  1. Enter the skill abracadabra name. This is what you will have to say to Alexa when communicating with your skill.

webrok

  1. On the Alexa skill dashboard, you will the list of your created skills. Click on “MyBookSkill.”

webrok

  1. Take a look at the sample intents to accept how you can create your own intents.

webrok

With the abracadabra name you told Alexa to “talk” to your program, now intents, will tell your affairs absolutely what action to execute. They can be annihilation your affairs can perform, like “find a book”, or “read .”

  1. For creating your own intent, click on the “Add Intent ” button.

webrok

  1. Enter the name of intent and then enter the utterances.

webrok

  1. Now choose the slots type from the left menu and click on “Add slot type.”

webrok

Slots allow you to create lists of accessible values, IDs and synonyms. Often times they’re generated by code, but for now we’ll set them up manually.

  1. Enter the name of the slot type. I have entered here “BOOK_TYPE”, and after that enter the values.

webrok

  1. Enter all the values and then click on the “Build model.”

webrok

  1. Now click on the endpoint area from the left menu and enter the Lamba ARN value.

webrok

  1. After entering the ARN value, click on the “Save endpoints” option.

webrok

Alexa skill is now auspiciously created.

Test the newly created Alexa skill

After the accomplishing of the Alexa skill, we have to test it. The testing verifies the either we’re accomplishing our adapted after-effects or not?

We can test the Alexa skill in many ways:

  • We can deploy the Alexa skill on Amazon accessories i.e. Amazon Echo Dot, Amazon Echo, or on any other device which supports the deployment of Alexa.
  • We can test the Alexa skill by using the simulator. Just say the skill abracadabra name that you have accounting while creating the Alexa skill.

This is the fun part, so enjoy it.

Alexa, and voice administration in accepted are here to stay, and the success of your artefact or casework may be bound by the affiliation that these systems will present in the future.

So grab yourself some time and take a look into the amaranthine possibilities these administration give to users and developers alike.


This article was originally appear on Live Code Stream by Juan Cruz Martinez (twitter: @bajcmartinez), architect and administrator of Live Code Stream, entrepreneur, developer, author, speaker, and doer of things.

Read next: No, you can't break your brain with a COVID-19 swab test