virtual-alexa icon indicating copy to clipboard operation
virtual-alexa copied to clipboard

Missing support for new built-in intent AMAZON.SelectIntent

Open omenocal opened this issue 4 years ago • 5 comments

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:

  1. 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' });

omenocal avatar Sep 25 '19 20:09 omenocal

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.

jkelvie avatar Oct 02 '19 20:10 jkelvie

Thanks @jkelvie I was able to use it that way exactly. Sorry for not posting it before!

omenocal avatar Oct 02 '19 20:10 omenocal

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).

btburton42 avatar Apr 28 '21 15:04 btburton42

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 avatar Jun 07 '21 21:06 jkelvie

@jkelvie thanks for the reply! I really appreciate it.

btburton42 avatar Jun 10 '21 16:06 btburton42