Skip to content
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

update custom data layer and pdf element #165

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions api-reference/elements/pdf.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ The `Pdf` class allows you to display a PDF hosted remotely or locally in the ch
content for a local PDF (or url for a remote PDF).
</ParamField>

<ParamField path="page" type="int" optional>
The default rendered page. Must be an integer greater than 0 and less than or
equal to the total number of pages in the PDF. The default value is 1.
</ParamField>

## Example

### Inline
Expand All @@ -41,7 +46,7 @@ import chainlit as cl
async def main():
# Sending a pdf with the local file path
elements = [
cl.Pdf(name="pdf1", display="inline", path="./pdf1.pdf")
cl.Pdf(name="pdf1", display="inline", path="./pdf1.pdf", page=1)
]

cl.Message(content="Look at this local pdf!", elements=elements).send()
Expand All @@ -58,7 +63,7 @@ import chainlit as cl
async def main():
# Sending a pdf with the local file path
elements = [
cl.Pdf(name="pdf1", display="side", path="./pdf1.pdf")
cl.Pdf(name="pdf1", display="side", path="./pdf1.pdf", page=1)
]
# Reminder: The name of the pdf must be in the content of the message
await cl.Message(content="Look at this local pdf1!", elements=elements).send()
Expand Down
1 change: 0 additions & 1 deletion data-persistence/custom.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ CREATE TABLE IF NOT EXISTS steps (
"type" TEXT NOT NULL,
"threadId" UUID NOT NULL,
"parentId" UUID,
"disableFeedback" BOOLEAN NOT NULL,
"streaming" BOOLEAN NOT NULL,
"waitForAnswer" BOOLEAN,
"isError" BOOLEAN,
Expand Down