hadley / elmer

Call LLM APIs from R
https://hadley.github.io/elmer/
Other
65 stars 13 forks source link

Error with `chat_claude()` when giving local data URI to `elmer::content_image_url()` #110

Open cpsievert opened 4 days ago

cpsievert commented 4 days ago

Currently elmer::content_image_url() always returns ContentImageRemote(), even though (at least from the docs) inline images are also supported here. As a result, you currently get an error with Claude about it not supporting remote images. I think it would make sense for elmer::content_image_url() to return ContentImageInline() instead when a URI gets passed?

hadley commented 4 days ago

You mean it would read the remote url and insert the raw data into a ContentImageInline()?

cpsievert commented 4 days ago

No I mean like content_image_url("data:image/png;base64,...") should return a ContentImageInline()

hadley commented 4 days ago

Oh hmmmm, I forgot that you could supply data urls here. Your suggestion makes more sense now 😄