First of all, please take my apology for posting some generic questions here. But these are kind of important and I want to implement this functionality in my skill which I am developing.
In my skill, I want to offer an IVR menu to my users. This is how it looks:
const ivr_menu = [
{
id: 1,
choice: "Contact detail."
},
{
id: 2,
choice: "Email History."
},
{
id: 3,
choice: "Bounced Emails."
},
{
id: 4,
choice: "Email Sent by Contact."
},
{
id: 5,
choice: "Email viewed by Contact."
},
{
id: 6,
choice: "Contact groups."
},
{
id: 7,
choice: "Email activity log."
}
];
When I am testing the application with JOVO debugger
, I can easily select the right Intent button and pass a value from there. But in real time, how would I tell Alexa to navigate to the right intent at the same time with a kind of output?
app.setHandler({
LAUNCH() {
return this.toIntent("WelcomeIntent");
},
async WelcomeIntent() {
let os =
"Welcome to emailer platform. The following IVR menu will guide you through. Please listen carefully. <break strength='medium' />";
for (var index = 0; index < ivr_menu.length; index++) {
os += `Say ${ivr_menu[index].id} <break strength='medium' />for ${
ivr_menu[index].choice
}. <break strength='strong' />`;
}
os += " To repeat this menu say 9.";
this.ask(os);
},
...
});
The above WelcomeIntent
gives user the options to choose from 1 through 7 (the IDs). The question is if I say choose 6 from the IVR the skill should automatically navigate to the associated Intent. But I am not sure if in real time this would happen.
Question 1:
Is there an y option that I can tell Alexa something like this?
this.ask('output-speech', [intent-name]);
so that when I SAY
a value Alexa already knows which Intent it has to activate?
The above skill has many different intents and Context Switching is not required for now for this skill. It will be a kind of one intent at time. i.e. user will choose another intent only by getting back to WelcomeIntent
(the ivr-menu) and entering his/he choice (ID, i.e. 1 through 7).
Here is the model I have for now:
{
"invocation": "metrics report",
"intents": [
{
"name": "HelloWorldIntent",
"phrases": ["hello", "say hello", "say hello world"]
},
{
"name": "WelcomeIntent"
},
{
"name": "UserOptionIntent",
"phrases": ["{option}"],
"inputs": [
{
"name": "option",
"type": "AMAZON.NUMBER",
"dialogflow": "@sys.given-name"
}
]
},
{
"name": "BouncedEmailIntent",
"phrases": ["{emailid}"],
"inputs": [
{
"name": "emailid",
"type": "AMAZON.NUMBER",
"dialogflow": "@sys.given-name"
}
]
},
{
"name": "ContactLookupIntent",
"phrases": [
"{contactid}",
"Contact id is {contactid}",
"I want to know about {contactid}"
],
"inputs": [
{
"name": "contactid",
"type": "AMAZON.NUMBER",
"dialogflow": "@sys.given-name"
}
]
},
{
"name": "ContactGroupsIntent",
"phrases": [
"{contactid}",
"Contact Id is {contactid}",
"Which groups {contactid} belongs to",
"Tell me which groups {contactid} belongs to",
"I want to know which groups {contactid} is associated to",
"Tell me the names of the groups which {contactid} belongs to"
],
"inputs": [
{
"name": "contactid",
"type": "AMAZON.NUMBER",
"dialogflow": "@sys.given-name"
}
]
},
{
"name": "OptionOneIntent",
"phrases": [],
"inputs": []
}
],
"alexa": {
"interactionModel": {
"languageModel": {
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
}
]
}
}
},
"dialogflow": {
"intents": [
{
"name": "Default Fallback Intent",
"auto": true,
"webhookUsed": true,
"fallbackIntent": true
},
{
"name": "Default Welcome Intent",
"auto": true,
"webhookUsed": true,
"events": [
{
"name": "WELCOME"
}
]
}
]
}
}
Question 2.
The API I am using to fetch data from server uses ID (numeric) for most of its endpoints, which are 6 digit numbers. The easiest way for users to tell those 6-digit numbers to Alexa if it accepts those as cardinal numbers. How can I accomplish this? Alexa has a built-in slot type called AMAZON.NUMBER
. But if I say an ID as cardinal number like one five nine zero six six
, will that be understood by Alexa when the slot type is AMAZON.NUMBER
?
Again, I apologize for such a long question. I am also sorry if this is not well written or organized. Please let me know if I should clarify more.
Eagerly looking forward to your reply.
Regards
Subrata Sarkar