S3Loader
Convenience factory for loading documents from AWS S3.
S3Loader combines S3DocumentSource with SourceBackedLoader to provide a simple API for S3 document ingestion.
Usage:
// Basic usage with default credentials
val loader = S3Loader("my-bucket", prefix = "docs/")
rag.sync(loader)
// With explicit credentials
val loader = S3Loader.withCredentials(
bucket = "my-bucket",
accessKeyId = "...",
secretAccessKey = "..."
)
// For LocalStack testing
val loader = S3Loader.forLocalStack("test-bucket")
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
S3Loader.type
Members list
Value members
Concrete methods
Create a DocumentLoader for S3.
Create a DocumentLoader for S3.
Uses the AWS default credential chain for authentication.
Value parameters
- bucket
-
S3 bucket name
- credentials
-
Optional credentials provider
- extensions
-
File extensions to include (empty = default set)
- metadata
-
Additional metadata to attach to all documents
- prefix
-
Key prefix to filter objects (e.g., "docs/")
- region
-
AWS region (default: us-east-1)
Attributes
Create a DocumentLoader for LocalStack testing.
Create a DocumentLoader for LocalStack testing.
Value parameters
- bucket
-
Bucket name (must be created in LocalStack first)
- port
-
LocalStack port (default: 4566)
- prefix
-
Key prefix to filter objects
Attributes
Get the underlying S3DocumentSource for advanced configuration.
Get the underlying S3DocumentSource for advanced configuration.
Use this when you need to configure S3-specific options like endpoint override, then wrap with SourceBackedLoader.
Value parameters
- bucket
-
S3 bucket name
- prefix
-
Key prefix
Attributes
Create a DocumentLoader for S3 with explicit credentials.
Create a DocumentLoader for S3 with explicit credentials.
Value parameters
- accessKeyId
-
AWS access key ID
- bucket
-
S3 bucket name
- prefix
-
Key prefix to filter objects
- region
-
AWS region (default: us-east-1)
- secretAccessKey
-
AWS secret access key
Attributes
Create a DocumentLoader with a custom extractor.
Create a DocumentLoader with a custom extractor.
Value parameters
- bucket
-
S3 bucket name
- extractor
-
Custom document extractor
- prefix
-
Key prefix