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

feat: megaparse in registry + chunk_size #3470

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AmineDiro
Copy link
Collaborator

Description

  • register megaparse only if env variables are set
  • chunk_size on single pdfs should be set

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 12, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 12, 2024
Copy link
Collaborator

@chloedia chloedia left a comment

Choose a reason for hiding this comment

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

Nice PR, would like to know more on some changes

Copy link
Collaborator

Choose a reason for hiding this comment

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

why ? If we have a small text better not to chunk no ?
I wanted to change it to:

if len(response["result"]) > self.splitter_config.chunk_size:
            docs = self.text_splitter.split_documents([document])
            for doc in docs:
                doc.metadata = {"chunk_size": len(self.enc.encode(doc.page_content))}
            return docs
        return [document]

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, I agree with @chloedia

priority=None,
)
# TODO(@aminediro @chloedia): Megaparse should register itself
if getenv("MEGAPARSE_URL") and getenv("MEGAPARSE_API_KEY"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tha aws url for megaparse is defaulted in MegaParseSDK, so you just need to check API and even then, what if we want to run megaparse API locally -> we force api key?

@dosubot dosubot bot removed the lgtm This PR has been approved by a maintainer label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants