question

Mark_Sak avatar image
Mark_Sak asked ·

How can we define default intent if a spoken's input doesn't match defined Utterances?

I can't find a solution for this. Can someone please provide the workaround?

alexa skills kitiapintents
10 |2000 characters needed characters left characters exceeded

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

Jamie Grossman avatar image
Jamie Grossman answered ·

Thanks for posting. If Alexa can't link one of your user's sample utterances to an intent in your code, you can capture this in your code using the else part of when your skills are being checked. For example:

if (intentName === 'getIntent1') {
        doThis(intent, session, callback);
    } else if (intentName === 'AMAZON.HelpIntent') {
        doThat(intent, session, callback);
    } else if (intentName === 'AMAZON.StopIntent' || intentName === 'AMAZON.CancelIntent') {
        handleSessionEndRequest(callback);
    } else {
        errorResponse(intent, session, callback);
    }

You can then make an errorResponse function that is just like any other part of your skill, that sends back a speechOutput ('Sorry, I didn't quite get that'), a reprompt text, session attributes, etc. Whatever is needed in your skill.

1 comment
10 |2000 characters needed characters left characters exceeded

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

Thank you for the respond.

0 Likes 0 ·
Galactoise avatar image
Galactoise answered ·

I'm almost certain the above answer is not what the user was asking for. They were almost certainly asking "How do I capture user requests that were clearly targeted at my skill, but did not reasonably match one of my defined utterances".

This is an extremely common, old, and well-known feature request, and one which we can't even seem to get any acknowledgement on. Further, this is the type of thing people had been solving with the LITERAL, which is now slated to be silently disabled without feature parity nor explanation. (It's telling that, despite being the top thread on the feature request forum, we've still had no official word at all on that topic.)

So:

  • Mark_Sak, there is no known way to address that problem at this time.
  • Jamie et al, the silence is deafening on this problem and the broad array of closely related topics.
1 comment
10 |2000 characters needed characters left characters exceeded

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

Thanks for the answer. Your understanding to my question is correct. I have been searching to get the answer from the forum. However, I can't find a good solution for the issue. I hope Alexa team would address this issue soon.

0 Likes 0 ·
nuukee avatar image
nuukee answered ·

I am having the same / similar issue.

As soon as I have one of my intents in, in always defaults to one of them if there should be no match.

For example my intent was something like "who lives here" and it would match it even if I ask "what is the weather like"

I found out that in my case it would always default to the intent which had most sample utterances.

So the reasoning seems to be that if Alexa cannot match an intent it chooses the one with the most utterances as there is the highest chance of matching.

My circumvention right now is to have a "DidNotUnderstand" intent and feed it many many utterances with only gibberish.

It will now default to this intent, which is my intended behavior, and my lambda code will now have a response like "I did not understand you".

Hope this helps.

10 |2000 characters needed characters left characters exceeded

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