Microsoft & .NET.NETCreating Amazon Skills with .NET, Part 1: First, Getting the Basics Right

Creating Amazon Skills with .NET, Part 1: First, Getting the Basics Right

Introduction

Life is becoming simpler by the minute and people sometimes just don’t realize it. Amazon Alexa has been around since 2014, but has only recently become very popular with over 100 million Alexa-enabled devices sold already.

Now what makes Alexa so special?

Alexa

Alexa is a virtual assistant developed by Amazon. It is able to deal with voice interaction, do music playback, make to-do lists, set alarms, stream podcasts, play audiobooks, and provide real time information such as weather, traffic, sports, and news.

Alexa is able to control smart devices by using itself as a home automation system. Users can extend Alexa capabilities by installing additional functionality developed by third-party vendors, called skills.

How Do I Start?

First, register for an Alexa developer account, if you do not already have one, by navigating to this URL.

Confirm your details on the next page.

Select your interests, as shown in Figure 1. (For now, select only the interests applicable to Alexa):

Interests
Figure 1: Interests

You can continue editing your profile, which includes the following details:

  • My Account
  • Company Profile
  • Payment Information
  • Tax Identity
  • User Permissions
  • Mobile Ads
  • Identity
  • Security Profiles

The next step is to create the Skill by clicking Create Skill. This page is shown in Figure 2:

Create Skill
Figure 2: Create Skill

After you have clicked the Create Skill button, a new page will load. It asks for the following information:

  • Name of the skill: This is the name of your skill
  • Language of the skill: What language the skill will use to communicate, for example: English (UK)
  • Model of skill: Your own custom unique experience
  • Backend resources: Your own resources

Click Create Skill again.

Choose a template to work with. Figure 3 shows an example of the Fact Skill.

Template
Figure 3: Template

On the next page, select the JSON Editor from the menu and enter the following code:

{
   "interactionModel": {
      "languageModel": {
         "invocationName": "space facts",
         "intents": [
            {
               "name": "AMAZON.CancelIntent",
               "samples": []
            },
            {
               "name": "AMAZON.HelpIntent"
               "samples": []
            },
            {
               "name": "AMAZON.StopIntent",
               "samples": []
            },
            {
               "name": "AMAZON.NavigateHomeIntent",
               "samples": []
            },
            {
               "name": "GetNewFactIntent",
               "slots": [],
               "samples": [
                  "a fact",
                  "a space fact",
                  "tell me a fact",
                  "tell me a space fact",
                  "give me a fact",
                  "give me a space fact",
                  "tell me trivia",
                  "tell me a space trivia",
                  "give me trivia",
                  "give me a space trivia",
                  "give me some information",
                  "give me some space information",
                  "tell me something",
                  "give me something"
               ]
            }
         ],
         "types": []
      }
   }
}

This code is available on GitHub.

These are some phrases that you can use in your skill and Alexa will understand it (see Figure 4).

JSON Editor
Figure 4: JSON Editor

Click Save Model.

We now have finished building the Voice User Interface for our skill. The next step in the process is to create an AWS Lambda function, and for that we will be using .NET

Conclusion

Now that we have set up the Amazon account and Models, we are almost set to start programming with .NET. The next installment in this series will cover that.

Get the Free Newsletter!
Subscribe to Developer Insider for top news, trends & analysis
This email address is invalid.
Get the Free Newsletter!
Subscribe to Developer Insider for top news, trends & analysis
This email address is invalid.

Latest Posts

Related Stories