As you did, you have to use AMAZON.Number
slot type.
Can I make Alexa to just trigger this intent if the input words are on a specific list?
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.
It's always a good idea to validate the slot values at your backend. If the numbers are something which you don't support, respond back with a proper error message like
"Sorry I can proceed wiht Nine eleven, please give the correct number"
This way you will let your users know that they have to use a different number. If there is number input, any number can come in. So validate and guide.
How can I capture the words on my node.js server like capturing "one
two three" instead of the automatic result "123" =
"onehundredtwentythree"?
If you use AMAZON.Number
slot type, the values will come as 123
.
"numberSlot": {
"name": "numberSlot",
"value": "123",
"confirmationStatus": "NONE"
}
You can easily validate 123
or convert it to any form as you need.
automatic result "123" = "onehundredtwentythree"?
I really didn't understand this. 123
is not automatically convereted to onehundredtwentythree
. If you are pointing to the outspeech, or how Alexa speaks 123
, then its a different case. Use <say-as interpret-as="digits">123</say-as>
in you output SSML to spell each digit separately.