rig_core/loaders/mod.rs
1//! File loading utilities for preparing local documents as model or embedding input.
2//!
3//! [`FileLoader`] provides a common interface for reading files from disk, glob
4//! matches, directories, or in-memory bytes. It can return content alone or pair
5//! content with source paths, and it can optionally skip per-file errors.
6//!
7//! `PdfFileLoader` is available with the `pdf` feature. It loads PDFs and can
8//! split extracted text by page while preserving page numbers.
9//!
10//! `EpubFileLoader` is available with the `epub` feature. It loads EPUB files
11//! and can split extracted text by chapter while preserving chapter numbers.
12
13pub mod file;
14
15pub use file::FileLoader;
16
17#[cfg(feature = "pdf")]
18#[cfg_attr(docsrs, doc(cfg(feature = "pdf")))]
19pub mod pdf;
20
21#[cfg(feature = "pdf")]
22pub use pdf::PdfFileLoader;
23
24#[cfg(feature = "epub")]
25#[cfg_attr(docsrs, doc(cfg(feature = "epub")))]
26pub mod epub;
27
28#[cfg(feature = "epub")]
29pub use epub::{EpubFileLoader, RawTextProcessor, StripXmlProcessor, TextProcessor};