__init__.py
834 Bytes
"""文档解析器:按扩展名分派到具体 loader,产出统一的 DocumentBlock。
下面的子模块 import 是有副作用的——每个 loader 在模块级调用 register_loader()
把自己注册进分派表,少一行就意味着那种格式的文件解析不了。
"""
from src.rag.ingestion.loaders.base import (
BaseLoader,
DocumentBlock,
get_loader,
parse_document,
register_loader,
)
# 仅为注册副作用而 import,勿删
from src.rag.ingestion.loaders import excel as _excel
from src.rag.ingestion.loaders import markdown as _markdown
from src.rag.ingestion.loaders import office as _office
from src.rag.ingestion.loaders import pdf as _pdf
from src.rag.ingestion.loaders import text as _text
__all__ = ["BaseLoader", "DocumentBlock", "get_loader", "parse_document", "register_loader"]