Recently, I got this question on YouTube:
i have added rich responses code in my dialogflow fulfillment. but when i am testing with dialogflow messanger integration, it is not diaplaying any images, cards on dialogflow messanger. Can you tell me what version i need to use?
Based on the question, I suppose this person is using the Dialogflow fulfillment library.
I recommend people avoid using the fulfillment libraries for Dialogflow unless they are building a voice bot. Since this question is about Dialogflow Messenger, it is recommended that you don’t use the fulfillment library.
There are three reasons why I recommend you avoid the fulfillment library:
a) it makes things unnecessarily opaque
b) the fulfillment library is rarely up to date with the latest features
c) if something in the fulfillment library doesn’t work, you will end up doing MUCH MORE work than if you had just avoided it in the first place
So what do I recommend instead?
I suggest simply understanding the JSON format of the response and constructing it in your code. This way, it is much easier to maintain over time.
The steps are fairly straight forward:
1 First type out the appropriate JSON inside your Custom Payload block (i.e. first hard code the response)
2 Trigger the intent in the Dialogflow Messenger
3 From the History module, get the JSON which was sent as a response
4 Paste this JSON into your webhook response generator code (and make suitable updates so it is dynamic)
In my Dialogflow Messenger Quickstart course (paid), I provide an example of how to do this using Python.
Using this approach will give you 100% control over your own code and will actually speed up your overall bot development speed if you are using Python. Even if you are not using Python, the code is actually very simple and it should be straight forward to translate it to NodeJS.
- Actions Builder vs Dialogflow CX
- 5+ ways Dialogflow CX is better than Dialogflow ES
- How to bulk upload training phrases for Dialogflow Messenger
- Dialogflow CX vs ES: First look
- How to send rich responses from webhook to Dialogflow Messenger
- Dialogflow CX now generally available
- Understanding Dialogflow CX Parameters
- Dialogflow CX Missing Features
- Dialogflow Messenger integration for CX: First look
- Dialogflow Conversation Analytics Tips