Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.chainlit.io/llms.txt

Use this file to discover all available pages before exploring further.

Decorator to react to messages coming from the UI. The decorated function is called every time a new message is received.

Parameters

message
cl.Message
The message coming from the UI.

Usage

import chainlit as cl

@cl.on_message
def main(message: cl.Message):
  content = message.content
  # do something