Skip to content

Commit 69e62a3

Browse files
committed
change import style in element examples
1 parent 7c61231 commit 69e62a3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

api-reference/elements/local-image.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ The `LocalImage` class is designed to create and handle local image elements to
3232
### Usage with message scope
3333

3434
```python Code Example
35-
from chainlit import LocalImage
35+
import chainlit as cl
3636

3737
# Sending an image with the local file path
3838
elements = [
39-
LocalImage(name="image1", display="inline", path="./image1.jpg")
39+
cl.LocalImage(name="image1", display="inline", path="./image1.jpg")
4040
]
4141

4242
cl.Message(content="Look at this local image!", elements=elements).send()
@@ -45,15 +45,15 @@ cl.Message(content="Look at this local image!", elements=elements).send()
4545
### Usage without scope
4646

4747
```python Code Example
48-
from chainlit import LocalImage
48+
import chainlit as cl
4949

5050
# Sending an image with the local file path
51-
image1 = LocalImage(name="image1", display="inline", path="./image1.jpg")
51+
image1 = cl.LocalImage(name="image1", display="inline", path="./image1.jpg")
5252
image1.send()
5353

5454
# Sending an image with file content as bytes
5555
with open("./image2.jpg", "rb") as f:
5656
image_content = f.read()
57-
image2 = LocalImage(name="image2", display="inline", content=image_content)
57+
image2 = cl.LocalImage(name="image2", display="inline", content=image_content)
5858
image2.send()
5959
```

api-reference/elements/pdf.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ The `PDF` class allows you to display a pdf hosted remotely or locally in the ch
3131
### Usage with message scope
3232

3333
```python Code Example
34-
from chainlit import PDF
34+
import chainlit as cl
3535

3636
# Sending a pdf with the local file path
3737
elements = [
38-
PDF(name="pdf1", display="inline", path="./pdf1.pdf")
38+
cl.PDF(name="pdf1", display="inline", path="./pdf1.pdf")
3939
]
4040

4141
cl.Message(content="Look at this local pdf!", elements=elements).send()
@@ -44,15 +44,15 @@ cl.Message(content="Look at this local pdf!", elements=elements).send()
4444
### Usage without scope
4545

4646
```python Code Example
47-
from chainlit import PDF
47+
import chainlit as cl
4848

4949
# Sending a pdf with the remote url
50-
pdf1 = PDF(name="pdf1", display="inline", url="https://example.com/example.pdf")
50+
pdf1 = cl.PDF(name="pdf1", display="inline", url="https://example.com/example.pdf")
5151
pdf1.send()
5252

5353
# Sending a pdf with file content as bytes
5454
with open("./pdf2.pdf", "rb") as f:
5555
pdf_content = f.read()
56-
pdf2 = PDF(name="pdf2", display="inline", content=pdf_content)
56+
pdf2 = cl.PDF(name="pdf2", display="inline", content=pdf_content)
5757
pdf2.send()
5858
```

0 commit comments

Comments
 (0)