Hello! I am trying to get the progressive response to work for my skill, but I'm having issues with the timing. I have three questions for Alexa to prompt the user with, and after the user provides a response for the third question, I want Alexa to say "Please wait..." and then emit another handler which sends off a POST request that takes roughly 4 seconds to return.
Unfortunately with my implementation, Alexa only speaks the progressive response only immediately before she speaks to prompt that the POST has returned. Is there anyway to ensure she says "Please wait..." before she sends off the POST request and then says "Done!"?
Here is the implementation of my progressive response, let me know if you guys have any ideas. Thanks!
const requestId = this.event.request.requestId; const token = this.event.context.System.apiAccessToken; const endpoint = this.event.context.System.apiEndpoint; const ds = new Alexa.services.DirectiveService(); const directive = new Alexa.directives.VoicePlayerSpeakDirective(requestId, "Please wait..."); const progressiveResponse = ds.enqueue(directive, endpoint, token) .catch((err) => { // catch API errors so skill processing can continue console.log('Error in progressive response: ' + JSON.stringify(err)); }); Promise.all([progressiveResponse]) .then(() => { this.emit('OtherHandler'); });
Edit: Okay, it turns out that my timing issue only occurs when testing on the Alexa Simulator, otherwise my Echo devices will respond right away. Issue solved!