I am very new to Alexa development and I am using JOVO framework for this purpose. So my apology if this is not the right place to ask this question.
My skeleton of app.js (JOVO) looks like this:
const ivr_menu: = [
{
choice: "contact detail",
desc: "know more about a given contact."
},
{
choice: "email history",
desc: "know emailing history of a given contact."
},
]
app.setHandler({
LAUNCH(){
return this.toIntent("WelcomeIntent");
},
async WelcomeIntent() {
let os = "Welcome. Please listen to the IVR menu options carefully.";
for (var index = 0; index < ivr_menu.length; index++) {
os += `Say ${ivr_menu[index].choice} to ${ivr_menu[index].desc}.`;
}
this.ask(os);
},
async UserChoiceIntent() {
const menu_option = this.$inputs.ivrmenuoption.value;
switch(menu_option) {
case "contact detail":
return this.toIntent("ContactLookupIntent");
case "email history":
return this.toIntent("EmailHistoryIntent");
}
},
async ContatLookupIntent() {
const contact_id = this.$inputs.contactid.value;
this.tell(contact_id);
}
});
What I am trying to accomplish is when user tells his choice, it will first greet the user with the IVR menu options. Once user picks up a choice (say by saying contact detail
), the skill will enter into UserChoiceIntent
and navigates to the correct intent (switch-case
).
Each of these intents like ContactLookup
or EmailHistory
asks an input from the user. In the case of this skill the IDs are always numeric, like 5099563.
In the above approach the issue I am having is when alexa navigates to an intent it does not get the required input (const contact_id = this.$inputs.contactid.value
) and hence ending up saying There is an error in your requested skill's response
.
Here are my questions:
-
Is there any option that I navigate to an intent and ask the user for an input? Is there any way that I can use a kind of slot utterance that will be asked by alexa after navigating to the intent and wait for user input (
this.ask()
)? Once the input value is available, alexa will continue to execute rest of the logic inside that intent? The bottom line is alexa does a this.ask() and then continue with the rest of the logic in the intent. -
How can I create slot utterances by hand? Please note I am building the skill using JOVO locally and deploying it to alexa.
-
Since all my intents in this skill take inputs like 5099563, i.e. a numeric value, how can I send that to alexa? I tried with
AMAZON.NUMBER
, but when I enter a value, I don’t know it comes up with some strange results which is nowhere related to my intent response. It seems like the input is taken and used for some other skill from somewhere! What is the right slot type to use here? I triedAMAZON.LITERAL
but it is only available in the US and I am fro India so it won’t work for my skill. The best way I can think to send such value is by saying it likefive zero nine nine five six three
.AMAZON.NUMBER
will not accept this (or may be I am wrong). So what is the best way to handle such a situation?
The interaction model:
{
"interactionModel": {
"languageModel": {
"invocationName": "metrics report",
"types": [],
"intents": [
{
"name": "WelcomeIntent",
"samples": [],
"slots": []
},
{
"name": "UserOptionIntent",
"samples": [
"{ivrmenuoption}"
],
"slots": [
{
"name": "ivrmenuoption",
"type": "AMAZON.Person"
}
]
},
{
"name": "ContactLookupIntent",
"samples": [
"{contactid}",
],
"slots": [
{
"name": "contactid",
"type": "AMAZON.NUMBER"
}
]
},
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
}
]
}
}
}
Please note I am very new to Alexa skill development. If some of my questions look stupid, please consider my newbie level of understanding.