TikaDocumentExtractor
The DocumentExtractor implementation, backed by Apache Tika, PDFBox and POI.
Reads, with no further dependency:
- PDF documents via Apache PDFBox
- Word documents (.docx) via Apache POI
- Text files, in the charset their byte-order mark or Content-Type names, else UTF-8
- HTML (as its text), XML and JSON
llm4s-rag depends on tika-core alone, which detects formats but parses none (#3013). Any other format, such as .doc, .rtf, .pptx, .xlsx, .odt or .epub, is read only when the application adds the Apache Tika parser module for it to its own build (org.apache.tika:tika-parser-microsoft-module for the Microsoft formats, tika-parser-miscoffice-module for OpenDocument and EPUB, or tika-parsers-standard-package for all of them, at the tika-core version llm4s-rag uses): Tika finds a parser module on the classpath. Without one, such a format is a ProcessingError whose operation is unsupported-format and whose message names the format and the module to add. Text over 50 million characters is an error (extracted-text-too-long), never silently truncated.
This object is the single Tika/PDFBox/POI entry point in the library. It replaces both org.llm4s.extract.TikaDocumentExtractor and org.llm4s.llmconnect.extractors.UniversalExtractor, which were independent implementations of the same job.
Attributes
- Source
- TikaDocumentExtractor.scala
- Graph
-
- Supertypes
- Self type
