Link to products after a Query
# 🤝help
f
I there, is there any tutorial online to demonstrate how the bot could link products enquired by the user in the chat itself?
a
Hey @fast-tiger-39527, text cards support markdown, so you can send a clickable link to users formatted like this:
[click me!](www.example.com)
f
Hey @acceptable-kangaroo-64719 thanks for the tip. But i was looking for something different. My bot is referencing a boutique website to answer questions from the customer. Say the customer asks "Do you have anything in purple?". The bot then answers with the specific clothes that are in purple. I want the bot to also link the products, not just provide the names of the products.
a
Got it! We're working on getting the knowledge agent to be better at giving links in their answer. Until then, you could do a workaround with code where you take the sources in
turn.KnowledgeAgent.citations
and use them in a message. I would write that message manually, though, and not give it to an AI task because chatGPT can sometimes mess up links.
f
Noted. Tqsm for the help
s
I was working on that. but i could not figure out how to pull the actual citation data. I was looking for something like
turn.KnowledgeAgent.citations[0].content
is there a way to acess the actual content from the citation? Because in my KB content is what is containing the URL's that im trying to share.
a
There's kind of a way to access the retrieved content, as it is stored in
event.kb.results
. However not all retrieved content is used in the final answer; there might be 15, 20 chunks retrieved but only 2 used in the answer. So you'll need to code logic to find the retrieved chunks based on the citation, and then parse their content.
2 Views