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

Dialog Management doesn't work. #128

Closed kevinwu closed 6 years ago

kevinwu commented 7 years ago

Hi, when I put this.emit(':confirmIntent') into my code, my intent always returns null and when I speak to the Echo device, it says the response is invalid.

Is there maybe some other way I can directly return the Dialog Delegate Directive, something I have to include, some way you can fix the potential bug?

Thanks

knowlsie commented 7 years ago

Have you included speechOutput and repromptSpeech parameters for the confirmation? (e.g. this.emit(':confirmIntent', "Can you confirm you wanted x?", "Please could you confirm if you wanted x?"). It doesn't use the dialog models from Alexa Skill Builder if you use :confirmIntent, you have to specify the confirmation dialog yourself. Use this.emit(':delegate') if you want to use the dialog models from Alexa Skill Builder.

ghost commented 7 years ago

Here's the related documentation to ':confirmIntent' https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/dialog-interface-reference#details-3

kevinwu commented 7 years ago

@knowlsie I still get the message "There was a problem with the requested skills response". Unfortunately, I get the same error when I write this.emit(':delegate') for slots that I have created in the interface builder.

knowlsie commented 7 years ago

Ah, right. Unfortunately, I need to sleep right now, but if this is still an issue I'll look into it soon-ish. Is it possible to give more context/code, or maybe find a better error message?

Also, I do totally see how the README is a touch confusing on this one. Particularly:

You can use this.emit(':confirmIntent') or this.emit(':confirmIntentWithCard') to send confirm intent directive response.

That makes it look a little like you don't need to include parameters, and that style isn't really done anywhere else in the docs (except the equivalent for elicitSlot, and annoyingly some documentation that I wrote on this.response (👎 to me)).

kevinwu commented 7 years ago

Ah ok, I would prefer to not write code on here, but rather via email, so if you don't mind, it would be great if you could send me your email address and I will contact you tomorrow morning. Thanks and have a good night.

HowJr76 commented 7 years ago

I am having the same problem. Were you ever able to resolve this. It seems that the "this" object does not have any of the dialog directives when I do a console.log of "this". I have tried building and rebuilding my dialog interface in beta to no avail. I have required slots even a dummy intent with a required slot and the dialog directives just won't work. Please help.

HowJr76 commented 7 years ago

I realize why mine wasn't working. The Node.JS sdk that is packaged as a template doesn't seem to support any of the dialog interface, all other parts of the Alex SDK seem to work. Once I uploaded the current Alexa SDK for Node.js, everything started working, but the downside is that I can no longer used the inline editor to modify my code.

knowlsie commented 7 years ago

Yeah, sorry for the slow reply. That's a known issue, it's here: https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/114

kcrosley-leisurelabs commented 7 years ago

Would be great if someone with the power to do so could correct this... (the issue described in #114 - wrong version of Alexa SDK bundled in).

benz2012 commented 7 years ago

Does anyone know why dialog directives would need to be returned explicitly when others do not?

hoegertn commented 7 years ago

You do not need to return the directive itself, but you should place a "return" on the next line to end the processing of the handler. The emit is just put on the event loop and not executed at the same moment.

tianrenz commented 6 years ago

Issue resolved. Please feel free to reopen this issue if further questions. Thanks