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

fix: add support for direct file bytes #101

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tanzimCohere
Copy link

@tanzimCohere tanzimCohere commented Mar 12, 2025

The PR introduces changes to the process_file function in the parser.py module, enhancing file processing and error handling.

  • The process_file function now accepts additional parameters, including file_id, content_type, parser_config, metadata_config, and custom_context.
  • A new function, _process_file_bytes, is introduced to handle file processing. It takes params, filename, file_bytes, and custom_context as arguments.
  • The if statement checking the file size has been moved from the process_file function to the _process_file_bytes function.
  • The files dictionary in the self.session.post method now uses file_bytes instead of doc.filebytes for the file content.

Copy link

cla-assistant bot commented Mar 12, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
Copy link

cla-assistant bot commented Mar 12, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@benrules3 benrules3 left a comment

Choose a reason for hiding this comment

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

The direction looks good here! Would just request a test case and a manual version bump to 0.19.0.

Then if you confirm this works for you, we should be good to approve

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.

2 participants