(improvement)(headless) Reduce the two calls to the mapper in the parser stage. (#888)

This commit is contained in:
lexluo09
2024-04-06 11:49:44 +08:00
committed by GitHub
parent 0577090b39
commit faeb5bbeac
4 changed files with 34 additions and 21 deletions

View File

@@ -4,6 +4,9 @@ import com.tencent.supersonic.chat.server.agent.Agent;
import com.tencent.supersonic.chat.server.pojo.ChatParseContext;
import com.tencent.supersonic.common.util.BeanMapper;
import com.tencent.supersonic.headless.api.pojo.request.QueryReq;
import org.apache.commons.collections.MapUtils;
import java.util.Objects;
public class QueryReqConverter {
@@ -18,6 +21,10 @@ public class QueryReqConverter {
queryReq.setEnableLLM(true);
}
queryReq.setDataSetIds(agent.getDataSetIds());
if (Objects.nonNull(queryReq.getMapInfo())
&& MapUtils.isNotEmpty(queryReq.getMapInfo().getDataSetElementMatches())) {
queryReq.setMapInfo(queryReq.getMapInfo());
}
return queryReq;
}