Class AmazonS3DocumentLoader
java.lang.Object
dev.langchain4j.data.document.loader.amazon.s3.AmazonS3DocumentLoader
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionAmazonS3DocumentLoader
(software.amazon.awssdk.services.s3.S3Client s3Client) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
loadDocument
(String bucket, String key, DocumentParser parser) Loads a single document from the specified S3 bucket based on the specified object key.loadDocuments
(String bucket, DocumentParser parser) Loads all documents from an S3 bucket.loadDocuments
(String bucket, String prefix, DocumentParser parser) Loads all documents from an S3 bucket.
-
Constructor Details
-
AmazonS3DocumentLoader
public AmazonS3DocumentLoader(software.amazon.awssdk.services.s3.S3Client s3Client)
-
-
Method Details
-
loadDocument
Loads a single document from the specified S3 bucket based on the specified object key.- Parameters:
bucket
- S3 bucket to load from.key
- The key of the S3 object which should be loaded.parser
- The parser to be used for parsing text from the object.- Returns:
- A document containing the content of the S3 object.
- Throws:
RuntimeException
- IfS3Exception
occurs.
-
loadDocuments
Loads all documents from an S3 bucket. Skips any documents that fail to load.- Parameters:
bucket
- S3 bucket to load from.parser
- The parser to be used for parsing text from the object.- Returns:
- A list of documents.
- Throws:
RuntimeException
- IfS3Exception
occurs.
-
loadDocuments
Loads all documents from an S3 bucket. Skips any documents that fail to load.- Parameters:
bucket
- S3 bucket to load from.prefix
- Only keys with the specified prefix will be loaded.parser
- The parser to be used for parsing text from the object.- Returns:
- A list of documents.
- Throws:
RuntimeException
- IfS3Exception
occurs.
-
builder
-