0

I am developing an app and everything is working good. One condition are there where I have set the utterances but if user is speaking something else, I am throwing it to the fallbackIntent. One of my utterance is {name} so user can speak any name. But I have define range of name as well that user is allowed only these names. So my problem is if the user is choosing defined names, everything working great and if user said something else like what is weather of chicago, it is going to fallbackIntent as well but the issue is if user speak some name which is not in the list, then too it is coming into defined intent. What i want that if user speak something which is correct but not in my defined name then too redirect it to the fallbackIntent. Is there any way I can call intent in giving condition? I am using php.

Rahul Gupta
  • 972
  • 11
  • 29

1 Answers1

0

When you define a custom slot, Alexa take it's values as samples. So values which are not in the slot-value-list will also be passed to you. And with respect your intent, those slot values are valid, hence that intent is triggered.

The solution is to validate the slot values at your backend and return an appropriate response.

In your case, if u get any other names other than those you have defined, respond back with an error or give FallbackIntent's response.

When you create a custom slot type, a key concept to understand is that this is training data for Alexa’s NLP (natural language processing). The values you provide are NOT a strict enum or array that limit what the user can say. This has two implications

1) words and phrases not in your slot values will be passed to you,

2) your code needs to perform any validation you require if what’s said is unknown.

johndoe
  • 4,387
  • 2
  • 25
  • 40
  • I have heard that with the help of `this.emit`, i can trigger another intent within an intent but how to use it in php, i am not getting any example. please suggest some. – Rahul Gupta Aug 08 '18 at 13:50
  • "this.emit" is for alexa node.js sdk – johndoe Aug 08 '18 at 13:51
  • ohk... so there is nothing for php, i mean i have to handle it with the code as you said. – Rahul Gupta Aug 08 '18 at 13:52
  • 1
    Write the handlers in a such a way that you can always transfer requests to other handlers, it will be of great use. – johndoe Aug 08 '18 at 13:56
  • Also I ahve one more question. As there are very few alexa developer active here, please if you could answer this, i would be thankful https://stackoverflow.com/questions/51748690/designing-card-in-alexa-as-it-is-in-example – Rahul Gupta Aug 08 '18 at 14:05
  • sure, i will answer if I know the answer – johndoe Aug 08 '18 at 14:06