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

Is it possible to provide a PDF in a prompt? #308

Open
barapa opened this issue Aug 19, 2024 · 1 comment
Open

Is it possible to provide a PDF in a prompt? #308

barapa opened this issue Aug 19, 2024 · 1 comment

Comments

@barapa
Copy link

barapa commented Aug 19, 2024

I have tried supplying a PDF via the UserImageMessage type, but that fails with the following error from openai:

openai.BadRequestError: Error code: 400 - {'error': {'message': "You uploaded an unsupported image. Please make sure your image is below 20 MB in size and is of one the following formats: ['png', 'jpeg', 'gif', 'webp'].", 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_image_format'}}

Is there a way to do this with magentic?

@barapa barapa changed the title Is it possible to provide a PDF? Is it possible to provide a PDF in a prompt? Aug 19, 2024
@jackmpcollins
Copy link
Owner

@barapa I think this out of scope for magentic. You will have to use https://github.com/Belval/pdf2image or another library to convert from PDF to one of those supported formats.

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

No branches or pull requests

2 participants