-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
core: fix ChatPromptTemplate doesn't accept PDF data as bytes #28011
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
e8bff92
to
369ee42
Compare
( | ||
"human", | ||
[ | ||
{"type": "media", "mime_type": "application/pdf", "data": pdf_data}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which chat model supports this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Efriis, I just wanted to make sure that we understood the question correctly! If you’re asking which chat models this implementation would be compatible with, it should work with all chat models because it is sending the pdf data as text. But please let me know if you were looking for something else!
> > Co-authored-by: czhu24 <[email protected]>
closing because this isn't desirable in the prompt template. in general, the right process here would be parse the pdfs using something like this, and plumb that text into your prompt this implementation would import PyPDF parsing for anyone trying to use a prompt template, which isn't mergable |
Description:
from_template()
that catches data in mime_type: {pdf_data} formatIssue: #27346
Dependencies:
chat.py > extract_pdf_text()
and encodes pdf data intext_chat.py > test_create_pdf_chat_prompt()
chat.py > extract_pdf_text()
chat.py > extract_pdf_text()
Lint and test:
Ran make format, make lint, and make test from the root of
libs\core
. All checks passed successfully.