How to read entity value not defined in model


#1

Is it possible to capture an entity value not matching one of the predefined entityTypes values provided in the model?

When testing from the webhook URL, this.$entities.goBearing is undefined (where “goBearing” is the name of the slot/entity referenced in phrases as shown, in my simple model, below). Defined values work fine.

My recollection from Alexa was that it would attempt to fill an entity not provided as a slot value. This allowed my interactive adventure game skill to give a more contextual response along the lines of “I would love to go ballistic, however that is not a valid direction.”

Can this be done? Thanks…

{
“invocation”: “Adventure Castle”,
“version”: “4.0”,
“intents”: {
“goIntent”: {
“phrases”: [
“go”,
“go {bearing}”
],
“entities”: {
“bearing”: {
“type”: “goBearing”
}
}
}
},
“entityTypes”: {
“goBearing”: {
“values”: [
“left”,
“right”
]
}
}
}


#2

You could accept a string value, and then map it to the enumerated type in your own code. The downside would be that Alexa wouldn’t have the expected values to help guide its recognition, and you’d get more interpretation errors.

Or you could implement FallbackIntent, though that would only give you the ability to tell the user you didn’t understand and ask them to phrase it another way. (Which is usually good enough.)

Or you could stay with the enumerated types AND implement FallbackIntent, watch the logs to see what people are trying to do that you don’t support, and add really appropriate responses to those in the next release of the skill. Admittedly that doesn’t encourage people to experiment with abusing your skill by telling it “go bleep yourself”, but that’s really no great loss.


#3

Thank you for the response. I have about 99 more problems with Jovo4 which I may start to address in separate questions so as not to confuse the topics. This one, I can work around for now if I can get “Hello World” working from the Alexa Skills developer console.

Regards,

Jim