类 RagFlowService
java.lang.Object
com.sh.ai.AIServiceBase
com.sh.ai.impl.ragflow.RagFlowService
- 所有已实现的接口:
AIService,RagAIService<RagFlowConfig,RagFlowQueryParam>
public class RagFlowService
extends AIServiceBase
implements RagAIService<RagFlowConfig,RagFlowQueryParam>
RagFlow服务逻辑
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明addChunk(RagFlowConfig config, String datasetId, String documentId, String content) Adds a chunk to a specified document in a specified datasetaddChunk(RagFlowConfig config, String datasetId, String documentId, String content, List<String> keywords) chat(RagFlowConfig config, Consumer<AICallbackMessage> callback) 执行chat(RagFlowConfig config, Consumer<AICallbackMessage> callback, int level) createChatAssistant(RagFlowConfig config, String chatName, List<String> datasetIds) 创建聊天助手createChatSession(RagFlowConfig config) 创建会话 https://ragflow.io/docs/dev/http_api_reference#create-session-with-chat-assistantdeleteChatAssistant(RagFlowConfig config, List<String> ids) 删除会话助手deleteChatSession(RagFlowConfig config, String... ids) 删除会话deleteChunk(RagFlowConfig config, String datasetId, String documentId, String... ids) 删除chunkdeleteDocument(RagFlowConfig config, String datasetId, String... ids) 删除文件parseDocument(RagFlowConfig config, String datasetId, String... ids) 解析文件process(String type, RagFlowConfig config, Consumer<AICallbackMessage> callback) queryChatHistory(RagFlowConfig config, RagFlowQueryParam param) 查询历史会话信息queryChunk(RagFlowConfig config, String datasetId, String documentId, RagFlowQueryParam queryParam) 查询queryDocument(RagFlowConfig config, String datasetId, RagFlowQueryParam queryParam) 查询文档retrieveChunk(RagFlowConfig config, String datasetId, String documentId, RagFlowQueryParam param) 检索数据块updateChatAssistant(RagFlowConfig config, String chatName, List<String> datasetIds) 更新会话助手updateChunk(RagFlowConfig config, String datasetId, String documentId, String chunkId, String content, List<String> keywords, boolean available) 更新chunkuploadDocument(RagFlowConfig config, String datasetId, File... files) 上传文件uploadDocumentAndParse(RagFlowConfig config, String datasetId, File... files) 上传文件并解析从类继承的方法 com.sh.ai.AIServiceBase
addEventCallback, notifyEvent
-
字段详细资料
-
log4j
protected static org.apache.logging.log4j.Logger log4j
-
-
构造器详细资料
-
RagFlowService
public RagFlowService()
-
-
方法详细资料
-
process
- 指定者:
process在接口中RagAIService<RagFlowConfig,RagFlowQueryParam>
-
chat
执行- 参数:
config-callback-
-
chat
-
createChatAssistant
public AIResponse createChatAssistant(RagFlowConfig config, String chatName, List<String> datasetIds) 创建聊天助手- 参数:
config-- 返回:
AIResponse
-
updateChatAssistant
public AIResponse updateChatAssistant(RagFlowConfig config, String chatName, List<String> datasetIds) 更新会话助手- 参数:
config-chatName-datasetIds-- 返回:
-
deleteChatAssistant
删除会话助手- 参数:
config-ids-- 返回:
AIResponse
-
createChatSession
创建会话 https://ragflow.io/docs/dev/http_api_reference#create-session-with-chat-assistant- 参数:
config-- 返回:
AIResponse
-
deleteChatSession
删除会话- 参数:
config-ids- 会话编号- 返回:
AIResponse
-
queryDocument
public AIResponse queryDocument(RagFlowConfig config, String datasetId, RagFlowQueryParam queryParam) 查询文档- 参数:
config-datasetId-queryParam-- 返回:
AIResponse
-
uploadDocument
上传文件- 参数:
config-datasetId-files-- 返回:
AIResponse
-
uploadDocumentAndParse
上传文件并解析- 参数:
config-datasetId-files-- 返回:
AIResponse
-
parseDocument
解析文件- 参数:
config-datasetId-ids-- 返回:
AIResponse
-
deleteDocument
删除文件- 参数:
config-datasetId-ids-- 返回:
AIResponse
-
addChunk
public AIResponse addChunk(RagFlowConfig config, String datasetId, String documentId, String content) Adds a chunk to a specified document in a specified dataset- 参数:
config-- 返回:
AIResponse
-
addChunk
public AIResponse addChunk(RagFlowConfig config, String datasetId, String documentId, String content, List<String> keywords) -
deleteChunk
public AIResponse deleteChunk(RagFlowConfig config, String datasetId, String documentId, String... ids) 删除chunk- 参数:
config-ids-- 返回:
AIResponse
-
updateChunk
public AIResponse updateChunk(RagFlowConfig config, String datasetId, String documentId, String chunkId, String content, List<String> keywords, boolean available) 更新chunk- 参数:
config-datasetId-documentId-chunkId-content-keywords-available-- 返回:
AIResponse
-
queryChunk
public AIResponse queryChunk(RagFlowConfig config, String datasetId, String documentId, RagFlowQueryParam queryParam) 查询- 参数:
config-datasetId-documentId-queryParam-- 返回:
AIResponse
-
retrieveChunk
public AIResponse retrieveChunk(RagFlowConfig config, String datasetId, String documentId, RagFlowQueryParam param) 检索数据块- 参数:
config-datasetId-documentId-- 返回:
AIResponse
-
queryChatHistory
查询历史会话信息- 指定者:
queryChatHistory在接口中RagAIService<RagFlowConfig,RagFlowQueryParam> - 参数:
config-param-- 返回:
AIResponse
-