question

echonewbie avatar image
echonewbie asked

How to handle Invalid Intents

I am having a hard time handling Invalid Intents. Whenever I say any random word, Alexa would respond to any of the Intents regardless if the utterance matches any intents or not.

Also, is there any way we can capture the exact phrase or command given to Alexa?

Can anyone please help?

alexa skills kitvoice-user interface
10 |5000

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

jjaquinta avatar image
jjaquinta answered
There is no way to "turn on" or "turn off" intents. All are active all of the time. If you have a workflow, where some make sense in some circumstances and not in others, you need to handle that yourself. Most people use Finite State Machines to do that. Lots of "I don't understand what you mean in this context" type replies. That's where the art of designing an audio interface comes in. And there is no "exact phrase spoken to Alexa". Alexa does not take what you speak, turn it into text, and then work out which intent to call. It's much more complicated than that. It takes the streamed speech as a series of phonemes, and interprets that with respect to your interaction model, generating confidence indexes for each possible interpretation. It then picks the one with the highest confidence and calls that. So it tells you exactly what it thought it heard, heavily weight based on your interaction. If you say something completely unexpected, it is still going to do its best to shoe horn it to something that is within the model. [My best guess about the text printed on the card is that it back-solves that once the intent is mapped.]
10 |5000

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

echonewbie avatar image
echonewbie answered
Thank you jjaquinta for your response. I have tried your suggestion by adding an Invalid Intent that's supposed to catch the possible invalid requests. But there is an infinite number of possibilities and to list them all is somewhat close to impossible. Also, I noticed that after you have spoken something that does not fall to any of the intents, it just exits the app and you have to invoke the skill again.
10 |5000

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

jjaquinta avatar image
jjaquinta answered
I do not recommend creating a "generic intent" that is so broadly defined it captures everything else. Alexa is very poor at that, the interaction model is not designed with that in mind, and it won't end up giving you decent quality. If you just want to do a demo, that's fine. If you want to produce a quality skill, that's not the direction you want to go in. And, yes, it is expected behavior for Alexa to just drop the line when you say something unexpected. It can be irritating at times. But it is also equally irritating when it doesn't, and rambles on for ages on misheard responses. There's no perfect answer.
10 |5000

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

echonewbie avatar image
echonewbie answered
Got it. I'll keep this in mind. Thanks!
10 |5000

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

dev-1 avatar image
dev-1 answered

I've been detecting that situation and sending back a speech_response = ''. So Alexa says nothing to the user, but gets ready for the next input. Hokey, but it seems to be working.

1 comment
10 |5000

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

That's never going to get past certification. They require a response at all times.

0 Likes 0 ·