Commit 781d34486ad060a6064c8b626038ab59bde1f892

Authored by qianbao
1 parent 17a230bb

添加向量库

src/main/java/com/xly/service/XlyErpService.java
@@ -377,11 +377,11 @@ public class XlyErpService { @@ -377,11 +377,11 @@ public class XlyErpService {
377 //查询是否走向量库 还是数据库查询 377 //查询是否走向量库 还是数据库查询
378 // isAggregation = aiAgent.routeQuery(session.getUserId(), input); 378 // isAggregation = aiAgent.routeQuery(session.getUserId(), input);
379 session.setDbCach("D"); 379 session.setDbCach("D");
380 - bHasCach = false; 380 +// bHasCach = false;
381 }else{ 381 }else{
382 isAggregation = "MYSQL".equals(cachMap.get("cachType")); 382 isAggregation = "MYSQL".equals(cachMap.get("cachType"));
383 session.setDbCach("H"); 383 session.setDbCach("H");
384 - bHasCach = true; 384 +// bHasCach = true;
385 sCleanSql = ObjectUtil.isNotEmpty(cachMap.get("sSqlContent"))?cachMap.get("sSqlContent").toString() : StrUtil.EMPTY; 385 sCleanSql = ObjectUtil.isNotEmpty(cachMap.get("sSqlContent"))?cachMap.get("sSqlContent").toString() : StrUtil.EMPTY;
386 } 386 }
387 // if(!isAggregation){ 387 // if(!isAggregation){
src/main/java/com/xly/thread/AiUserAgentQuestionThread.java
@@ -58,8 +58,8 @@ public class AiUserAgentQuestionThread implements Runnable { @@ -58,8 +58,8 @@ public class AiUserAgentQuestionThread implements Runnable {
58 String searchText = String.format("场景:%s 方法:%s 客户问题:%s", sSceneId, sMethodId, sQuestion); 58 String searchText = String.format("场景:%s 方法:%s 客户问题:%s", sSceneId, sMethodId, sQuestion);
59 // sSceneId+"_"+sMethodId +"_"+sQuestion; 59 // sSceneId+"_"+sMethodId +"_"+sQuestion;
60 // SqlValidateUtil.getsKey( sSceneId, sMethodId, SqlValidateUtil.getsQuestion(session.getSUserQuestionList())); 60 // SqlValidateUtil.getsKey( sSceneId, sMethodId, SqlValidateUtil.getsQuestion(session.getSUserQuestionList()));
61 - //存入向量库 存在SQL语句并且没有where 并且执行成功  
62 - if(!SqlWhereUtil.hasValidConditionAfterClean(sSqlContent) && ObjectUtil.isNotEmpty(sSqlContent) && bSucess){ 61 + //存入向量库 存在SQL语句并且没有where 并且执行成功 并且来源不是缓存
  62 + if(!SqlWhereUtil.hasValidConditionAfterClean(sSqlContent) && ObjectUtil.isNotEmpty(sSqlContent) && bSucess && !"H".equals(session.getDbCach())){
63 aiGlobalAgentQuestionSqlEmitterService.addAiGlobalAgentQuestionSqlEmitter(searchText,data,sQuestion,sSqlContent,cachType,"ai_global_agent_question_sql",false); 63 aiGlobalAgentQuestionSqlEmitterService.addAiGlobalAgentQuestionSqlEmitter(searchText,data,sQuestion,sSqlContent,cachType,"ai_global_agent_question_sql",false);
64 } 64 }
65 //调用数据库插入数据库 65 //调用数据库插入数据库