Blog 2: Alexa – build your first Alexa skill

In the previous Blog 1 we introduced the conversational Assistance and Bot Topic.

Alexa is the conversational assistant with which the user interacts by voice. The user can ask a lot of questions, can “plug” new skills and event controls his home automated installations by voice. Skills are application that are controlled by voice.

The game starts when the users says “Alexa”, that is the hotword which triggers the voice recording.

The recorded sound/text will be sent to Amazon servers. Amazon uses machine learning to recognize words, sentences and finally understand the question. Once understood, Amazon ask the corresponding system and return the correct information.

Source : https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/overviews/understanding-the-smart-home-skill-api

In contrary to smartphones, here there is no local application, the skills are stored on the Amazon cloud and the user can choose via the Dashboard of the Alexa Application which skill he had liked to use. Skills are invocated thanks to their names and just like APIs, parameters can be added to the request. (“Alexa, ask Hybris Marketing for the latest target Group”). Latest and Target group can be considered as parameters in this case.

For example:

  1. A user says “Alexa, ask Hybris Marketing for the latest target Group” to their Amazon Echo or another Alexa-enabled device.
  2. The Amazon Echo or other Alexa-enabled device hears this instruction and sends it to the Alexa service for interpretation.
  3. The Alexa Hybris Marketing Skill API interprets the action as “Target Group” and the identifier name as “latest “. It composes a message to send to the skill adapter that read the information stored in the backend.
  4. The skill adapter receives and parses the request for the parameters details. It uses this information to communicate with the database and then generates a request to the Backend.
  5. The backend gets the message and return the most recent target group.
  6. The skill adapter sends a response back indicating whether it was successful. Alexa uses this response to determine the appropriate response to the customer. For example, Alexa might say, “OK” to indicate the requested is complete.

But how do Alexa know which request to send and which parameters?

A skill is composed of three parts:

  • A program
  • An intent schema (intents are actions that users can do with your skill. And intent schema is a simple JSON definition of those intents.)
  • Slot (think about slot as an intent’s argument. You can have multiple slots for an intent. We could have a custom slot type)
  • A set of utterance samples (term used to designate a file containing many ways of invoking a Skill and which requests to execute in this case.)

Create an Alexa Skill

  1. Register as an Amazon Developer and Create a Skill
  2. Open the Amazon Developer Portal in a browser and log in.
  3. Navigate to the Alexa section by clicking Apps & Services and then clicking Alexa in the top navigation.
  4. In the Alexa Skills Kit box, click “Get Started”
  5. Click the Add a New Skill button.
  6. On the Skill Information page, select Custom Interaction Model and enter the Name for your skill. Note that your skill’s name must not indicate that it’s functionality is limited.
  7. Select the language for your skill. You can add additional languages later.
  8. Click Save.

  1. On the left side of the page the Interaction Model menu is activated, Amazon has launched in a Beta phase a new Skill Builder. The link is visible on the interaction Model page.

For this blog, we are going to use the following intent Schema and Sample Utterances

{
  "intents": [
    {
      "slots": [
        {
          "name": "timeslot",
          "type": "AMAZON.TIME"
        }
      ],
      "intent": "Completed"
    },
    {
      "slots": [
        {
          "name": "timeslot",
          "type": "AMAZON.TIME"
        }
      ],
      "intent": "Inpreparation"
    },
    {
      "intent": "To_be_released"
    },
    {
      "slots": [
        {
          "name": "timeslot",
          "type": "AMAZON.TIME"
        }
      ],
      "intent": "Released"
    },
    {
      "slots": [
        {
          "name": "numberslot",
          "type": "AMAZON.NUMBER"
        },
        {
          "name": "targetgroup",
          "type": "TARGET_GROUP"
        }
      ],
      "intent": "Members"
    },
    {
      "slots": [
        {
          "name": "numberslot",
          "type": "AMAZON.NUMBER"
        },
        {
          "name": "targetgroup",
          "type": "TARGET_GROUP"
        }
      ],
      "intent": "Campaigns"
    },
    {
      "intent": "Greeting"
    },
    {
      "slots": [
        {
          "name": "numberslot",
          "type": "AMAZON.NUMBER"
        }
      ],
      "intent": "Release_one"
    }
  ]
}
Completed completed
Completed which completed
Completed which one are complted
Completed which {timeslot} are complted
Completed Completed Target groups
Inpreparation in preparation
Inpreparation inpreparation
Inpreparation Targetgroups in preparation
Inpreparation which in preparation
Inpreparation which one are in preparation
Inpreparation which are in preparation
To_be_released to be released
To_be_released Target groups to be release
Released released
Released to be released
Released which one released
Released which ones are released
Released which {timeslot} are released
Released which {timeslot} released
Released Released Target groups
Members how many number does {numberslot} have
Members members targetgroup number {numberslot} {targetgroup}
Campaigns Campaigns targetgroup number {numberslot} {targetgroup}
Greeting hello
Greeting info
Greeting infos
Greeting recap
Release_one release {numberslot}
After creating an interaction Model.
the next step is to configure the Endpoints which will answer to amazon requests.

 

In the next steps, we will create our Interaction Model and connect it to a Webhook.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply