TheDocumentation Index
Fetch the complete documentation index at: https://docs.chainlit.io/llms.txt
Use this file to discover all available pages before exploring further.
ChatSettings class is designed to create and send a dynamic form to the UI. This form can be updated by the user.
Attributes
The fields of the form. Mutually exclusive with
tabs — use one or the other.Group inputs into named tabs. Each
Tab has an id, a label, and its own list of inputs.
Mutually exclusive with the top-level inputs list.Methods
send()
Sends the settings form to the UI and commits the current values into the session (session.chat_settings). Use this when initializing settings or when you want to update both the UI and the committed session state.
refresh()
Pushes the settings form to the UI without updating the committed session settings. This is useful inside @cl.on_settings_edit when you want to dynamically update the available widgets (e.g., show/hide fields based on a selection) without treating the edit as a confirmed change.
Since version 2.11.0.
Usage
@ and / commands. Using @, you can trigger the chat settings Select input, and using /, you can choose the selected setting’s input values.
Single Select option Type

Multi Select option Type

Dynamic Widget Refresh
Userefresh() inside @cl.on_settings_edit to update the form dynamically as the user edits, without committing changes to the session. The committed session settings only change when the user confirms (triggers @cl.on_settings_update).
Since version 2.11.0.
Tabs
UseTab to group settings into named tabs when you have many inputs across distinct categories.
Since version 2.9.1.