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

Send image / plot #6

Closed
hadley opened this issue Aug 30, 2024 · 1 comment · Fixed by #37
Closed

Send image / plot #6

hadley opened this issue Aug 30, 2024 · 1 comment · Fixed by #37

Comments

@hadley
Copy link
Member

hadley commented Aug 30, 2024

https://platform.openai.com/docs/guides/vision

list(
  list(
    type = "text",
    text = "What’s in this image?"
  ),
  list(
    type = "image_url",
    image_url = list(
      url = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
    )
  )
)

list(
  list(
    type = "text",
    text = "What’s in this image?"
  ),
  list(
    type = "image_url",
    image_url = list(
      url = paste0("data:image/jpeg;base64,", base64_image)
    )
  )
)

Can include multiple images.

@hadley
Copy link
Member Author

hadley commented Sep 5, 2024

For low res mode, we expect a 512px x 512px image. For high res mode, the short side of the image should be less than 768px and the long side should be less than 2,000px.

Can use recordPlot(), replayPlot() and grDevices::dev.cur() to capture the current plot as a png.

hadley added a commit that referenced this issue Sep 23, 2024
And include an example using it to generate some alt-text.

Fixes #6
@hadley hadley closed this as completed in b3dedb3 Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant