ractogateway.rag.readers.registry
FileReaderRegistry — auto-detects the right reader for any file extension.
- class ractogateway.rag.readers.registry.FileReaderRegistry(readers=None)[source]
Bases:
objectRegistry that maps file extensions to
BaseReaderinstances.By default all built-in readers are registered. You can add custom readers with
register().Example:
registry = FileReaderRegistry() doc = registry.read("report.pdf")
- register(reader)[source]
Add reader to the registry for all its supported extensions.
- Return type:
- get_reader(path)[source]
Return the reader for path’s extension.
- Raises:
ValueError – If no reader supports the file’s extension.
- Return type: