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 Summary
ConstructorsConstructorDescriptionDashScopeDocumentCloudReader(String filePath, DashScopeApi dashScopeApi, DashScopeDocumentCloudReaderOptions options) Constructor with default configDashScopeDocumentCloudReader(String filePath, DashScopeApi dashScopeApi, DashScopeDocumentCloudReaderOptions readerConfig, DashScopeDocumentCloudReaderConfig clientConfig) Constructor -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.document.DocumentReader
read
-
Constructor Details
-
DashScopeDocumentCloudReader
public DashScopeDocumentCloudReader(String filePath, DashScopeApi dashScopeApi, DashScopeDocumentCloudReaderOptions options) Constructor with default config- Parameters:
filePath- file path to readdashScopeApi- DashScope API clientoptions- API options
-
DashScopeDocumentCloudReader
public DashScopeDocumentCloudReader(String filePath, DashScopeApi dashScopeApi, DashScopeDocumentCloudReaderOptions readerConfig, DashScopeDocumentCloudReaderConfig clientConfig) Constructor- Parameters:
filePath- file pathdashScopeApi- DashScope API clientreaderConfig- 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
Reads and parses the documentImportant: This method never returns null
- On success: Returns a list containing the parsed document
- On failure: Throws DashScopeException or its subclasses
- Specified by:
getin interfaceSupplier<List<org.springframework.ai.document.Document>>- Returns:
- non-null list of documents
- Throws:
DashScopeException- when document processing fails
-