From 6b78920ae175a23fac65ffdda2dac3de12c2ca94 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 16 Aug 2024 15:54:53 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=99=BA=E8=83=BD=E5=88=86=E6=9E=90?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E9=97=AE=E7=AD=94=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/bigmodel/configuration/BigModelInvokeApi.java | 5 +++++ .../hzims/bigmodel/interactive/service/IHznlmInvokeService.java | 6 ++++++ .../bigmodel/interactive/service/impl/HznlmInvokeServiceImpl.java | 6 ++++++ .../hzims/bigmodel/question/service/QuestionHandlerService.java | 7 ++++++- 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeApi.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeApi.java index 79b679e..d6365af 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeApi.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeApi.java @@ -51,4 +51,9 @@ public class BigModelInvokeApi { * 发起机组发电量智能报表分析问答 */ private String smartReportGeneratePower; + + /** + * 起数据分析问答 + */ + private String assistantAnalyseAsk; } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IHznlmInvokeService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IHznlmInvokeService.java index f1ee2e3..1833f09 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IHznlmInvokeService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IHznlmInvokeService.java @@ -51,6 +51,12 @@ public interface IHznlmInvokeService { void knowledgeAsk(QuestionDTO questionDTO); /** + * 发起数据分析问答 + * @param questionDTO + */ + void analyseAsk(QuestionDTO questionDTO); + + /** * 删除对话记录 * @param sessionId 会话ID */ diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/HznlmInvokeServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/HznlmInvokeServiceImpl.java index 0546da9..90074ba 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/HznlmInvokeServiceImpl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/HznlmInvokeServiceImpl.java @@ -105,6 +105,12 @@ public class HznlmInvokeServiceImpl implements IHznlmInvokeService { } @Override + public void analyseAsk(QuestionDTO question) { + RequestClientUtil.postCall(gglmUrl + bigModelInvokeApi.getAssistantAnalyseAsk(), JSON.toJSONString(question)); + sessionRedisManager.addSessionId(question.getChatId()); + } + + @Override public void removeSessionId(String sessionId) { this.askAbort(sessionId); // 移除内存sessionId diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/question/service/QuestionHandlerService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/question/service/QuestionHandlerService.java index 4976475..026853c 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/question/service/QuestionHandlerService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/question/service/QuestionHandlerService.java @@ -45,7 +45,12 @@ public class QuestionHandlerService { // 普通问答 if(Func.isEmpty(messageDTO.getIsSpecial()) || !messageDTO.getIsSpecial()) { if (StringUtil.isNotBlank(messageDTO.getKnowledge())) { - hznlmInvokeService.knowledgeAsk(question); + if("analyse".equals(messageDTO.getKnowledge())) { + // 如果是数据分析问答 + hznlmInvokeService.analyseAsk(question); + } else{ + hznlmInvokeService.knowledgeAsk(question); + } } else { hznlmInvokeService.ask(question); }