View source: R/content-image.R
content_image_url | R Documentation |
These functions are used to prepare image URLs and files for input to the
chatbot. The content_image_url()
function is used to provide a URL to an
image, while content_image_file()
is used to provide the image data itself.
content_image_url(url, detail = c("auto", "low", "high"))
content_image_file(path, content_type = "auto", resize = "low")
content_image_plot(width = 768, height = 768)
url |
The URL of the image to include in the chat input. Can be a
|
detail |
The detail setting
for this image. Can be |
path |
The path to the image file to include in the chat input. Valid
file extensions are |
content_type |
The content type of the image (e.g. |
resize |
If You can also pass a custom string to resize the image to a specific size,
e.g. All values other than |
width , height |
Width and height in pixels. |
An input object suitable for including in the ...
parameter of
the chat()
, stream()
, chat_async()
, or stream_async()
methods.
chat <- chat_openai(echo = TRUE)
chat$chat(
"What do you see in these images?",
content_image_url("https://www.r-project.org/Rlogo.png"),
content_image_file(system.file("httr2.png", package = "ellmer"))
)
plot(waiting ~ eruptions, data = faithful)
chat <- chat_openai(echo = TRUE)
chat$chat(
"Describe this plot in one paragraph, as suitable for inclusion in
alt-text. You should briefly describe the plot type, the axes, and
2-5 major visual patterns.",
content_image_plot()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.