-
Notifications
You must be signed in to change notification settings - Fork 280
Multiple agent.add fails with integrations #177
Comments
What is the use case for having multiple custom payloads? |
Within an async function, we could first send out a ... or is that kind of behaviour not supported? |
Also, breaking down a larger message into 3 different messages within a handler. |
I'm facing same issue. Don't know why this library does not support multiple payload. |
Any news on this case? DialogFlow UI does handle 2 Facebook payloads correctly. It's only this library that's complaining. As a use case, I use multiple payloads to send some "intro text" + "attachment" (generic template cards, for example) + "suggestion chips", in the same reply. If I use the generic rich response from the library, some unwanted text shows in Facebook Messenger right before the suggestion chips (the text shows "Choose an item"). If I build the Facebook response myself using a Payload, that text is not shown, which looks much nicer. The problem is that Facebook won't allow "intro text" + "attachment" + "suggestion chips" in the same message object. Suggestion chips can accompany an intro text, or an attachment. But text + attachment can't be together. So 2 Payloads need to be sent: 1 for the text, and 1 for the attachment + chips. |
#173 makes this possible. Multiple payloads are supported using agent.add(new Payload(agent.FACEBOOK, facebookPayload1, {sendAsMessage:true}));
agent.add(new Payload(agent.FACEBOOK, facebookPayload2, {sendAsMessage:true})); EDIT: This is not actually possible, as pointed out by @maganap below, however mixing text responses and one payload is possible with #173 . |
@jdpowell1 Thanks! I noticed about #173 and downloaded latest commit ( agent.add( new Text('Hello there') );
agent.add( new Payload(agent.FACEBOOK, facebookPayload1, {sendAsMessage:true}) ); which solves my issue (Facebook: Even though I don't need 2 Payloads now, I still get agent.add(new Payload(agent.FACEBOOK, facebookPayload1, {sendAsMessage:true}));
agent.add(new Payload(agent.FACEBOOK, facebookPayload2, {sendAsMessage:true})); |
Hello guys, I'm facing the same issue here. My use case is that I want to display to the user a list of items and I want to ask them their feedback via a thumbs up or thumbs down. I need two payloads here:
However as @maganap said, I can't add two payloads and I get the same error: Do you plan to add a feature where we could add two payloads ? PS: I know that with the latest commit ( Thanks! |
I'm having trouble sending me messages to Hangouts Chat. All messages that are in agent.add (message) do not work in chat, but work on other platforms. Is there any configuration for Chat? I looked for examples but found none. |
Since multiple custom payloads are allowed on Dialogflow UI. I see no reason to limit only for single payload here. dialogflow-fulfillment-nodejs/src/dialogflow-fulfillment.js Lines 269 to 284 in aaade16
As line 277 only Is there any other problems or concerns? because this issue was tagged as |
I might have time to work on this and open a PR. Any advice or pointers for someone new to the project? |
FYI, I made it works with java, it produces the following json :
|
Have you created your own service or are you using the Java library for Dialogflow? |
I've used this as a response to create a PR #325 trying to fix this issue. However, I've only tested it on Facebook Messager. |
Hi folks! 👋
I want to send multiple custom payloads through one intent handler.
Appears like multiple
agent.add
s with custom payloads (e.g usingagent.FACEBOOK
) currently fail.From the Cloud Function log:
Error: Payload response for FACEBOOK already defined. at WebhookClient.addResponse_
I could look into it and open a PR, but I noticed #173, #35 and #146 which appear related.
What do you suggest I try?
The text was updated successfully, but these errors were encountered: