Add support for PDFs in Claude and Gemini #265
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi {ellmer} devs - thanks so much for developing this package. It's become a near-daily part of my work.
Both Claude and Gemini have native support for PDF files as content; this PR adds support for PDF files for these providers, and handles both local and remote PDFs. In my work with document processing, I've found that uploading the PDF directly gets better results than a local OCR --> text --> LLM workflow, so I'm finding this feature in my fork of {ellmer} quite useful.
Here's how it works:
The only additional dependency is {qpdf}, added to
Suggests
, which allows users to compress PDFs before uploading in the event of size limitations.Is this something that would interest you? If so I'll clean up the failing checks, and add some tests and potentially some error handling for other providers that don't yet support PDFs before flagging it as ready to merge.