Chainlit / chainlit

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

Rendering a Web Page Using Chainlit Callback Methods #632

Open Deepansharora27 opened 8 months ago

Deepansharora27 commented 8 months ago

Hi, I see that there are various Elements that can be rendered on the UI (https://docs.chainlit.io/api-reference/elements/text)

I was trying to make use of the File Element in order to render a Basic HTML Page but what happens is that instead of rendering I am just able to Download the File as an element. Is there a way where I could Render an Entire Web Page for instance to serve/render a static asset ?

willydouhard commented 8 months ago

You can use unsafe_allow_html to directly put html if your message content (can also be an iframe).

Deepansharora27 commented 8 months ago

Instead of displaying it as a message, I want to change the state of the UI and enable/disable certain elements ? Would that be possible ?

willydouhard commented 8 months ago

I don't think so