The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community[patch]: Skip nested directories when using S3DirectoryLoader (#17829)
Théo LEBRUNcf94091cd0fc
diff --git a/libs/community/langchain_community/document_loaders/s3_directory.py b/libs/community/langchain_community/document_loaders/s3_directory.pyindex 9885418ec8..24d4afab62 100644--- a/libs/community/langchain_community/document_loaders/s3_directory.py+++ b/libs/community/langchain_community/document_loaders/s3_directory.py@@ -120,6 +120,9 @@ class S3DirectoryLoader(BaseLoader):bucket = s3.Bucket(self.bucket)docs = []for obj in bucket.objects.filter(Prefix=self.prefix):+ # Skip directories+ if obj.size == 0 and obj.key.endswith("/"):+ continueloader = S3FileLoader(self.bucket,obj.key,