Skip to main content
Text messages are the building blocks of a chatbot, but we often want to send more than just text to the user such as images, videos, and more. That is where elements come in. Each element is a piece of content that can be attached to a Message or a Step and displayed on the user interface.

Image Element

Ideal to display generated images.

PDF Element

Ideal to display RAG sources.

Custom Element

Write your own element in JSX.

More Elements

The complete list of elements you can display on the user interface.

Example

To attach an element to a message or step, we need to:
  1. Instantiate the element
  2. Attach the element to a message or step

Display Options

There are 3 display options that determine how an element is rendered:

Side

The image will not be displayed in the message. Instead, the name of the image will be displayed as clickable link. When the user clicks on the link, the image will be displayed on the side of the message.

Page

The image will not be displayed in the message. Instead, the name of the image will be displayed as clickable link. Clicking on the link will redirect to a dedicated page where the image will be displayed.

Inline

The image will be displayed below with the message regardless of whether the image name is referenced in the message content.

Control the Element Sidebar from Python

You can open/close the sidebar directly in Python. Elements attached to the sidebar will not be persisted, as this sidebar state is not the result of an interaction in the UI.