I'm working in Dialogflow CX and messenger and I want to send different responses based on what source I get my generative answer from. If my answer is generated from a specific page I want to send a card with the response type info together with my generative answer. From what I have understood so far it is not possible to write rich content in conditional response, in the same way as you can when you use custom payload.
What is the best way for me to solve my problem?
Hi Erica,
My suggestion would be to handle that in a webhook, where you will know who the caller is (flow/page) and set the custom payload that you want there.
Best,
Xavi
Thank you, I'm not that familiar with webhooks but I'm going to have a look at it.
this video will help you: https://www.youtube.com/watch?v=vNAVbkmW-5I&ab_channel=PeterFessel
Hi
What about for playbooks? playbook tools to send rich content to Dialogflow CX Messenger. Is that possible because I tried going through the documentation the example is not helping
You're correct that Dialogflow CX doesn't allow rich content like cards to be directly included in conditional responses in the same way as with custom payloads. However, you can solve your problem by using Custom Payloads combined with Fulfillment.
Here’s how you can approach this:
Use Fulfillment for Conditional Responses: In Dialogflow CX, you can handle different response types (e.g., text, card, etc.) in the fulfillment webhook. Your webhook can check which source the generative answer came from, and based on that, return the appropriate response (text + card).
Custom Payloads for Rich Content: You can use custom payloads in your fulfillment response to send rich content like cards. The payload can include the card details (title, description, image, etc.) along with the generative text answer.
For example:
Here’s a basic structure:
{ "fulfillment_response": { "messages": [ { "text": { "text": ["Here's the information I found for you."] } }, { "payload": { "richContent": [ [ { "type": "card", "title": "Specific Info", "subtitle": "Details about the source page", "image": { "src": { "rawUrl": "https://example.com/image.jpg" } } } ] ] } } ] } }
This allows you to send the generative response and the rich content (card) based on the source. You’ll need to make sure that your webhook dynamically adjusts the payload based on the context or source of the answer.
This method provides flexibility and ensures that you can send a tailored response that includes rich content along with your text.
Thanks for the above @kevinmitnik_45
but what I am looking for a way using playbook(conversation based) tools to send rich content to Dialogflow CX Messenger integration instead of using dialogflow(flow based)
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |