Class GoogleCloudStorageDocumentLoader
java.lang.Object
dev.langchain4j.data.document.loader.gcs.GoogleCloudStorageDocumentLoader
Google Cloud Storage Document Loader to load documents from Google Cloud Storage buckets.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
loadDocument
(String bucket, String objectName, DocumentParser parser) Loads a single document from the specified Google Cloud Storage bucket based on the specified object key.loadDocuments
(String bucket, DocumentParser parser) Loads all documents from an GCS bucket.loadDocuments
(String bucket, String globPattern, DocumentParser parser) Load a list of documents from the specified bucket, filtered with a glob pattern.
-
Method Details
-
loadDocument
Loads a single document from the specified Google Cloud Storage bucket based on the specified object key.- Parameters:
bucket
- GCS bucket to load from.objectName
- The key of the GCS 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 GCS object.
-
loadDocuments
Load a list of documents from the specified bucket, filtered with a glob pattern.- Parameters:
bucket
- the bucket to load files fromglobPattern
- filter only files matching the glob pattern, see https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-object-globparser
- the parser to use to parse the document- Returns:
- A list of documents from the bucket that match the glob pattern.
-
loadDocuments
Loads all documents from an GCS bucket.- Parameters:
bucket
- the bucket to load from.parser
- The parser to be used for parsing text from the object.- Returns:
- A list of documents.
-
builder
-