The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Update word_document.py | Fixed metadata["source"] for web paths (#27220)
Ankan Mahapatra905f43377b92
diff --git a/libs/community/langchain_community/document_loaders/word_document.py b/libs/community/langchain_community/document_loaders/word_document.pyindex c7c50575cc..bd2c4ae8f5 100644--- a/libs/community/langchain_community/document_loaders/word_document.py+++ b/libs/community/langchain_community/document_loaders/word_document.py@@ -24,6 +24,7 @@ class Docx2txtLoader(BaseLoader, ABC):def __init__(self, file_path: Union[str, Path]):"""Initialize with file path."""self.file_path = str(file_path)+ self.original_file_path = self.file_pathif "~" in self.file_path:self.file_path = os.path.expanduser(self.file_path)@@ -55,7 +56,7 @@ class Docx2txtLoader(BaseLoader, ABC):return [Document(page_content=docx2txt.process(self.file_path),- metadata={"source": self.file_path},+ metadata={"source": self.original_file_path},)]