b7f52be4c9
CI / Run CI (push) Has been cancelled
CI / check-backend (push) Has been cancelled
CI / check-frontend (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / e2e-tests (push) Has been cancelled
Copilot Setup Steps / copilot-setup-steps (push) Has been cancelled
22 lines
616 B
Python
22 lines
616 B
Python
import os
|
|
|
|
import chainlit as cl
|
|
|
|
current_directory = os.path.dirname(os.path.abspath(__file__))
|
|
pdf_path = os.path.join(current_directory, "dummy.pdf")
|
|
|
|
|
|
@cl.on_chat_start
|
|
async def start():
|
|
# Inline PDF: renders as a clickable thumbnail
|
|
await cl.Message(
|
|
content="Inline PDF below.",
|
|
elements=[cl.Pdf(path=pdf_path, name="inline_pdf", display="inline")],
|
|
).send()
|
|
|
|
# Side PDF: should auto-open the side panel
|
|
await cl.Message(
|
|
content="Side PDF - panel should open automatically.",
|
|
elements=[cl.Pdf(path=pdf_path, name="side_pdf", display="side")],
|
|
).send()
|