mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:00:23 +00:00
[fix][chat] The terms in the descriptor of the term no longer undergo descriptor mapping (#1897)
This commit is contained in:
@@ -22,10 +22,10 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@@ -61,10 +61,11 @@ public class MemoryReviewTask {
|
||||
public void review() {
|
||||
List<Agent> agentList = agentService.getAgents();
|
||||
for (Agent agent : agentList) {
|
||||
if(!agent.enableMemoryReview()){
|
||||
if (!agent.enableMemoryReview()) {
|
||||
continue;
|
||||
}
|
||||
ChatMemoryFilter chatMemoryFilter = ChatMemoryFilter.builder().agentId(agent.getId()).build();
|
||||
ChatMemoryFilter chatMemoryFilter =
|
||||
ChatMemoryFilter.builder().agentId(agent.getId()).build();
|
||||
memoryService.getMemories(chatMemoryFilter).stream().forEach(memory -> {
|
||||
try {
|
||||
processMemory(memory, agent);
|
||||
|
||||
@@ -30,6 +30,7 @@ public class QueryNLReq extends SemanticQueryReq implements Serializable {
|
||||
private List<Text2SQLExemplar> dynamicExemplars = Lists.newArrayList();
|
||||
private SemanticParseInfo contextParseInfo;
|
||||
private SemanticParseInfo selectedParseInfo;
|
||||
private boolean descriptionMapped;
|
||||
|
||||
@Override
|
||||
public String toCustomizedString() {
|
||||
|
||||
@@ -20,7 +20,8 @@ public class TermDescMapper extends BaseMapper {
|
||||
public void doMap(ChatQueryContext chatQueryContext) {
|
||||
SchemaMapInfo mapInfo = chatQueryContext.getMapInfo();
|
||||
List<SchemaElement> termElements = mapInfo.getTermDescriptionToMap();
|
||||
if (CollectionUtils.isEmpty(termElements)) {
|
||||
if (CollectionUtils.isEmpty(termElements)
|
||||
|| chatQueryContext.getRequest().isDescriptionMapped()) {
|
||||
return;
|
||||
}
|
||||
for (SchemaElement schemaElement : termElements) {
|
||||
@@ -39,6 +40,7 @@ public class TermDescMapper extends BaseMapper {
|
||||
queryContext.setSemanticSchema(chatQueryContext.getSemanticSchema());
|
||||
queryContext.setModelIdToDataSetIds(chatQueryContext.getModelIdToDataSetIds());
|
||||
queryContext.setChatWorkflowState(chatQueryContext.getChatWorkflowState());
|
||||
queryContext.getRequest().setDescriptionMapped(true);
|
||||
return queryContext;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user