ragflow跟代理聊天

This commit is contained in:
wuchunlei
2025-08-28 09:47:49 +08:00
parent e92d1ca482
commit cdeba99b8b
2 changed files with 121 additions and 0 deletions

View File

@@ -123,6 +123,28 @@ public class RagFlowApiController {
return R.ok();
}
//代理列表
@RequestMapping("/getChatAgents")
public R getChatAgents() throws Exception{
List<Map<String,Object>> list = ragFlowApiUtil.getChatAgents("");
return R.ok().put("list",list);
}
//创建代理会话
@RequestMapping("/createAgentChat")
public R createAgentChat(@RequestBody Map<String,Object> params) throws Exception{
String agentId = ragFlowApiUtil.createAgentChat(params);
return R.ok().put("id",agentId);
}
//与代理聊天流式
@RequestMapping(value = "/chatToAgentStream")
@Transactional
public R chatToAgentStream(String agentId,String sessionId,String question){
ragFlowApiUtil.chatToAgentStream(agentId,sessionId,question);
return R.ok();
}