The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community[minor]: S3FileLoader to use expose mode and post_processors arguments of unstructured loader (#19270)
preak956ea3e57a637f
diff --git a/libs/community/langchain_community/document_loaders/s3_file.py b/libs/community/langchain_community/document_loaders/s3_file.pyindex eaca0761f2..59b3164993 100644--- a/libs/community/langchain_community/document_loaders/s3_file.py+++ b/libs/community/langchain_community/document_loaders/s3_file.py@@ -2,7 +2,7 @@ from __future__ import annotationsimport osimport tempfile-from typing import TYPE_CHECKING, List, Optional, Union+from typing import TYPE_CHECKING, Callable, List, Optional, Unionfrom langchain_community.document_loaders.unstructured import UnstructuredBaseLoader@@ -27,6 +27,8 @@ class S3FileLoader(UnstructuredBaseLoader):aws_secret_access_key: Optional[str] = None,aws_session_token: Optional[str] = None,boto_config: Optional[botocore.client.Config] = None,+ mode: str = "single",+ post_processors: Optional[List[Callable]] = None,):"""Initialize with bucket and key name.@@ -82,8 +84,12 @@ class S3FileLoader(UnstructuredBaseLoader):object is set on the session, the config object used when creatingthe client will be the result of calling ``merge()`` on thedefault config with the config provided to this call.+ :param mode: Mode in which to read the file. Valid options are: single,+ paged and elements+ :param post_processors: Post processing functions to be applied to+ extracted elements"""- super().__init__()+ super().__init__(mode, post_processors)self.bucket = bucketself.key = keyself.region_name = region_name