Attributes

id
str

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

label
str

The label of the input widget.

initial
str

The initial value of the input widget.

placeholder
str

The placeholder value of the input widget.

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 TextInput


@cl.on_chat_start
async def start():
    settings = await cl.ChatSettings(
        [
            TextInput(id="AgentName", label="Agent Name", initial="AI"),
        ]
    ).send()
    value = settings["AgentName"]