alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 736 forks source link

Multi-turn SMAPI interactions not possible #669

Closed garejon closed 3 years ago

garejon commented 3 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Expected Behavior

Multi-turn for SMAPI SDK: Currently a request to an Alexa skill can be simulated, but it is not possible to simulate two requests that are part of the same skill usage. For example, say I am listening to a some music, and want to say 'next' to go to the next song, SMAPI will act as if 'next' is being said as part of a different session. As if you've closed the skill, and then said 'ask [skill name] for next' or just 'next'.

Current Behavior

Each request sent to the skill via SMAPI acts as if the skill has been closed and is being reopened, instead of a continuous session, where the token sent to the Alexa skill would be preserved between calls.

Possible Solution

Steps to Reproduce (for bugs)

This is in reference to using the following class and its functions: const smapiClient = new Alexa.StandardSmapiClientBuilder() smapiClient.simulateSkillV2() smapiClient.getSkillSimulationV2()

Context

Without this capability, comprehensive end-to-end testing is not possible.

Your Environment

Node.js and NPM Info

ShenChen93 commented 3 years ago

Hi @garejon

Thanks for posting this issue. If you are using the smapiClient.simulateSkillV2(), it should be able to keep the session open. Our VSCode extension also use this api to achieve the skill simulator feature and it support multi-turn dialog. This is the smapi api behind the simulateSkillV2 function: ref. As it mentioned, developer could keep the session open by setting session.mode = 'DEFAULT'.

Thus, when you use the simulateSkillV2 function, could you please try to set the session property such as here, and see if the issue still exist ?

Thanks, Shen

leotorres-16 commented 3 years ago

Hi @ShenChen-Amazon,

I am working on the same project with @garejon I can confirm we are using the DEFAULT session mode, however our skill relies heavily on the Audio Player, could this be the reason why we can't do multi turn interactions ? We are trying to tests a simple play -> pause -> resume scenario and when we try to pause or go next for example with the simulator, the session is gone and the commands are not recognised.

Thanks a lot for your quick response.

ShenChen93 commented 3 years ago

@leotorres-16 @garejon ,

Thanks for the confirmation. I reached out to service team asking if this API support audioPlayer use case, the answer is unfortunately this simulate api right now doesn't support this use case. When the simulate api is invoked, it will auto register device for testing the skill. However, the auto registered device so far doesn't have certain capabilities like player/timer/alarms. Thus, you may need to use a real Alexa device for testing the skill for now.

Sorry for the inconvenience. I think it's a really good feature request to the service side. Would be great if you guys could log this feature request at Alexa Forums and vote for it. I will close the issue on SDK side, please feel free to reopen if you have any questions :)

Thanks, Shen