Commit 781d34486ad060a6064c8b626038ab59bde1f892
1 parent
17a230bb
添加向量库
Showing
2 changed files
with
4 additions
and
4 deletions
src/main/java/com/xly/service/XlyErpService.java
| ... | ... | @@ -377,11 +377,11 @@ public class XlyErpService { |
| 377 | 377 | //查询是否走向量库 还是数据库查询 |
| 378 | 378 | // isAggregation = aiAgent.routeQuery(session.getUserId(), input); |
| 379 | 379 | session.setDbCach("D"); |
| 380 | - bHasCach = false; | |
| 380 | +// bHasCach = false; | |
| 381 | 381 | }else{ |
| 382 | 382 | isAggregation = "MYSQL".equals(cachMap.get("cachType")); |
| 383 | 383 | session.setDbCach("H"); |
| 384 | - bHasCach = true; | |
| 384 | +// bHasCach = true; | |
| 385 | 385 | sCleanSql = ObjectUtil.isNotEmpty(cachMap.get("sSqlContent"))?cachMap.get("sSqlContent").toString() : StrUtil.EMPTY; |
| 386 | 386 | } |
| 387 | 387 | // if(!isAggregation){ | ... | ... |
src/main/java/com/xly/thread/AiUserAgentQuestionThread.java
| ... | ... | @@ -58,8 +58,8 @@ public class AiUserAgentQuestionThread implements Runnable { |
| 58 | 58 | String searchText = String.format("场景:%s 方法:%s 客户问题:%s", sSceneId, sMethodId, sQuestion); |
| 59 | 59 | // sSceneId+"_"+sMethodId +"_"+sQuestion; |
| 60 | 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 | 63 | aiGlobalAgentQuestionSqlEmitterService.addAiGlobalAgentQuestionSqlEmitter(searchText,data,sQuestion,sSqlContent,cachType,"ai_global_agent_question_sql",false); |
| 64 | 64 | } |
| 65 | 65 | //调用数据库插入数据库 | ... | ... |