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 <junon_gz@qq.com>
This commit is contained in:
Junon 2025-01-17 00:09:04 +08:00 committed by GitHub
parent c6388d736b
commit 667d2a57fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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()