mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
(improvement)(chat) add linking value switch and rename use.s2SQL.switch parameters (#376)
This commit is contained in:
@@ -39,7 +39,7 @@ public class OptimizationConfig {
|
||||
@Value("${candidate.threshold}")
|
||||
private Double candidateThreshold;
|
||||
|
||||
@Value("${user.s2SQL.switch:false}")
|
||||
@Value("${use.s2SQL.switch:false}")
|
||||
private boolean useS2SqlSwitch;
|
||||
|
||||
@Value("${embedding.mapper.word.min:4}")
|
||||
@@ -59,4 +59,7 @@ public class OptimizationConfig {
|
||||
|
||||
@Value("${embedding.mapper.distance.threshold:0.58}")
|
||||
private Double embeddingMapperDistanceThreshold;
|
||||
|
||||
@Value("${use.linking.value.switch:true}")
|
||||
private boolean useLinkingValueSwitch;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.tencent.supersonic.chat.api.pojo.SchemaElementType;
|
||||
import com.tencent.supersonic.chat.api.pojo.SemanticSchema;
|
||||
import com.tencent.supersonic.chat.api.pojo.request.QueryReq;
|
||||
import com.tencent.supersonic.chat.config.LLMParserConfig;
|
||||
import com.tencent.supersonic.chat.config.OptimizationConfig;
|
||||
import com.tencent.supersonic.chat.parser.SatisfactionChecker;
|
||||
import com.tencent.supersonic.chat.query.llm.s2sql.LLMReq;
|
||||
import com.tencent.supersonic.chat.query.llm.s2sql.LLMReq.ElementValue;
|
||||
@@ -59,9 +60,10 @@ public class LLMRequestService {
|
||||
private AgentService agentService;
|
||||
@Autowired
|
||||
private SchemaService schemaService;
|
||||
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
@Autowired
|
||||
private OptimizationConfig optimizationConfig;
|
||||
|
||||
public boolean check(QueryContext queryCtx) {
|
||||
QueryReq request = queryCtx.getRequest();
|
||||
@@ -128,7 +130,9 @@ public class LLMRequestService {
|
||||
llmReq.setSchema(llmSchema);
|
||||
|
||||
List<ElementValue> linking = new ArrayList<>();
|
||||
linking.addAll(getValueList(queryCtx, modelId, semanticSchema));
|
||||
if (optimizationConfig.isUseLinkingValueSwitch()) {
|
||||
linking.addAll(getValueList(queryCtx, modelId, semanticSchema));
|
||||
}
|
||||
llmReq.setLinking(linking);
|
||||
|
||||
String currentDate = S2SQLDateHelper.getReferenceDate(modelId);
|
||||
|
||||
@@ -8,4 +8,4 @@ long.text.threshold=0.8
|
||||
short.text.threshold=0.5
|
||||
query.text.length.threshold=10
|
||||
candidate.threshold=0.2
|
||||
user.s2SQL.switch=true
|
||||
use.s2SQL.switch=true
|
||||
Reference in New Issue
Block a user