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
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()dev.langchain4j.data.document.DocumentloadDocument(String bucket, String objectName, dev.langchain4j.data.document.DocumentParser parser) Loads a single document from the specified Google Cloud Storage bucket based on the specified object key.List<dev.langchain4j.data.document.Document> loadDocuments(String bucket, dev.langchain4j.data.document.DocumentParser parser) Loads all documents from an GCS bucket.List<dev.langchain4j.data.document.Document> loadDocuments(String bucket, String globPattern, dev.langchain4j.data.document.DocumentParser parser) Load a list of documents from the specified bucket, filtered with a glob pattern.
-
Method Details
-
loadDocument
public dev.langchain4j.data.document.Document loadDocument(String bucket, String objectName, dev.langchain4j.data.document.DocumentParser parser) 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
public List<dev.langchain4j.data.document.Document> loadDocuments(String bucket, String globPattern, dev.langchain4j.data.document.DocumentParser parser) Load a list of documents from the specified bucket, filtered with a glob pattern. Skips any documents that fail to load.- 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
public List<dev.langchain4j.data.document.Document> loadDocuments(String bucket, dev.langchain4j.data.document.DocumentParser parser) 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
-