Skip to content

The agent engineering platform.

add mode arg to OBSFileLoader.load() method (#29246)

Junon667d2a57fd0b
diff --git a/libs/community/langchain_community/document_loaders/obs_file.py b/libs/community/langchain_community/document_loaders/obs_file.py
index d6add62c33..f96ad3cd7e 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()