Chainlit / chainlit

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

How to resume `Plotly` element in a thread? #1095

Open blakechi opened 3 months ago

blakechi commented 3 months ago

Hello,

I wrote a simple datalayer that stores elements in JSON on disk and in list_threads method, I read the elements and assign them to threads under elements field. For Plotly, I store the json string of the figure in the content field.

When I resumed the thread, simple elements like Pdf and Text could be resumed correctly, but for Plotly, the UI only reserved a blank div container without the plot.

Because the figure can't be serialized to JSON, I tried removing the element and sending it again in on_chat_resume hook with the same id and forId, but still encountered the serialization issue.

Does anyone know how to resume a Plotly plot?

Valdanitooooo commented 2 weeks ago

I have the same issue storing data in PostgreSQL.