Class DashScopeDocumentCloudReader

java.lang.Object
com.alibaba.cloud.ai.dashscope.rag.DashScopeDocumentCloudReader
All Implemented Interfaces:
Supplier<List<org.springframework.ai.document.Document>>, org.springframework.ai.document.DocumentReader

public class DashScopeDocumentCloudReader extends Object implements org.springframework.ai.document.DocumentReader
Since:
2024/7/22 14:40 百炼云端文档解析,主要是走当前数据中心逻辑
Author:
nuocheng.lxm
  • Constructor Details

    • DashScopeDocumentCloudReader

      public DashScopeDocumentCloudReader(String filePath, DashScopeApi dashScopeApi, DashScopeDocumentCloudReaderOptions options)
      Constructor with default config
      Parameters:
      filePath - file path to read
      dashScopeApi - DashScope API client
      options - API options
    • DashScopeDocumentCloudReader

      public DashScopeDocumentCloudReader(String filePath, DashScopeApi dashScopeApi, DashScopeDocumentCloudReaderOptions readerConfig, DashScopeDocumentCloudReaderConfig clientConfig)
      Constructor
      Parameters:
      filePath - file path
      dashScopeApi - DashScope API client
      readerConfig - reader configuration (can be null, default config will be used)
      clientConfig - client configuration (can be null, default config will be used)
      Throws:
      IllegalArgumentException - when file does not exist or is not readable
  • Method Details

    • get

      public List<org.springframework.ai.document.Document> get()
      Reads and parses the document

      Important: This method never returns null

      • On success: Returns a list containing the parsed document
      • On failure: Throws DashScopeException or its subclasses
      Specified by:
      get in interface Supplier<List<org.springframework.ai.document.Document>>
      Returns:
      non-null list of documents
      Throws:
      DashScopeException - when document processing fails