ractogateway.rag.readers.image_reader

Image reader — uses Pillow (lazy import) to extract metadata.

Images are represented as a textual description of their EXIF/metadata, plus an optional prompt to an LLM for visual description. Pixel data is not stored in the Document; use RactoFile for multimodal vision calls.

Install with: pip install ractogateway[rag-image]

class ractogateway.rag.readers.image_reader.ImageReader(include_exif=True)[source]

Bases: BaseReader

Extract metadata from image files and represent them as text Documents.

The resulting Document.content is a human-readable summary of image properties (size, mode, format, EXIF tags). Pass the image to a vision LLM separately using RactoFile for actual visual understanding.

Accepts a file path (str / Path), raw bytes, or any binary file-like object with a .read() method.

Parameters:

include_exif (bool) – Whether to extract and include EXIF metadata in the content.

property supported_extensions: frozenset[str]

Lower-case extensions (with dot) this reader handles, e.g. {".pdf"}.