mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
This commit is contained in:
@@ -9,6 +9,7 @@ import com.tencent.supersonic.chat.server.agent.VisualConfig;
|
|||||||
import com.tencent.supersonic.chat.server.persistence.dataobject.AgentDO;
|
import com.tencent.supersonic.chat.server.persistence.dataobject.AgentDO;
|
||||||
import com.tencent.supersonic.chat.server.persistence.dataobject.ChatMemoryDO;
|
import com.tencent.supersonic.chat.server.persistence.dataobject.ChatMemoryDO;
|
||||||
import com.tencent.supersonic.chat.server.persistence.mapper.AgentDOMapper;
|
import com.tencent.supersonic.chat.server.persistence.mapper.AgentDOMapper;
|
||||||
|
import com.tencent.supersonic.chat.server.pojo.ChatModel;
|
||||||
import com.tencent.supersonic.chat.server.service.AgentService;
|
import com.tencent.supersonic.chat.server.service.AgentService;
|
||||||
import com.tencent.supersonic.chat.server.service.ChatModelService;
|
import com.tencent.supersonic.chat.server.service.ChatModelService;
|
||||||
import com.tencent.supersonic.chat.server.service.ChatQueryService;
|
import com.tencent.supersonic.chat.server.service.ChatQueryService;
|
||||||
@@ -22,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -127,6 +129,12 @@ public class AgentServiceImpl extends ServiceImpl<AgentDOMapper, AgentDO> implem
|
|||||||
agent.setChatAppConfig(
|
agent.setChatAppConfig(
|
||||||
JsonUtil.toMap(agentDO.getChatModelConfig(), String.class, ChatApp.class));
|
JsonUtil.toMap(agentDO.getChatModelConfig(), String.class, ChatApp.class));
|
||||||
agent.setVisualConfig(JsonUtil.toObject(agentDO.getVisualConfig(), VisualConfig.class));
|
agent.setVisualConfig(JsonUtil.toObject(agentDO.getVisualConfig(), VisualConfig.class));
|
||||||
|
agent.getChatAppConfig().values().forEach(c -> {
|
||||||
|
ChatModel chatModel = chatModelService.getChatModel(c.getChatModelId());
|
||||||
|
if (Objects.nonNull(chatModel)) {
|
||||||
|
c.setChatModelConfig(chatModelService.getChatModel(c.getChatModelId()).getConfig());
|
||||||
|
}
|
||||||
|
});
|
||||||
return agent;
|
return agent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,12 +172,6 @@ public class ChatQueryServiceImpl implements ChatQueryService {
|
|||||||
ParseContext parseContext = new ParseContext();
|
ParseContext parseContext = new ParseContext();
|
||||||
BeanMapper.mapper(chatParseReq, parseContext);
|
BeanMapper.mapper(chatParseReq, parseContext);
|
||||||
Agent agent = agentService.getAgent(chatParseReq.getAgentId());
|
Agent agent = agentService.getAgent(chatParseReq.getAgentId());
|
||||||
agent.getChatAppConfig().values().forEach(c -> {
|
|
||||||
ChatModel chatModel = chatModelService.getChatModel(c.getChatModelId());
|
|
||||||
if (Objects.nonNull(chatModel)) {
|
|
||||||
c.setChatModelConfig(chatModelService.getChatModel(c.getChatModelId()).getConfig());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
parseContext.setAgent(agent);
|
parseContext.setAgent(agent);
|
||||||
return parseContext;
|
return parseContext;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ public class DataSetSchemaBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void setDefaultTimeFormat(SchemaElement dimToAdd,
|
private static void setDefaultTimeFormat(SchemaElement dimToAdd,
|
||||||
DimensionTimeTypeParams dimensionTimeTypeParams, String timeFormat) {
|
DimensionTimeTypeParams dimensionTimeTypeParams, String timeFormat) {
|
||||||
if (null != dimensionTimeTypeParams && TimeDimensionEnum.DAY.name()
|
if (null != dimensionTimeTypeParams && TimeDimensionEnum.DAY.name()
|
||||||
.equalsIgnoreCase(dimensionTimeTypeParams.getTimeGranularity())) {
|
.equalsIgnoreCase(dimensionTimeTypeParams.getTimeGranularity())) {
|
||||||
dimToAdd.getExtInfo().put(DimensionConstants.DIMENSION_TIME_FORMAT,
|
dimToAdd.getExtInfo().put(DimensionConstants.DIMENSION_TIME_FORMAT,
|
||||||
|
|||||||
Reference in New Issue
Block a user