I am developing an app that has an Alexa app using node and the ask-cli
. For testing, I am using the ask dialog
command. My Alexa skill is working similar to the trivia example, where you give a user a question and the user responds with an answer but giving the index of the multiple choices.
The problem is, that for authentication I ask the user to give the Alexa skill a number composed of four digits (I know that it's not so secure, but I don't know a better method at the moment). So, when I test it using the numbers it doesn't fill the slot
variable of the request intent, but if I use text instead of the actual number, it works.
One important thing to mention is that it works as expected on the website using my voice, as I don't see a way that it can differentiate if I'm pronouncing a digit or text number, and it interprets it as text. Also, we need to take in count that if I use only 1 digit as an answer, it works too.
The test where it fails is (Alexa's last message is a controlled error message):
User > abrir la trivia favorita
Alexa > ¡Bienvenido!. Para empezar, ¿Puedes decirme tu código de usuario?
User > 9225
Alexa > No he entendido el código de usuario. ¿Podrías repetirlo?
But it works if I do (Alexa's success message):
User > abrir la trivia favorita
Alexa > ¡Bienvenido!. Para empezar, ¿Puedes decirme tu código de usuario?
User > nueve dos dos cinco
Alexa > ¡Hola Pepín!, Bienvenido al sistema. ¿Cuál trivia deseas?
Also works under (Alexa's success message):
User > abrir la trivia favorita
Alexa > ¡Bienvenido!. Para empezar, ¿Puedes decirme tu código de usuario?
User > claro 9225
Alexa > ¡Hola Pepín!, Bienvenido al sistema. ¿Cuál trivia deseas?
This also works (Alexa's success message):
User > abrir la trivia favorita
Alexa > ¡Bienvenido!. Para empezar, ¿Puedes decirme tu código de usuario?
User > nueve mil doscientos veinticinco
Alexa > ¡Hola Pepín!, Bienvenido al sistema. ¿Cuál trivia deseas?
My model is:
{
"name": "AnswerIntent",
"samples": [
"{Answer}",
"Elijo la opción {Answer}",
"La opción que deseo es {Answer}",
"Me gustaría elegir la opción {Answer}",
"Claro es este {Answer}",
"Si claro es este {Answer}",
"Claro {Answer}",
"Sin duda {Answer}"
],
"slots": [
{
"name": "Answer",
"type": "AMAZON.NUMBER",
"samples": []
}
]
}
What I would like to know is that is it something expected, as when you interact with it using your voice what it does is translate it into numbers written in text instead of actual digits? or am I doing something with my slot?
According to the docs AMAZON.NUMBER "Converts numeric words ("five") into digits (such as "5")." So it's only gonna work with words.