MediaExtractor
Media-aware extraction: reads a file and returns it as text, an image, audio samples or video frames, discriminated by the MIME type Tika sniffs from its content.
Kept separate from DocumentExtractor on purpose. Document loading wants text and metadata from anything text-bearing; multimodal embedding wants the decoded media itself. The two share only the initial Tika sniff, and the audio and video cases overlap llm4s-speech and llm4s-image rather than RAG, so this may not stay here.
The sniff stays here because it needs Tika; the vocabulary it resolves to (org.llm4s.media.MediaCategory) lives in llm4s-media, so the modules that would consume audio and video branches can name the same categories without inheriting Tika.
Attributes
- Source
- MediaExtractor.scala
- Graph
-
- Supertypes
- Self type
-
MediaExtractor.type
Members list
Type members
Classlikes
Extracted audio content as mono PCM samples with a sample rate.
Extracted audio content as mono PCM samples with a sample rate.
Attributes
- Source
- MediaExtractor.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Extractedclass Objecttrait Matchableclass AnyShow all
Extracted content from a file, discriminated by media type.
Extracted content from a file, discriminated by media type.
Attributes
- Source
- MediaExtractor.scala
- Supertypes
- Known subtypes
Extracted image content.
Extracted image content.
Attributes
- Source
- MediaExtractor.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Extractedclass Objecttrait Matchableclass AnyShow all
Extracted text content (from PDF, DOCX, plain text, etc.).
Extracted text content (from PDF, DOCX, plain text, etc.).
Attributes
- Source
- MediaExtractor.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Extractedclass Objecttrait Matchableclass AnyShow all
Extracted video content as a sequence of frames at a given frame rate.
Extracted video content as a sequence of frames at a given frame rate.
Attributes
- Source
- MediaExtractor.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Extractedclass Objecttrait Matchableclass AnyShow all
Value members
Concrete methods
Extract content from a file, returning the Extracted variant matching its media type.
Extract content from a file, returning the Extracted variant matching its media type.
Value parameters
- inputPath
-
path to the file (surrounding whitespace and quotes are stripped)
Attributes
- Returns
-
the extracted content, or a org.llm4s.error.ProcessingError
- Source
- MediaExtractor.scala
