ragflow跟代理聊天
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user