PDF Loader for JVM based on Apache pdf-box #74
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes several changes focused on refactoring the BaseLoader interface and adding support for PDF document loading.
Refactoring of BaseLoader interface: The loadAndSplit method in the BaseLoader interface has been refactored. The method now includes a default implementation that splits the documents after loading them. This change simplifies the implementation of the BaseLoader interface in its subclasses, removing the need to override the loadAndSplit method in each subclass.
Removal of loadAndSplit method in ScrapeURLTextLoader and TextLoader: Following the refactoring of the BaseLoader interface, the loadAndSplit method has been removed from the ScrapeURLTextLoader and TextLoader classes as it is no longer necessary.
Addition of PDF support: A new module xef-pdf has been added to the project. This module includes the PDFLoader class, which implements the BaseLoader interface for loading PDF documents. The pdf function is provided to create a ParameterlessAgent that loads and splits the content of a PDF file based on Apache PDF box.
Example of PDF document loading: An example of using the new PDF document loading functionality has been added to the example module. The example loads a PDF document and uses an AI model to answer questions about the content of the document.
Addition of a PDF document to the example module resources: A PDF document has been added to the resources of the example module for use in the new example of PDF document loading.
The pdf for the example is this one https://xebia.com/wp-content/uploads/2022/01/Document-Post-Interview-Filip-Chyla-small.pdf, where Filip talks about why he likes working at Xebia.