You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have a custom chatbot frontend (based on Chainlit frontend). I would like to display content like mermaid.js, Panda dataframes etc.
Describe the solution you'd like
Ability to define an custom Element and register with Chainlit. It is up to custom frontends what to do with it.
Describe alternatives you've considered
Component element can potentially be used but it will be unweildy.
Additional context
The text was updated successfully, but these errors were encountered:
Regarding the feature request, you can define a custom Element and register it with Chainlit to display content like mermaid.js and Panda dataframes. The Component class allows you to send custom components to the UI. Here is an example:
You can then use these custom elements to send mermaid.js diagrams and Panda dataframes to the UI:
importchainlitascl@cl.on_chat_startasyncdefstart():
mermaid_diagram=Mermaid(props={"code": "graph TD; A-->B;"})
dataframe=DataFrame(props={"data": {"col1": [1, 2], "col2": [3, 4]}})
awaitcl.Message(
content="Here is a mermaid diagram and a dataframe!",
elements=[mermaid_diagram, dataframe],
).send()
There are three display options for rendering an element: side, page, and inline. Choose the appropriate display option based on your requirements [3][4].
Is your feature request related to a problem? Please describe.
I have a custom chatbot frontend (based on Chainlit frontend). I would like to display content like mermaid.js, Panda dataframes etc.
Describe the solution you'd like
Ability to define an custom Element and register with Chainlit. It is up to custom frontends what to do with it.
Describe alternatives you've considered
Component element can potentially be used but it will be unweildy.
Additional context
The text was updated successfully, but these errors were encountered: