Skip to content

Demo

sample_paper_path

sample_paper_path() -> Path

Absolute path to the bundled sample PDF.

Returns the same path on every call. Works for both editable installs (resolves to examples/data/sample.pdf) and wheel installs (resolves to the in-package _data/sample.pdf).

Source code in src/verifiable_rag/demo.py
def sample_paper_path() -> Path:
    """Absolute path to the bundled sample PDF.

    Returns the same path on every call. Works for both editable installs
    (resolves to ``examples/data/sample.pdf``) and wheel installs (resolves
    to the in-package ``_data/sample.pdf``).
    """
    return _resource("sample.pdf")

sample_paper_text

sample_paper_text() -> str

The raw text content of the bundled sample, for non-PDF flows.

Source code in src/verifiable_rag/demo.py
def sample_paper_text() -> str:
    """The raw text content of the bundled sample, for non-PDF flows."""
    return _resource("sample.txt").read_text()

load_sample_document

load_sample_document() -> 'Document'

Return the pre-parsed :class:Document for the bundled sample.

Skips the parse step entirely — first-run cost drops from ~5 sec (PyMuPDF parse) to ~50 ms (JSON load). Useful for testing chunker/embedder/generator changes without re-paying parse cost.

Source code in src/verifiable_rag/demo.py
def load_sample_document() -> "Document":
    """Return the pre-parsed :class:`Document` for the bundled sample.

    Skips the parse step entirely — first-run cost drops from ~5 sec
    (PyMuPDF parse) to ~50 ms (JSON load). Useful for testing
    chunker/embedder/generator changes without re-paying parse cost.
    """
    from verifiable_rag.parsers._serde import load_document

    return load_document(_resource("sample.parsed.json"))