article

Allie@Amazon.com avatar image
Allie@Amazon.com posted

Skill functionality essentials: Skill Endpoint should consistently return a non-error response for modal or one-shot launch requests

One of the essential core functionalities in any skill involves the endpoint consistently returning a non-error response for modal (invoking a skill with no specific request - no intent) or one shot (invoking a skill with a specific request). It can make or break a user experience.

Let’s have a look at an example of a good user experience:

User: Alexa, open Ned talks

Skill: Welcome to Ned talks, would you like to listen to Ned advice for today? Say yes to continue

User: Yes

Skill: It’s always fun to do something new, but often we fall into the trap of spending our weekends the same way. If you’re stuck in the same old routine, it might be time to try something new. Try one of these 4 things today- Visit a suburb in your city that you’ve never been to before, or somewhere you haven’t explored much. Or Learn ten phrases in a new language–what about Japanese, Italian or Portuguese? Or Listen to a genre of music you haven’t tried before–perhaps Jazz, Punk or Blues? Or Have a picnic in your local park complete with a packed lunch and your animal friends.

Let’s have a look at another example where the skill provides an inadequate user experience.

User: Alexa open dog facts

Skill: "There was a problem with the requested skill's response"

User: Alexa open dog facts and give me a fact

Skill: "I am having problem in accessing your skill right now"

In the above example, the user tried both the one shot and modal launch requests and both returned error responses. Skills returning any one of the below error responses/ no responses upon user input will be failed in the certification stage:

1. "There was a problem with the requested skill's response".

2. "Skill took too long to respond".

3. "There was a problem communicating with the requested skill".

4. "I am having problem in accessing your skill right now".

5. "The requested skill did not provide a valid response".

6. "I am unable to reach the requested skill”.

How to ensure skill endpoint consistently returns a non-error response:

When we create an Alexa skill from a template, the skill is automatically configured with a default endpoint. Alexa sends requests to this endpoint when you invoke the skill. The default endpoint responds to each request with a response containing:

  1. The type of the request, such as "LaunchRequest" or "IntentRequest".
  2. The name of the custom intent, if the request was an IntentRequest.
  3. The locale for the IntentRequest, such as "en-US".
  4. The names and values of all the slots defined for the intent.
  5. Slots that do not have values are reported as "undefined".
  6. If the slot value you provide in your utterance is defined as a synonym, the response includes both the defined value and the synonym you spoke.
  7. The Dialog.Delegate directive if the utterance is part of an incomplete dialog. See Add and test dialogs with the default endpoint.

To test, we can invoke the skill and try out the sample utterances defined in the interaction model. This test can be executed with the simulator on the Test page. Add and test a dialog model with the default endpoint.

For example, this is a test that we can complete before submitting the skill for certification.
User: Alexa, open quiz game
Skill: Launch Request
User: Start a quiz
Skill: Intent, QuizIntent. Locale, en-US.
User: tell me about California
Skill: Intent, AnswerIntent. Locale, en-US. Slots. Abbreviation, undefined, StatehoodYear, undefined, StatehoodOrder, undefined, Capital, undefined, StateName, california.

Below is a quick checklist to ensure skill endpoint consistently returns a non-error response while building skills:

  1. Navigate to the Invocation page to see the skill's default invocation name.
  2. Navigate to the Custom > Interaction Model > Intents page and then go to a specific intent to see the utterances for the intent.
  3. Go to the Test page and click the option at the top to enable the skill.
  4. Invoke the skill with the invocation name and try the utterances for the intent before submitting the skill.

Happy skill building!

certification test casecertification-checklist
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Article

Contributors

beth@amazon contributed to this article