Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Alexa Skills Projects

You're reading from  Alexa Skills Projects

Product type Book
Published in Jun 2018
Publisher Packt
ISBN-13 9781788997256
Pages 250 pages
Edition 1st Edition
Languages
Author (1):
Madhur Bhargava Madhur Bhargava
Profile icon Madhur Bhargava

Chapter 3. Hands-Free Experience with Alexa

"The tongue can paint what the eyes can't see."

– Chinese Proverb

We moved on from learning about the details of Echo and Alexa to designing a basic Alexa Skill. We also gained some familiarity with the anatomy of a basic Alexa Skill and how the various moving parts in a skill interact with each other.

In this chapter, we take our design skills a little further and create a slightly more advanced skill. Our skill is called Handsfree Messenger and it will allow the user to leverage Alexa to send SMSes in a hands-free manner, just using Alexa and Echo, without any interaction with his/her phone. We will use a custom service called Twilio, which allows a user/developer to make/receive phone calls programmatically and send/receive text messages using web service APIs, in addition to AWS, where we will be hosting our Lambda.

We do this by covering the following topics in this chapter:

  • Overview of the Handsfree Messenger Skill
  • Configuring the Twilio Messaging...

Overview of the Handsfree Messenger Skill


Before we go ahead and design the Handsfree Messenger skill, we will need to understand a few things:

  • What is the system's core functionality?
  • What are all of its moving parts?
  • How do these parts interact?

The Handsfree Messenger skill will work as follows:

  1. The user will start the Alexa Skill by saying a start phrase—"Alexa, Start Handsfree Messenger."
  2. Alexa will launch the skill.
  3. The user will voice the actual message that needs to be sent: "Send message – Get milk!"
  4. Now, this is where it gets interesting. When the user voices the actual message in the previous step, a SendMessage intent will be created and the actual message text will be passed as an argument to that intent.

Note

We have already discussed intents in the previous chapter and so we are assuming that the reader is already familiar with intents and their functionality.

  1. The intent is processed by the Lambda, where the Lambda extracts the message from the intent and passes it to the Twilio backend...

Configuring the Twilio Messaging Backend


Twilio is a cloud communications platform that was founded in 2007 and is based in San Francisco. It allows a user/developer to make/receive phone calls programmatically and send/receive text messages using web service APIs. For this chapter, we shall only be demonstrating its messaging function; however, we request and anticipate that the reader will extend the functionality of this skill by adding the phone call functionality as a homework exercise.

To configure Twilio as our messaging backend, we shall be following these steps:

  1. Please navigate to www.twilio.com in your web browser, as seen in this screenshot:

Fig 3.4: Twilio landing page

  1. Please click on Get a free API key or Sign up (both will start the sign-up process for a new user) to land on the Sign up for free page shown here:

Figure 3.5: Twilio sign-up page

  1. Please fill in your personal details. As shown in the previous screenshot, there is a small questionnaire towards the bottom of the page,...

Configuring the Handsfree Messenger Skill


With our Twilio backend in place, we now need to configure the Alexa Skill. For this, we will configure via the Amazon Developer portal.

We will assume that the reader knows and has already signed up to the Amazon Developer portal, and is already aware of basic starter information about the Amazon Alexa Skills Developer portal. We have already covered account creation and other basic details for the Amazon Developer portal in the last chapter, hence we would not be repeating those here.

We will start with skill creation:

  1. On the Create a new skill screen, please provide the skill with a name:

Figure 3.16: Creating the Handsfree Messenger skill

Please save these changes and move on to the next screen by using the Next button at the top right of the screen.

  1. In this step, we shall choose a model for our skill.

Note

We have already covered the specifics of choosing a model in Chapter 2, Hello World, Alexa!, so we won't be going into much detail here. Please select...

Summary


We do hope you enjoyed creating the Handsfree Messenger skill, which was slightly more evolved than our previous skill and oriented toward the practical use of Alexa/Echo devices. The skill that we created in this section still has room for a lot of improvement. For example, currently, our skill sends messages to predefined/hard-coded recipients, which can be improved by passing the recipient details via a slot to the Lambda so that it does not have to be predefined in the Lambda. We intentionally did not cover this and it is intended to be an extension exercise, which we highly recommend that you undertake if you really want to be an Alexa Skills Jedi sooner.

But, we again completed one more interesting Alexa Skill.

In the next chapter, we will extend our faculties regarding Alexa knowledge a little further by creating an Alexa Skill that is more oriented towards entertainment, will use a slightly more complex voice interface, and will be even more fun.

Can't wait to get started? Let...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Alexa Skills Projects
Published in: Jun 2018 Publisher: Packt ISBN-13: 9781788997256
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}