Merge pull request #1345 from zhudongwork/docx-dev

Optimize: Use python-docx for better parsing.
This commit is contained in:
Daniel.y
2025-04-11 15:30:03 +08:00
committed by GitHub

View File

@@ -499,6 +499,9 @@ async def pipeline_enqueue_file(rag: LightRAG, file_path: Path) -> bool:
content = result.document.export_to_markdown()
else:
if not pm.is_installed("python-docx"): # type: ignore
try:
pm.install("python-docx")
except Exception:
pm.install("docx")
from docx import Document # type: ignore
from io import BytesIO