Attributes

id
str

The identifier used to retrieve the widget value from the settings.

label
str

The label of the input widget.

values
List[str]

Labels for the select options.

items
Dict[str, str]

Labels with corresponding values for the select options.

initial_value
int

The initial value of the input widget.

initial_index
int

Index of the initial value of the input widget. Can only be used in combination with ‘values’.

tooltip
str

The tooltip text shown when hovering over the tooltip icon next to the label.

description
str

The text displayed underneath the input widget.

Usage

Code Example
import chainlit as cl
from chainlit.input_widget import Select


@cl.on_chat_start
async def start():
    settings = await cl.ChatSettings(
        [
            Select(
                id="Model",
                label="OpenAI - Model",
                values=["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4", "gpt-4-32k"],
                initial_index=0,
            )
        ]
    ).send()
    value = settings["Model"]