You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No easy way to reuse an uploaded file from its id聽#417
That works for Anthropic and Google, but fails for OpenAI because its file_get() sets mime_type=None and ContentUploaded.mime_type is a required str, so you have to guess the type from meta.filename yourself. ellmer is resolving this by having chat$file_get() return a ContentUploaded with the metadata on extra and guessing OpenAI's MIME type from the filename (tidyverse/ellmer#1116, tidyverse/ellmer#1119). Might be worth aligning, either by doing the same or by adding a FileMetadata.to_content() helper.
Hi, I鈥檇 like to work on this issue. I can look into adding a convenient way to convert FileMetadata into ContentUploaded, including handling the missing MIME type for OpenAI files, and add tests to cover the different providers. Please let me know if I can take this up.
Activity
AbarnaaSree commentedon Sep 9, 2026
Hi, I鈥檇 like to work on this issue. I can look into adding a convenient way to convert
FileMetadataintoContentUploaded, including handling the missing MIME type for OpenAI files, and add tests to cover the different providers. Please let me know if I can take this up.feat(files): add FileMetadata.to_content() for reusing uploads by id