Buckets:

download
raw
988 Bytes
import os
import chainlit as cl
# Get the directory where the current script is located
current_directory = os.path.dirname(os.path.abspath(__file__))
# Construct the absolute path to the image and pdf files
cat_image_path = os.path.join(current_directory, "cat.jpeg")
pdf_path = os.path.join(current_directory, "dummy.pdf")
@cl.on_chat_start
async def start():
elements = [
cl.Image(path=cat_image_path, name="image1"),
cl.Pdf(path=pdf_path, name="pdf1"),
cl.Text(content="Here is a side text document", name="text1"),
cl.Text(content="Here is a page text document", name="text2"),
]
await cl.ElementSidebar.set_elements(elements)
await cl.ElementSidebar.set_title("Test title")
@cl.on_message
async def message(msg: cl.Message):
await cl.ElementSidebar.set_elements([cl.Text(content="Text changed!")])
await cl.ElementSidebar.set_title("Title changed!")
await cl.sleep(2)
await cl.ElementSidebar.set_elements([])

Xet Storage Details

Size:
988 Bytes
·
Xet hash:
42a909454fe759882360f072ad0e3969c5a7b76e18f6dd1d46dfa35712d65cfe

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.