File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff 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
3838elements = [
39- LocalImage(name = " image1" , display = " inline" , path = " ./image1.jpg" )
39+ cl. LocalImage(name = " image1" , display = " inline" , path = " ./image1.jpg" )
4040]
4141
4242cl.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" )
5252image1.send()
5353
5454# Sending an image with file content as bytes
5555with 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```
Original file line number Diff line number Diff 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
3737elements = [
38- PDF(name = " pdf1" , display = " inline" , path = " ./pdf1.pdf" )
38+ cl. PDF(name = " pdf1" , display = " inline" , path = " ./pdf1.pdf" )
3939]
4040
4141cl.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" )
5151pdf1.send()
5252
5353# Sending a pdf with file content as bytes
5454with 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```
You can’t perform that action at this time.
0 commit comments