Class GoogleCloudStorageDocumentLoader

java.lang.Object
dev.langchain4j.data.document.loader.gcs.GoogleCloudStorageDocumentLoader

public class GoogleCloudStorageDocumentLoader extends Object
Google Cloud Storage Document Loader to load documents from Google Cloud Storage buckets.
  • Method Details

    • loadDocument

      public Document loadDocument(String bucket, String objectName, 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<Document> loadDocuments(String bucket, String globPattern, DocumentParser parser)
      Load a list of documents from the specified bucket, filtered with a glob pattern.
      Parameters:
      bucket - the bucket to load files from
      globPattern - filter only files matching the glob pattern, see https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-object-glob
      parser - the parser to use to parse the document
      Returns:
      A list of documents from the bucket that match the glob pattern.
    • loadDocuments

      public List<Document> loadDocuments(String bucket, 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