-
Notifications
You must be signed in to change notification settings - Fork 39
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
Cannot add custom payload for integrations #13
Comments
The Actions on Google library is focused on building and responding to Actions, and isn't intended to support responses to other platforms. Dialogflow does not appear to have a fulfillment library for Java. While you may be able to use the WebhookResponse object from this library, some additional work may need to be employed to get the response directly instead of using additional built-in methods. |
this is a problem for any case where there is the need to create or modify anything in the dialogflow payload. for example, if you want to modify a parameter in the query result and send the modified version back. The problem is in the following snippets:
mainly the last line. googlePayload is always set here no matter what. which begs the question: why is it even a nullable type?
as you can see here the webhookResponse.payload just gets totally overwritten. it seems like it should either:
if that is acceptable i'm happy to make a PR. This is causing us pain atm and i would love to fix. it also doesnt quite make sense why it is built this way from my perspective. please consider re-opening and taking a PR! |
If you send a PR I'll take a look. As stated, this library is not meant for developing webhooks beyond AoG, but if the change is not too expansive and well tested I think it'll be fine to merge. |
Hi,
I tried to use this lib to handle fulfillment requests and respond with custom payload for my Dialogflow integrations. ex: Slack integration
I tried to use the WebhookResponse object and it's setPayload method to achieve this.
However when the ResponseBuilder.build method is called and the ActionResponse is converted into JSON the payload that I previously set is replaced with a google one. 'payload': {'google': { ... }}
Is there a way to construct responses for integrations with this lib?
I tried even the simplest use case when I add only a text with the ResponseBuilder but the message won't show up in Slack.
The text was updated successfully, but these errors were encountered: