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

add parsed PDF content to expand_text_attachments #143

Merged
merged 4 commits into from
Jan 29, 2025

Conversation

JohntheLi
Copy link
Collaborator

if allow_attachments=True, and expand_text_attachments=True,pdf files contents will automatically be added to the conversation by inserting ProtocolMessages with their contents. This already happens for text and html files, as well as image files (if enable_image_comprehension=True).

Also, add unit test

if allow_attachments=True, and expand_text_attachments=True, text, html, and pdf files contents will automatically be added to the conversation by inserting ProtocolMessages with their contents. if enable_image_comprehension=True, image descriptions will also be added to the conversation.

Also, add unit test
@JohntheLi JohntheLi requested a review from a team as a code owner January 29, 2025 03:49
@@ -583,7 +583,10 @@ def insert_attachment_messages(self, query_request: QueryRequest) -> QueryReques
text_attachment_messages.append(
ProtocolMessage(role="user", content=url_attachment_content)
)
elif "text" in attachment.content_type:
elif (
"text" in attachment.content_type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be attachment.content_type.startswith("text/")? I realize it's not new to this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helloo Jelle. Yes I think so

@JohntheLi JohntheLi merged commit e7b723c into poe-platform:main Jan 29, 2025
14 checks passed
@JohntheLi JohntheLi deleted the feature/pdf_parsing branch January 29, 2025 22:12
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

Successfully merging this pull request may close these issues.

3 participants