Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for directive Dialog.Delegate #372

Open
Nicky31 opened this issue Oct 8, 2018 · 2 comments
Open

Patch for directive Dialog.Delegate #372

Nicky31 opened this issue Oct 8, 2018 · 2 comments

Comments

@Nicky31
Copy link

Nicky31 commented Oct 8, 2018

Hi,

After a few hours trying to figure out why alexa raised an error on my directive response instead of speeching configured prompt for missing slots, It turned out that alexa-app includes outputSpeech object in its reply, which seems exactly to be the problem. Given a Dialog.Delegate directive telling to rely only on model dialogs, Alexa expect not to have outputSpeech attribute besides this directive.

So I patched this with an ugly delete before replying, but I guess fixing your response construction might benefits to some other users :-)

The monkey patch, within any alexa-app handler getting response object:

			if (response.response.response.outputSpeech) {
				delete response.response.response.outputSpeech
			}
@Nicky31 Nicky31 changed the title Patch for directive Dialog.Delegate not working Patch for directive Dialog.Delegate Oct 8, 2018
@lazerwalker
Copy link
Collaborator

lazerwalker commented Oct 30, 2018

Hi! Thanks for this!

If I'm understanding you correctly, the correct fix for this is to apply that (making sure there's no outputSpeech in the underlying Alexa response) in the situation where there's a Dialog.Delegate directive to rely only on model dialogs.

If that's the case, it sounds to me like that's a great case to add this into the codebase itself, with the appropriate logic to make sure we only remove outputSpeech in that specific scenario.

Any interest in contributing a pull request?

@Nicky31
Copy link
Author

Nicky31 commented Nov 10, 2018

Hi,
After taking a look at your codebase to fix this point, I've figured out outputSpeech is not initialized on the construction of responses but it is in clear() method.
Any reason for this ? Why not simply delete this attribute ? Looks a bit weird. I guess outputSpeech deletion (instead of rewrite) in clear() would do the trick, but i'm wondering if it would break anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants