I have created a chatbot using Dialogflow CX the chatbot gives the answers to the users questions from our site data store
I have added our site data into the vertex ai data store and connected it to the Dialogflow cx. I am using a pdf file as a data store and its file has a list of products my issue is below
I created the list of products with their actual website URL, but whenever I make a query through the chatbot it gives me the result of products from the data store but it doesn't format the list like I created the pdf with lists and each products link in response it only gives me the plain text instead of link and list
How can I format the data store response in the chatbot? I tried to added HTML tags and markdown syntax in my pdf but it doesn't works for me.
Also, which is the best data format approach to store product information which gives us the proper formatted output from the data store? I tried with pdf and docs but didn't get successed
Hi @onprint,
Welcome to Google Cloud Community!
To format responses in your Dialogflow CX chatbot using data from Vertex AI, here are some strategies and tips to consider:
const response = products.map(product => `<a href="${product.url}">${product.name}</a>`).join('<br/>');
Example Approach:
1. Store Product Data in JSON:
[
{
"name": "Product 1",
"url": "http://example.com/product1"
},
{
"name": "Product 2",
"url": "http://example.com/product2"
}
]
2. In your Fulfillment Logic:
const formattedResponse = products.map(product => `${product.name}: <a href="${product.url}">${product.url}</a>`).join('<br/>');
3. Return the Response: Ensure the output is sent as part of the chatbot's response.
For more details, you can check the Dialogflow CX and Vertex AI documentation.
I hope the above information is helpful.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |