From 52341c66c4d0018c7fba6116cb274b89f8fefb8f Mon Sep 17 00:00:00 2001 From: yaxin Date: Tue, 3 Dec 2024 10:01:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/common/constant/DifyConstants.java | 1 - .../police/service/impl/ChatServiceImpl.java | 12 ++++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/supervision/common/constant/DifyConstants.java b/src/main/java/com/supervision/common/constant/DifyConstants.java index 4ffeb9f..9724d34 100644 --- a/src/main/java/com/supervision/common/constant/DifyConstants.java +++ b/src/main/java/com/supervision/common/constant/DifyConstants.java @@ -24,5 +24,4 @@ public class DifyConstants { public static final String INTENT_TYPE_TEXT_CASE_EVIDENCE_GUIDE = "案件证据指引"; - } diff --git a/src/main/java/com/supervision/police/service/impl/ChatServiceImpl.java b/src/main/java/com/supervision/police/service/impl/ChatServiceImpl.java index 7492371..fae3890 100644 --- a/src/main/java/com/supervision/police/service/impl/ChatServiceImpl.java +++ b/src/main/java/com/supervision/police/service/impl/ChatServiceImpl.java @@ -117,8 +117,12 @@ public class ChatServiceImpl implements ChatService { switch (type) { case QA_TYPE_DIFY: if (modelIndices.stream().map(ModelIndex::getName).anyMatch(query::equals)) { + type = QA_TYPE_NX_LLM; + intentType = INTENT_TYPE_INDEX_RESULT; handleIndexResultQA(modelIndices, query, caseId, answerMap); } else if (INTENT_TYPE_TEXT_CASE_RESULT.equals(query) || INTENT_TYPE_CASE_RESULT.equals(intentType)) { + type = QA_TYPE_NX_LLM; + intentType = INTENT_TYPE_CASE_RESULT; ModelCase modelCase = modelCaseService.getById(caseId); if (modelCase.getTotalScore() == null) { log.info("案件【{}】尚未执行模型分析,现在开始执行", modelCase.getCaseName()); @@ -127,9 +131,13 @@ public class ChatServiceImpl implements ChatService { modelService.analyseCaseNew(analyseCaseDTO); } answerMap = JSON.parseObject(JSON.toJSONString(modelService.caseScoreDetail(caseId)), Map.class); - } else if (INTENT_TYPE_CASE_OVERVIEW.equals(query) || INTENT_TYPE_CASE_OVERVIEW.equals(intentType)) { + } else if (INTENT_TYPE_TEXT_CASE_OVERVIEW.equals(query) || INTENT_TYPE_CASE_OVERVIEW.equals(intentType)) { + type = QA_TYPE_NX_LLM; + intentType = INTENT_TYPE_CASE_OVERVIEW; answerMap.put("answerText", modelCaseService.getById(caseId).getCaseDetail()); - } else if (INTENT_TYPE_CASE_EVIDENCE_GUIDE.equals(query) || INTENT_TYPE_CASE_EVIDENCE_GUIDE.equals(intentType)) { + } else if (INTENT_TYPE_TEXT_CASE_EVIDENCE_GUIDE.equals(query) || INTENT_TYPE_CASE_EVIDENCE_GUIDE.equals(intentType)) { + type = QA_TYPE_NX_LLM; + intentType = INTENT_TYPE_CASE_EVIDENCE_GUIDE; answerMap.put("guideDesc", modelService.caseScoreDetail(caseId).getGuideDesc()); } else { ModelCase modelCase = modelCaseService.getById(caseId);