virtual-alexa
virtual-alexa copied to clipboard
Missing support for new built-in intent AMAZON.SelectIntent
Description:
The framework throws an error when trying to use the AMAZON.SelectIntent
built-in intent
Environment:
- Version:
- OS: Mac
- Node version: 8
Steps To Reproduce
Steps to reproduce the behavior:
- Create a test with this intent:
reply = await platform.intend('AMAZON.SelectIntent', { ListPosition: '3' });
Expected behavior
virtual-alexa should return an intent request for AMAZON.SelectIntent
with the slot value I defined in the slots. It could be one of the 4 intents allowed
Actual behavior
It returns the following error: Error: Trying to add slot to intent that does not have any slots defined
Code example
reply = await platform.intend('AMAZON.SelectIntent', { ListPosition: '3' });
Hi Octavio, we are looking to add support for this in our upcoming development. In the meantime, you can work around this by using our request object. It works like this:
const request = alexa.request()
.intent("MyIntentName")
// Directly set any property on the JSON easily with the new set method
.set("request.intent.slots.ListPosition", {
"name": "ListPosition",
"value": "5",
"confirmationStatus": "NONE"
});
const response = await request.send();
Additional info on the skill request object is here: https://bespoken.github.io/virtual-alexa/api/classes/skillrequest.html
Using the set method you can essentially manipulate the JSON as needed. Not an ideal solution, but should get you past this error message.
We are keeping this issue open for scheduling in an upcoming sprint.
Thanks @jkelvie I was able to use it that way exactly. Sorry for not posting it before!
Hi @jkelvie @dmarvp any updates on a timeline for this enhancement? We are automating a testing solution and having the simpler .intend
command would be nice (and much less work).
Hi Tyler, we do not have a current timeline for this - I would recommend the workaround as mentioned above, imperfect though it may be.
@jkelvie thanks for the reply! I really appreciate it.