spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

Allow custom metadata in all document reader implementations

Open rubin0 opened this issue 1 year ago • 0 comments
trafficstars

Not all implementations of DocumentReader allow adding metadata to a document during the document loader step. Only TextReader and JsonReader allow it, using different methods.

I have added support for custom metadata in the following implementations, using the same structure as in the TextReader implementation:

  • PagePdfDocumentReader
  • ParagraphPdfDocumentReader
  • TikaDocumentReader

I have updated the tests as well. However, the ParagraphPdfDocumentReader currently only checks for a negative case because I don't have any PDF with the correct license and structure to create a positive case.

rubin0 avatar Jul 10 '24 10:07 rubin0