Join Brandon Rich for an in-depth discussion in this video Enabling and invoking skills, part of Developing Skills for AWS Alexa.
- [Instructor] We sometimes talk about Alexa skills as being similar to smartphone apps. However, because the functionality of each skill is fully executed in the cloud, there's one key difference between smartphone apps and Alexa skills. With Alexa, there's nothing to install. In fact, your Alexa-enabled device has no local storage. That's why we don't talk about installing an Alexa app, we talk about enabling an Alexa skill. For Amazon, enabling a skill is as simple as setting a flag in your account that says that you're using a particular skill. When you say to your device, "Alexa, enable Skill B," the Alexa service simply updates your account to show that Skill B is enabled. Then, when you speak phrases to Alexa, it will consider Skill B as a candidate for fulfilling your request. Let's take a look at what happens when you talk to Alexa. First, you engage the voice assistant by using the wake word. Alexa's microphones are always listening for this word which starts the device actively listening and responding to you. After hearing the wake word, the device records what you say until you pause long enough that it determines you're finished speaking. At this point, the device sends that audio to the cloud and that's it from the Echo device. From here, until the spoken response plays back, everything takes place in the cloud. Our first stop is the Alexa voice service, a set of cloud-based services managed by Amazon that parse and route your request. The Alexa service uses highly advanced natural language processing to turn the audio of your speech into tokenized text. The service knows multiple languages. It can perform this processing for English, French, German, Italian, Japanese, Portuguese, and Spanish. Next, Alexa needs to match the parsed speech to a skill. To do this, it looks for your words to include the skill's invocation name. Every skill has an invocation name, a set of words that represents the skill. Often, this is the name of the skill itself. Amazon does have a few restrictions, however, which you can find in the documentation. Once it's defined, the user can invoke your skill in a few ways. Invocation names cannot be a single word unless it's a brand that you own. You can't use any launch phrases like run, start, or play. Those are reserved for the Amazon Echo. In addition, there are other reserved words like Alexa, of course. The first method for invoking a skill is analogous to a user tapping on a smartphone's app icon. We call that opening an app and that's exactly what the first invocation type does. By saying, "Alexa, open Skill B," your user begins a session with that skill. Subsequent voice commands will be routed to that skill specifically until the user explicitly exits by asking Alexa to close the skill or issuing a command similar to "Alexa, stop." Another method involves using the invocation name and a request in a single phrase. For this example, I have renamed Skill B to PizzaDog. If you say, "Alexa, ask PizzaDog to order pizza," the request will automatically be routed so that it is handled by the PizzaDog skill. This lets your users skip the back and forth required by simply asking Alexa to open the skill. The last and newest way to get into a skill involves no explicit invocation at all. You've no doubt noticed that Alexa comes with all kinds of skills that don't require you to say, "Open X," or ask why to do something. You can just say, "Alexa, what's the weather?" Or, "Alexa, what time is it?" Behind the scenes, you're still hitting one of Amazon's own suite of skills. Amazon has created a way for us to do these kind of name-free interactions, as they call them, using a method called can fulfill intent request. As exciting as this type of invocation is compared to the others, it's still sort of baking as a feature, and it is a bit challenging. Amazon requires you to jump through several hoops, and even then, it's somewhat random when your skill may get invoked. For more on this, you can see Amazon's docs on name-free interactions. For now, let's see what happens after Alexa understands your invocation.
- Designing effective voice interactions
- Designing an interaction model
- Building voice interactions
- Building an interaction model
- Alexa response functions
- Skills software development kit (SDK)
- Mapping values