Join the discord for live updates: https://discord.gg/AzyvDHWARx
Updating Chainlit
Begin the migration by updating Chainlit to the latest version:What changes?
The Chainlit UI (including the copilot) has been completely re-written with Shadcn/Tailwind. This brings several advantages:- The codebase is simpler and more contribution friendly.
- It enabled the new custom element feature.
- The theme customisation is more powerful.
How to migrate?
1. Regenerate the config file
The following fields have been removed from theconfig.toml file:
- follow_symlink: Chainlit no longer uses
StaticFilesto serve files. - font_family, custom_font, [UI.theme]: Theme customisation now uses a separate file.
- audio: Chainlit audio streaming has been rework to match the realtime APIs.
.chainlit/config.toml file and restart your application.
2. Cookie Auth & Cross Origins
All of the authentication mechanisms now use cookie auth instead of directly using a JWT. This change makes Chainlit more secure. This does not require any change in your app code. However, this implies that Chainlit is now more picky about cross origins (for instance when using a copilot on a website). If you need to consume a Chainlit app on a different origin, make sure you allow it in theconfig.toml under allow_origins.
3. Actions
- The value field has replaced with
payloadwhich accepts a Python dict. This makes actions more useful. - The description field has been renamed
tooltip. - The field
iconhas been added. You can use any lucide icon name. - The collapsed field has been removed.
4. Copilot Widget Config
- The fontFamily field has been removed. Check the new custom theme documentation.
- the
button.stylefield has been replaced withbutton.className. You can use any tailwind class to style the widget button.