Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
6.24k stars 799 forks source link

Return clickable link in response Message #216

Closed vumichien closed 12 months ago

vumichien commented 12 months ago

Can I include a link file in the response message? I have saved the data path and page in the metadata, and I would like the user to be able to access the file quickly by clicking on the link. Can I reference the link in a format similar to Markdown for the user to easily click on it?

willydouhard commented 12 months ago

You can use markdown like so:

import chainlit as cl

@cl.on_message
async def main(message: str):
    content = "here is a link [google.com](https://google.com)"
    await cl.Message(content=content).send()

You can also use elements if you want the links to open elements in a side bar or new page.

vumichien commented 12 months ago

Thank you @willydouhard