mirror of
https://github.com/docling-project/docling-langchain.git
synced 2026-05-17 13:10:51 +00:00
main
Docling LangChain integration
A Docling integration for LangChain.
Installation
Simply install langchain-docling from your package manager, e.g. pip:
pip install langchain-docling
Development setup
To develop for Docling LangChain, you need Python 3.10 through 3.14 and uv. You can then install from your local clone's root directory:
uv sync
Usage
Basic usage
Basic usage of DoclingLoader looks as follows:
from langchain_docling import DoclingLoader
FILE_PATH = ["https://arxiv.org/pdf/2408.09869"] # Docling Technical Report
loader = DoclingLoader(file_path=FILE_PATH)
docs = loader.load()
Advanced usage
When initializing a DoclingLoader, you can use 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
Docs and examples
For more details and usage examples, check out this page.
Languages
Python
100%