Attributes

id
str

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

label
str

The label of the input widget.

initial
int

The initial value of the input widget.

min
int

The minimum permitted slider value. Defaults to 0.

max
int

The maximum permitted slider value. Defaults to 10.

step
int

The stepping interval of the slider. Defaults to 1.

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 Slider


@cl.on_chat_start
async def start():
    settings = await cl.ChatSettings(
        [
            Slider(
                id="Temperature",
                label="OpenAI - Temperature",
                initial=1,
                min=0,
                max=2,
                step=0.1,
            ),
        ]
    ).send()
    value = settings["Temperature"]