Basic Concepts
Message
A Message is a piece of information that is sent from the user to an assistant and vice versa. Coupled with life cycle hooks, they are the building blocks of a chat.
A message has a content, a timestamp and cannot be nested.
Example: Reply to a user message
Lets create a simple assistant that replies to a user message with a greeting.
Message API
Learn more about the Message API.
Trick: Display a loader while waiting for a response
If a task is running and the latest message content is empty, Chainlit will display a loader while the content remains empty.
Steps support loading out of the box. If you need to display a loader in a Message, chances are you should be using a Step instead!
Loading Message
Was this page helpful?