From 667d2a57fd0b31183b8f53113b54492a9a16a8b9 Mon Sep 17 00:00:00 2001 From: Junon <65576196+Junon-Gz@users.noreply.github.com> Date: Fri, 17 Jan 2025 00:09:04 +0800 Subject: [PATCH] add mode arg to OBSFileLoader.load() method (#29246) - **Description:** add mode arg to OBSFileLoader.load() method - **Issue:** #29245 - **Dependencies:** no dependencies required for this change --------- Co-authored-by: Junon_Gz --- .../langchain_community/document_loaders/obs_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/community/langchain_community/document_loaders/obs_file.py b/libs/community/langchain_community/document_loaders/obs_file.py index d6add62c33b..f96ad3cd7ec 100644 --- a/libs/community/langchain_community/document_loaders/obs_file.py +++ b/libs/community/langchain_community/document_loaders/obs_file.py @@ -92,7 +92,7 @@ class OBSFileLoader(BaseLoader): self.bucket = bucket self.key = key - def load(self) -> List[Document]: + def load(self, mode: str = "single") -> List[Document]: """Load documents.""" with tempfile.TemporaryDirectory() as temp_dir: file_path = f"{temp_dir}/{self.bucket}/{self.key}" @@ -101,5 +101,5 @@ class OBSFileLoader(BaseLoader): self.client.downloadFile( bucketName=self.bucket, objectKey=self.key, downloadFile=file_path ) - loader = UnstructuredFileLoader(file_path) + loader = UnstructuredFileLoader(file_path, mode=mode) return loader.load()