Web App
The native Chainlit UI that is available on port 8000. Should open in your default browser when you run chainlit run
.
Supported Features
Message | Streaming | Elements | Audio | Ask User | Chat History | Chat Profiles | Feedback |
---|---|---|---|---|---|---|---|
✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Preview
Window Messaging
When running the Web App inside an iframe, the server and parent window can communicate using window messages. This is useful for sending context information to the Chainlit server and updating your parent window based on the server’s response.
Add a @cl.on_window_message
decorated function to your Chainlit server to receive messages sent from the parent window.
Then, in your app/website, you can emit a window message like this:
To send a message from the server to the parent window, use cl.send_window_message
:
The parent window can listen for messages like this:
Example
Check out this example from the cookbook that uses the window messaging feature: https://github.com/Chainlit/cookbook/tree/main/window-message
Was this page helpful?