-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add support for PDFs in Claude and Gemini #265
base: main
Are you sure you want to change the base?
Conversation
Yes, for sure! Let me know if there's anything I can do to help. |
Great, thanks @hadley! I'll let you know when the PR is ready for review. |
This PR is helpful. I was able to use this to communicate with Claude in AWS Bedrock. If there is any additional polishing of this PR necessary, as you suggest, it would be great if you could complete this. FYI, I opened an additional PR #301 to get PDF support in AWS bedrock, and it seems that there is also an issue with |
@walkerke do you mind if I finish this off? I'd like to get it in to the next ellmer release, which I'll do early next week. |
I don't mind at all, thanks @hadley! |
@walkerke I've pulled out the compression for now since curl will compress the upload anyway, so I think we need more analysis before we implement. |
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.