Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
Use `python-docx` to extract docx files (#2654)
Bowen Liangb16354577134
diff --git a/api/core/rag/extractor/word_extractor.py b/api/core/rag/extractor/word_extractor.pyindex 8e2cd14be77..a41c727f35d 100644--- a/api/core/rag/extractor/word_extractor.py+++ b/api/core/rag/extractor/word_extractor.py@@ -10,7 +10,7 @@ from core.rag.models.document import Documentclass WordExtractor(BaseExtractor):- """Load pdf files.+ """Load docx files.Args:@@ -46,14 +46,16 @@ class WordExtractor(BaseExtractor):def extract(self) -> list[Document]:"""Load given path as single page."""- import docx2txt-- return [- Document(- page_content=docx2txt.process(self.file_path),- metadata={"source": self.file_path},- )- ]+ from docx import Document as docx_Document++ document = docx_Document(self.file_path)+ doc_texts = [paragraph.text for paragraph in document.paragraphs]+ content = '\n'.join(doc_texts)++ return [Document(+ page_content=content,+ metadata={"source": self.file_path},+ )]@staticmethoddef _is_valid_url(url: str) -> bool:diff --git a/api/requirements.txt b/api/requirements.txtindex 9721c3a13db..847903c4f4b 100644--- a/api/requirements.txt+++ b/api/requirements.txt@@ -32,7 +32,7 @@ celery==5.2.7redis~=4.5.4openpyxl==3.1.2chardet~=5.1.0-docx2txt==0.8+python-docx~=1.1.0pypdfium2==4.16.0resend~=0.7.0pyjwt~=2.8.0