Commit d537bf8e authored by alex yao's avatar alex yao

feat:门户页对话添加Agent对话选择

parent 2569edab
......@@ -4,6 +4,7 @@ import cn.com.poc.agent_application.aggregate.AgentApplicationService;
import cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants;
import cn.com.poc.agent_application.entity.*;
import cn.com.poc.agent_application.service.BizAgentApplicationDialoguesRecordService;
import cn.com.poc.agent_application.service.BizAgentApplicationInfoService;
import cn.com.poc.agent_application.service.BizAgentApplicationPublishService;
import cn.com.poc.agent_application.utils.AgentApplicationTools;
import cn.com.poc.ai_dialogues.entity.BizAiDialoguesEntity;
......@@ -62,7 +63,8 @@ public class PortalServiceImpl implements PortalService {
private KnowledgeService knowledgeService;
@Resource
private BizAgentApplicationPublishService bizAgentApplicationPublishService;
private BizAgentApplicationInfoService bizAgentApplicationInfoService;
@Resource
private BizAgentApplicationDialoguesRecordService bizAgentApplicationDialoguesRecordService;
......@@ -70,16 +72,16 @@ public class PortalServiceImpl implements PortalService {
@Override
public void call(PortalDialoguesCallEntity callEntity, Long userId) throws Exception {
String agentId = fmxParamConfigService.getParam(FMX_PARAM_AGENT_ID_CODE);
String agentId = StringUtils.isBlank(callEntity.getAgentId()) ? fmxParamConfigService.getParam(FMX_PARAM_AGENT_ID_CODE) : callEntity.getAgentId();
if (StringUtils.isBlank(agentId)) {
logger.error("获取门户首页对话agentId失败");
throw new BusinessException("对话异常");
}
// 获取Agent基本信息
BizAgentApplicationPublishEntity infoEntity = bizAgentApplicationPublishService.getByAgentId(agentId);
BizAgentApplicationInfoEntity infoEntity = bizAgentApplicationInfoService.getByAgentId(agentId);
if (infoEntity == null) {
logger.error("获取门户首页对话agent信息失败");
logger.error("获取对话agent信息失败");
throw new BusinessException("对话异常");
}
......
......@@ -13,6 +13,7 @@ public class PortalConvert {
PortalDialoguesCallEntity portalDialoguesCallEntity = new PortalDialoguesCallEntity();
portalDialoguesCallEntity.setDialoguesId(dto.getDialoguesId());
portalDialoguesCallEntity.setInput(dto.getInput());
portalDialoguesCallEntity.setAgentId(dto.getAgentId());
portalDialoguesCallEntity.setEnableSearchEngine(dto.getEnableSearchEngine());
portalDialoguesCallEntity.setEnableDeepThinking(dto.getEnableDeepThinking());
portalDialoguesCallEntity.setFileUrl(dto.getFileUrl());
......
......@@ -14,6 +14,12 @@ public class PortalDialoguesDto {
*/
private String dialoguesId;
/**
* agentId
*/
private String agentId;
/**
* 问题
*/
......@@ -39,6 +45,14 @@ public class PortalDialoguesDto {
*/
private Integer[] knowledgeIds;
public String getAgentId() {
return agentId;
}
public void setAgentId(String agentId) {
this.agentId = agentId;
}
public String getInput() {
return input;
}
......
......@@ -13,6 +13,11 @@ public class PortalDialoguesCallEntity {
*/
private String dialoguesId;
/**
* AgentId
*/
private String agentId;
/**
* 问题
*/
......@@ -38,6 +43,14 @@ public class PortalDialoguesCallEntity {
*/
private Integer[] knowledgeIds;
public String getAgentId() {
return agentId;
}
public void setAgentId(String agentId) {
this.agentId = agentId;
}
public String getDialoguesId() {
return dialoguesId;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment