Alexa skill development: Wrong validation behavior for custom slot types

92 views Asked by At

I've seen several posts on this issue but by now, I don't find any sufficient reaction from Amazon side :/.

Let me describe my problem: In my skill, I use custom slot types. One of them is called "IncomeType" consisting of two acceptable slot values: 1) "Principal Income" and 2) "Side Job". During the skill interaction, I would like to ask the user whether their salary is a principal income or earnings coming from a side job. This is why I use a custom type. Please refrain from trying to convince me using one of the build-in types for this purpose or handling this issue by asking "Is it a principle income" and reaction with Yes-/NoIntent (as this is the number one suggestion to all others who have the same problem).

Custom slot type and its values

When I define prompts for Alexa to elicit the corresponding slot (called "IncomeSlot" in my case), a very weird behavior occurs and I googled for months to find a soluction for that.

Using custom slot types in combination with slot validation, I expect Alexa to first use the Alexa Speech Prompt to ask for a (hopefully valid) slot value in return. Now either of two scenarios can happen: A) The user gives a valid response, e.g. "My salary is a principle income". In this case, everything is fine. No need for reprompting. B) The user's answer is nonsense, e.g. "My salary is a banana". In this case, I want to use the reprompt (not the original prompt!!!) defined in the slot validation section to force the user to corrrect their answer. I tried this by configuring the validation rule "Accept only slot type's values and synonyms" and by defining such a reprompt.

Reprompt in case the user's answer is wrong

But what ACTUALLY happens is, that, as soon as I activate slot validation for a custom slot type (not for build-in types -> with build-in types, slot validation is working perfectly fine!!!), Alexa does two things:

  1. The system suddenly stops accepting correct user input and reacts with the validation's reprompt. For example, when I activate "Accept only slot type's values ans synonyms" by clicking on the + symbol and defining a reprompt, Alexa does not accept answers such as "My salary is from a side job" anymore, even though this is one of the user utterances I configured. Instead, Alexa plays the reprompt "Uuups,this isn't any type I know. I suggest you to say principle or side job.".
  2. When wrong input is given (e.g. "My salary is a banana") it does not play the reprompt but the system repeats the slot's original Alexa Speech Prompt -_-. This is very frustrating as it does not hint the user to modify their answer. Some testers of my skill reported that they just continued repeating the wrong sentence "My salary s an banana" because they thought that Alexa just did not listen to them. After repeating, Alexa stopped communicating to them as the response is interpreted a second time to be invalid.

I assume this problem to be related somewhat to Amazon's statement in the documentation, claiming: "For a required slot, Alexa elicits the slot value if necessary, and then does the validation in a subsequent step.". This subsequence must be the problem, I guess... But either way, This behavior does not meet the logic behind slot validation, that I assume it to have. Am I the only one seeing a contradicting behavior here?

Btw: With build-in types, the behavior is accurate: When asking for the first time for a slot's value, Alexa choses the Alexa Speech prompt. When no answer is given, this Alexa Speech prompt is repeated. Only when wrong input is given, the system chooses the reprompt defined in the validation section. I want the same behavior for custom types please.

1

There are 1 answers

0
CodeDog On

The system suddenly stops accepting correct user input and reacts with the validation's reprompt.

This may be due to no exact match between the slot value understood from the user utterance and the custom slot's values and synonyms defined in your skill's interaction model. If you're able to reproduce this issue, you can find the text of your voice utterance when logged into your Amazon Developer account on this page: https://www.amazon.com/alexa-privacy/apd/rvh. If the speech recognition is correct and the filled slot value from the voice history matches one of the slot's values or synonyms exactly, this may then require further investigation.

When wrong input is given (e.g. "My salary is a banana") it does not play the reprompt but the system repeats the slot's original Alexa Speech Prompt -_-.

I've reproduced this behavior in a test skill from my account. If a user provides a slot value that has no matching values or synonyms for the required custom slot and the validation rule of "Accept only Slot type's values and synonyms" is in place, Alexa returns the slot elicitation speech, not the slot validation rule prompt speech. This seems to be expected behavior based on the documentation (same page you have referenced). This would therefore require the added flexibility of the Dialog interface, which would allow you to control each step of the dialog yourself using Dialog.ElicitSlot, Dialog.ConfirmSlot, and Dialog.ConfirmIntent directives in your skill code.