I agree to TechTarget’s Terms of Use, Privacy Policy, and the transfer of my information to the United States for processing to provide me with relevant information as described in our Privacy Policy.

Please check the box if you want to proceed.

I agree to my information being processed by TechTarget and its Partners to contact me via phone, email, or other means regarding information relevant to my professional interests. I may unsubscribe at any time.

Please check the box if you want to proceed.

By submitting my Email address I confirm that I have read and accepted the Terms of Use and Declaration of Consent.

interface design -- that comes with its own set of complexities.

Speech is very different from visual presentation. A person listens to a sentence just once, as it is spoken; he or she can't go back and hear it again. A speech application with, for example, a simple 10-item list strains the limits of voice interaction. This is especially true with a computer-generated voice, which lacks a variety of inflection and nuance. It's easy to lose patience with this method of interaction.

But applications with voice interfaces are in style, buoyed by popular smart speaker, such as Amazon Echo and Google Home. Below are some tricks to help you build Alexa skills to expand your reach with this new medium.

Some Alexa skills -- voice-based applications built specifically for Alexa -- answer a single question, which completes the interaction. Other skills are more conversational, enabling the end user to make a series of requests that trigger Alexa responses. For example, in my Premier League soccer skill, an end user can ask a variety of questions about the table, about a particular team and about various statistics.

After answering each question, the Alexa skill asks the user what they want to do next. Rather than repeat the same prompt, my skill randomly selects from a variety of similar prompts. This is one of several Alexa tricks that makes the interaction truer to normal conversation. Here is how my skill approaches the conversational tone:

<code>

var prompts = {

"help": [

"Say get table, or say a team name ",

"Ask about the table, or a team ",

"Say a command ",

"We can tell you about teams or the table "

]

};

function randomPrompt() {

return prompts.help[Math.floor(Math.random() * prompts.help.length)];

}

</code>

Adjust Alexa to the user

When they build Alexa skills, developers should keep in mind the end user's level of experience with the voice service. The new Alexa software development kit makes it trivial to record data about each user. For example, by adding a single line of code to a Lambda function, AWS will store all invocation variables in a per-user DynamoDB table, such as how many times a user interacted with the skill. This essentially preserves your state across invocations.

Another of my skills, More Screen Time, gives detailed instructions the first three times the skill is invoked, uses a statistical model to give less-detailed instructions the next 12 times the skill runs and then skips the instructions completely. Developers can use this sort of technique, shown below, in a variety of ways, such as analyzing patterns and welcoming back an end user after an absence.

<code>

function buildWelcome(emmiter) {

if(invocation_count < 3) {

return spliceTODintoWelcome(emmiter.t(‘DETAILED_HELP'));

}

if (invocation_count < (Math.random() * 12)) {

return spliceTODintoWelcome(emmiter.t('MINI_HELP'));

} else {

return spliceTODintoWelcome(emmiter.t('WELCOME'));

}

}

</code>

Progressive disclosure of options

Voice interface design also involves a large set of options. In a visual application, a developer can build a 10-item drop-down list. But that doesn't work in an auditory environment. If you list all the options at the start of the interaction, end users will become bored and likely forget options. Conversely, if you don't tell users all the options, they won't discover the full capability of your skill.

To address this, the Premier League skill maintains a list of possible voice commands and a list of used commands, as shown in the code below. Each time Alexa prompts the end user, it starts with one of the random main prompts, but then, it adds a random suggestion from the list of all possible voice commands. The skill tracks which questions it asks and randomly suggests an unused question. This helps guide the user to gradually learn the full capabilities of the Alexa skill.

Given even a modest set of main prompt options and extra commands, Alexa has a large set of potential phrases developers can use when they build Alexa skills, which reduces repetition and enhances the overall experience.

<code>

var extraCmdPrompts = new Map();

extraCmdPrompts.set("redcards", ". you can also say red cards");

extraCmdPrompts.set("yellowcards", ". you can also say yellow card");

extraCmdPrompts.set("cleansheets", ". you can also ask about clean sheets");

extraCmdPrompts.set("goals", ". you can also ask about goals");

extraCmdPrompts.set("relegation", ". you can also ask about relegation");

// This command lets us suggest commands to the user that they have not yet used

function suggest() {

var suggestionsLeft = extraCmdPrompts.size;

if(parseInt(suggestionsLeft) > 0) {

var firstKey = Array.from(extraCmdPrompts.keys())[0];

var firstValue = extraCmdPrompts.get(firstKey);

extraCmdPrompts.delete(firstKey);

return firstValue;

}

return ''

}

</code>

Alexa tricks for configuration

The same principle applies to Alexa configuration. Our company wrote a custom Flash Briefing skill focused on our internal infrastructure. In this skill, we had a large number of possible sources of internal news items relating to our projects and infrastructure, such as trouble tickets, system availability and customer outages. We wanted users to configure which news sources to include in the briefing. In a visually configured system, the set of news sources would display as a set of checkboxes. But that's not an option with Alexa. There are several approaches developers can take here.

Some developers choose a hybrid approach when they build Alexa skills, in which they configure them visually, but for verbal use. This typically means creating a webpage where application configuration occurs. A developer could also build a voice interaction model that allows for a gradual configuration of the system. An example of this is a flash briefing that starts by including all news sources but asks the end user, "Include this news source?" The user can respond with his or her preferences to configure the system verbally.

Link accounts

If you create an Alexa skill, you want everyone to have access to it. But if you create a business skill, you probably want to restrict access to your own employees.

Account linking lets developers or users link Alexa skills to certain credentials. For example, if developers want to limit a skill to business usage and employees, they can link the skill to an existing OAuth system. End users, on the other hand, can link external credentials to a skill to order a pizza or hail an Uber.

These Alexa tricks can go a long way toward making a skill more accessible and enjoyable to the users an enterprise wants -- and only those users.

Join the conversation

2 comments

Register

I agree to TechTarget’s Terms of Use, Privacy Policy, and the transfer of my information to the United States for processing to provide me with relevant information as described in our Privacy Policy.

Please check the box if you want to proceed.

I agree to my information being processed by TechTarget and its Partners to contact me via phone, email, or other means regarding information relevant to my professional interests. I may unsubscribe at any time.