-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elements with display of side and page are not showing #1559
Comments
@dosu Any idea what might be going on? |
The issue with elements not showing when using the "side" or "page" display options is likely due to the requirement that the name of the element must be included in the content of the message for the link to be created. This is necessary for "side" and "page" displays to function correctly. Ensure that the names of the elements are mentioned in the message content. For example: await cl.Message(
content="Check out the following elements: side_text, page_text, side_image, page_image!",
elements=elements,
).send() Including the element names in the message content should allow the "side" and "page" elements to be displayed as clickable links in the Chainlit interface [1]. |
@tmtsmrsl AFAIK the bot is correct - unless the Try this: @cl.on_chat_start
async def start():
elements = [
cl.Text(name="inline_text", content="This is inline text", display="inline"),
cl.Text(name="side_text", content="This is side_image", display="side"),
cl.Text(name="page_text", content="This is page_image", display="page"),
cl.Image(url="https://raw.githubusercontent.com/yavuzceliker/sample-images/refs/heads/main/images/image-1.jpg", name="inline_image", display="inline"),
cl.Image(url="https://raw.githubusercontent.com/yavuzceliker/sample-images/refs/heads/main/images/image-2.jpg", name="side_image", display="side"),
cl.Image(url="https://raw.githubusercontent.com/yavuzceliker/sample-images/refs/heads/main/images/image-3.jpg", name="page_image", display="page")
]
await cl.Message(
content="Check out the following elements!",
elements=elements,
).send() |
Yep this is correct! |
This should be mentioned in the docs. It is not clear. A single sentence added here: https://docs.chainlit.io/api-reference/elements/text#param-display would be amazing! |
Describe the bug
Elements only show when using display of "inline". When using display of "side" or "page", elements do not show.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All
Text
andImage
elements should show up in the frontend. Currently only the inlineText
andImage
elements show up.Screenshots
Desktop (please complete the following information):
Dependency
The text was updated successfully, but these errors were encountered: