Files
chainlit--chainlit/cypress/e2e/pdf_viewer/main.py
T
wehub-resource-sync 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
chore: import upstream snapshot with attribution
2026-07-13 12:48:47 +08:00

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()