Browse Source

add: 智能分析智能体问答接口

zhongwei
haungxing 3 months ago
parent
commit
6b78920ae1
  1. 5
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeApi.java
  2. 6
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IHznlmInvokeService.java
  3. 6
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/HznlmInvokeServiceImpl.java
  4. 7
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/question/service/QuestionHandlerService.java

5
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 smartReportGeneratePower;
/**
* 起数据分析问答
*/
private String assistantAnalyseAsk;
} }

6
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); void knowledgeAsk(QuestionDTO questionDTO);
/** /**
* 发起数据分析问答
* @param questionDTO
*/
void analyseAsk(QuestionDTO questionDTO);
/**
* 删除对话记录 * 删除对话记录
* @param sessionId 会话ID * @param sessionId 会话ID
*/ */

6
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 @Override
public void analyseAsk(QuestionDTO question) {
RequestClientUtil.postCall(gglmUrl + bigModelInvokeApi.getAssistantAnalyseAsk(), JSON.toJSONString(question));
sessionRedisManager.addSessionId(question.getChatId());
}
@Override
public void removeSessionId(String sessionId) { public void removeSessionId(String sessionId) {
this.askAbort(sessionId); this.askAbort(sessionId);
// 移除内存sessionId // 移除内存sessionId

7
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(Func.isEmpty(messageDTO.getIsSpecial()) || !messageDTO.getIsSpecial()) {
if (StringUtil.isNotBlank(messageDTO.getKnowledge())) { if (StringUtil.isNotBlank(messageDTO.getKnowledge())) {
hznlmInvokeService.knowledgeAsk(question); if("analyse".equals(messageDTO.getKnowledge())) {
// 如果是数据分析问答
hznlmInvokeService.analyseAsk(question);
} else{
hznlmInvokeService.knowledgeAsk(question);
}
} else { } else {
hznlmInvokeService.ask(question); hznlmInvokeService.ask(question);
} }

Loading…
Cancel
Save