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); }