DoclingLoader document loader.
概述
集成详情
加载器特性
The presented
DoclingLoader component enables you to:
- use various document types in your LLM applications with ease and speed, and
- leverage Docling’s rich format for advanced, document-native grounding.
DoclingLoader supports two different export modes:
ExportType.DOC_CHUNKS(default): if you want to have each input document chunked and to then capture each individual chunk as a separate LangChain Document downstream, orExportType.MARKDOWN: if you want to capture each input document as a separate LangChain Document
EXPORT_TYPE; depending on the
value set, the example pipeline is then set up accordingly.
设置
For best conversion speed, use GPU acceleration whenever available; e.g. if running on Colab, use a GPU-enabled runtime.
初始化
Basic initialization looks as follows:DoclingLoader has the following parameters:
file_path: source as single str (URL or local file) or iterable thereofconverter(optional): any specific Docling converter instance to useconvert_kwargs(optional): any specific kwargs for conversion executionexport_type(optional): export mode to use:ExportType.DOC_CHUNKS(default) orExportType.MARKDOWNmd_export_kwargs(optional): any specific Markdown export kwargs (for Markdown mode)chunker(optional): any specific Docling chunker instance to use (for doc-chunk mode)meta_extractor(optional): any specific metadata extractor to use
加载
Note: a message saying "Token indices sequence length is longer than the specified maximum sequence length..." can be ignored in this case — more details in this docling-core GitHub issue.
Inspecting some sample docs:
惰性加载
Documents can also be loaded in a lazy fashion:End-to-end example
- The following example pipeline uses HuggingFace’s Inference API; for increased LLM quota, token can be provided via env var
HF_TOKEN.- Dependencies for this pipeline can be installed as shown below (
--no-warn-conflictsmeant for Colab’s pre-populated Python env; feel free to remove for stricter usage):
Ingestion
RAG
API 参考
通过 MCP 将这些文档连接到 Claude、VSCode 等工具以获取实时答案。

