Class TencentCosDocumentLoader

java.lang.Object
dev.langchain4j.data.document.loader.tencent.cos.TencentCosDocumentLoader

public class TencentCosDocumentLoader extends Object
  • Constructor Details

    • TencentCosDocumentLoader

      public TencentCosDocumentLoader(com.qcloud.cos.COSClient s3Client)
  • Method Details

    • loadDocument

      public Document loadDocument(String bucket, String key, DocumentParser parser)
      Loads a single document from the specified COS bucket based on the specified object key.
      Parameters:
      bucket - COS bucket to load from.
      key - The key of the COS 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 COS object.
    • loadDocuments

      public List<Document> loadDocuments(String bucket, DocumentParser parser)
      Loads all documents from an COS bucket. Skips any documents that fail to load.
      Parameters:
      bucket - COS bucket to load from.
      parser - The parser to be used for parsing text from the object.
      Returns:
      A list of documents.
    • loadDocuments

      public List<Document> loadDocuments(String bucket, String prefix, DocumentParser parser)
      Loads all documents from an COS bucket. Skips any documents that fail to load.
      Parameters:
      bucket - COS 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.
    • builder

      public static TencentCosDocumentLoader.Builder builder()