mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
(improvement)(launcher)Refactor config keys, use s2 as the prefix
This commit is contained in:
@@ -53,7 +53,7 @@ public class MultiTurnParser implements ChatParser {
|
||||
public void parse(ChatParseContext chatParseContext, ParseResp parseResp) {
|
||||
Environment environment = ContextUtils.getBean(Environment.class);
|
||||
MultiTurnConfig agentMultiTurnConfig = chatParseContext.getAgent().getMultiTurnConfig();
|
||||
Boolean globalMultiTurnConfig = environment.getProperty("s2.multi-turn.enable", Boolean.class);
|
||||
Boolean globalMultiTurnConfig = environment.getProperty("s2.parser.multi-turn.enable", Boolean.class);
|
||||
|
||||
Boolean multiTurnConfig = agentMultiTurnConfig != null
|
||||
? agentMultiTurnConfig.isEnableMultiTurn() : globalMultiTurnConfig;
|
||||
|
||||
@@ -8,37 +8,37 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Data
|
||||
public class EmbeddingConfig {
|
||||
|
||||
@Value("${embedding.url:}")
|
||||
@Value("${s2.embedding.url:}")
|
||||
private String url;
|
||||
|
||||
@Value("${embedding.recognize.path:/preset_query_retrival}")
|
||||
@Value("${s2.embedding.persistent.path:/tmp}")
|
||||
private String embeddingStorePersistentPath;
|
||||
|
||||
@Value("${s2.embedding.recognize.path:/preset_query_retrival}")
|
||||
private String recognizePath;
|
||||
|
||||
@Value("${embedding.preset.collection:preset_query_collection}")
|
||||
@Value("${s2.embedding.preset.collection:preset_query_collection}")
|
||||
private String presetCollection;
|
||||
|
||||
@Value("${embedding.meta.collection:meta_collection}")
|
||||
@Value("${s2.embedding.meta.collection:meta_collection}")
|
||||
private String metaCollectionName;
|
||||
|
||||
@Value("${embedding.nResult:1}")
|
||||
@Value("${s2.embedding.nResult:1}")
|
||||
private int nResult;
|
||||
|
||||
@Value("${embedding.solved.query.collection:solved_query_collection}")
|
||||
@Value("${s2.embedding.solved.query.collection:solved_query_collection}")
|
||||
private String solvedQueryCollection;
|
||||
|
||||
@Value("${embedding.solved.query.nResult:5}")
|
||||
@Value("${s2.embedding.solved.query.nResult:5}")
|
||||
private int solvedQueryResultNum;
|
||||
|
||||
@Value("${embedding.metric.analyzeQuery.collection:solved_query_collection}")
|
||||
@Value("${s2.embedding.metric.analyzeQuery.collection:solved_query_collection}")
|
||||
private String metricAnalyzeQueryCollection;
|
||||
|
||||
@Value("${text2sql.collection.name:text2dsl_agent_collection}")
|
||||
private String text2sqlCollectionName;
|
||||
|
||||
@Value("${embedding.metric.analyzeQuery.nResult:5}")
|
||||
@Value("${s2.embedding.metric.analyzeQuery.nResult:5}")
|
||||
private int metricAnalyzeQueryResultNum;
|
||||
|
||||
@Value("${inMemoryEmbeddingStore.persistent.path:/tmp}")
|
||||
private String embeddingStorePersistentPath;
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public abstract class BaseSemanticCorrector implements SemanticCorrector {
|
||||
|
||||
//decide whether add order by expression field to select
|
||||
Environment environment = ContextUtils.getBean(Environment.class);
|
||||
String correctorAdditionalInfo = environment.getProperty("corrector.additional.information");
|
||||
String correctorAdditionalInfo = environment.getProperty("s2.corrector.additional.information");
|
||||
if (StringUtils.isNotBlank(correctorAdditionalInfo) && Boolean.parseBoolean(correctorAdditionalInfo)) {
|
||||
needAddFields.addAll(SqlSelectHelper.getOrderByFields(correctS2SQL));
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class GroupByCorrector extends BaseSemanticCorrector {
|
||||
return false;
|
||||
}
|
||||
Environment environment = ContextUtils.getBean(Environment.class);
|
||||
String correctorAdditionalInfo = environment.getProperty("corrector.additional.information");
|
||||
String correctorAdditionalInfo = environment.getProperty("s2.corrector.additional.information");
|
||||
if (StringUtils.isNotBlank(correctorAdditionalInfo) && !Boolean.parseBoolean(correctorAdditionalInfo)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class HavingCorrector extends BaseSemanticCorrector {
|
||||
|
||||
//decide whether add having expression field to select
|
||||
Environment environment = ContextUtils.getBean(Environment.class);
|
||||
String correctorAdditionalInfo = environment.getProperty("corrector.additional.information");
|
||||
String correctorAdditionalInfo = environment.getProperty("s2.corrector.additional.information");
|
||||
if (StringUtils.isNotBlank(correctorAdditionalInfo) && Boolean.parseBoolean(correctorAdditionalInfo)) {
|
||||
addHavingToSelect(semanticParseInfo);
|
||||
}
|
||||
|
||||
@@ -9,22 +9,21 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Data
|
||||
public class LLMParserConfig {
|
||||
|
||||
|
||||
@Value("${llm.parser.url:}")
|
||||
@Value("${s2.parser.url:}")
|
||||
private String url;
|
||||
|
||||
@Value("${query2sql.path:/query2sql}")
|
||||
@Value("${s2.query2sql.path:/query2sql}")
|
||||
private String queryToSqlPath;
|
||||
|
||||
@Value("${dimension.topn:10}")
|
||||
@Value("${s2.dimension.topn:10}")
|
||||
private Integer dimensionTopN;
|
||||
|
||||
@Value("${metric.topn:10}")
|
||||
@Value("${s2.metric.topn:10}")
|
||||
private Integer metricTopN;
|
||||
|
||||
@Value("${tag.topn:20}")
|
||||
@Value("${s2.tag.topn:20}")
|
||||
private Integer tagTopN;
|
||||
|
||||
@Value("${all.model:false}")
|
||||
@Value("${s2.all.model:false}")
|
||||
private Boolean allModel;
|
||||
}
|
||||
|
||||
@@ -14,72 +14,73 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Slf4j
|
||||
public class OptimizationConfig {
|
||||
|
||||
@Value("${one.detection.size:8}")
|
||||
@Value("${s2.one.detection.size:8}")
|
||||
private Integer oneDetectionSize;
|
||||
|
||||
@Value("${one.detection.max.size:20}")
|
||||
@Value("${s2.one.detection.max.size:20}")
|
||||
private Integer oneDetectionMaxSize;
|
||||
|
||||
@Value("${metric.dimension.min.threshold:0.3}")
|
||||
@Value("${s2.metric.dimension.min.threshold:0.3}")
|
||||
private Double metricDimensionMinThresholdConfig;
|
||||
|
||||
@Value("${metric.dimension.threshold:0.3}")
|
||||
@Value("${s2.metric.dimension.threshold:0.3}")
|
||||
private Double metricDimensionThresholdConfig;
|
||||
|
||||
@Value("${dimension.value.min.threshold:0.2}")
|
||||
@Value("${s2.dimension.value.min.threshold:0.2}")
|
||||
private Double dimensionValueMinThresholdConfig;
|
||||
|
||||
@Value("${dimension.value.threshold:0.5}")
|
||||
@Value("${s2.dimension.value.threshold:0.5}")
|
||||
private Double dimensionValueThresholdConfig;
|
||||
|
||||
@Value("${long.text.threshold:0.8}")
|
||||
@Value("${s2.long.text.threshold:0.8}")
|
||||
private Double longTextThreshold;
|
||||
|
||||
@Value("${short.text.threshold:0.5}")
|
||||
@Value("${s2.short.text.threshold:0.5}")
|
||||
private Double shortTextThreshold;
|
||||
|
||||
@Value("${query.text.length.threshold:10}")
|
||||
@Value("${s2.query.text.length.threshold:10}")
|
||||
private Integer queryTextLengthThreshold;
|
||||
@Value("${embedding.mapper.word.min:4}")
|
||||
|
||||
@Value("${s2.embedding.mapper.word.min:4}")
|
||||
private int embeddingMapperWordMin;
|
||||
|
||||
@Value("${embedding.mapper.word.max:4}")
|
||||
@Value("${s2.embedding.mapper.word.max:4}")
|
||||
private int embeddingMapperWordMax;
|
||||
|
||||
@Value("${embedding.mapper.batch:50}")
|
||||
@Value("${s2.embedding.mapper.batch:50}")
|
||||
private int embeddingMapperBatch;
|
||||
|
||||
@Value("${embedding.mapper.number:5}")
|
||||
@Value("${s2.embedding.mapper.number:5}")
|
||||
private int embeddingMapperNumber;
|
||||
|
||||
@Value("${embedding.mapper.round.number:10}")
|
||||
@Value("${s2.embedding.mapper.round.number:10}")
|
||||
private int embeddingMapperRoundNumber;
|
||||
|
||||
@Value("${embedding.mapper.min.threshold:0.6}")
|
||||
@Value("${s2.embedding.mapper.min.threshold:0.6}")
|
||||
private Double embeddingMapperMinThreshold;
|
||||
|
||||
@Value("${embedding.mapper.threshold:0.99}")
|
||||
@Value("${s2.embedding.mapper.threshold:0.99}")
|
||||
private Double embeddingMapperThreshold;
|
||||
|
||||
@Value("${s2SQL.linking.value.switch:true}")
|
||||
@Value("${s2.parser.linking.value.switch:true}")
|
||||
private boolean useLinkingValueSwitch;
|
||||
|
||||
@Value("${s2SQL.generation:TWO_PASS_AUTO_COT}")
|
||||
@Value("${s2.parser.generation:TWO_PASS_AUTO_COT}")
|
||||
private LLMReq.SqlGenType sqlGenType;
|
||||
|
||||
@Value("${s2SQL.use.switch:true}")
|
||||
@Value("${s2.parser.use.switch:true}")
|
||||
private boolean useS2SqlSwitch;
|
||||
|
||||
@Value("${text2sql.example.num:15}")
|
||||
@Value("${s2.parser.exemplar-recall.num:15}")
|
||||
private int text2sqlExampleNum;
|
||||
|
||||
@Value("${text2sql.fewShots.num:10}")
|
||||
@Value("${s2.parser.few-shot.num:10}")
|
||||
private int text2sqlFewShotsNum;
|
||||
|
||||
@Value("${text2sql.self.consistency.num:5}")
|
||||
@Value("${s2.parser.self-consistency.num:5}")
|
||||
private int text2sqlSelfConsistencyNum;
|
||||
|
||||
@Value("${parse.show.count:3}")
|
||||
@Value("${s2.parser.show-count:3}")
|
||||
private Integer parseShowCount;
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -42,7 +42,7 @@ public class QueryUtils {
|
||||
|
||||
private final Set<Pattern> patterns = new HashSet<>();
|
||||
|
||||
@Value("${query.optimizer.enable:true}")
|
||||
@Value("${s2.query-optimizer.enable:true}")
|
||||
private Boolean optimizeEnable;
|
||||
|
||||
@PostConstruct
|
||||
|
||||
@@ -30,44 +30,42 @@ authentication:
|
||||
header:
|
||||
key: Authorization
|
||||
|
||||
query:
|
||||
optimizer:
|
||||
enable: true
|
||||
|
||||
time:
|
||||
threshold: 100
|
||||
|
||||
dimension:
|
||||
topn: 20
|
||||
metric:
|
||||
topn: 20
|
||||
|
||||
corrector:
|
||||
additional:
|
||||
information: true
|
||||
|
||||
pyllm:
|
||||
url: http://127.0.0.1:9092
|
||||
llm:
|
||||
parser:
|
||||
url: ${pyllm.url}
|
||||
|
||||
embedding:
|
||||
url: ${pyllm.url}
|
||||
|
||||
functionCall:
|
||||
url: ${pyllm.url}
|
||||
|
||||
text2sql:
|
||||
example:
|
||||
num: 1
|
||||
logging:
|
||||
level:
|
||||
dev.langchain4j: DEBUG
|
||||
dev.ai4j.openai4j: DEBUG
|
||||
|
||||
s2:
|
||||
pyllm:
|
||||
url: http://127.0.0.1:9092
|
||||
|
||||
parser:
|
||||
url: ${s2.pyllm.url}
|
||||
exemplar-recall:
|
||||
number: 10
|
||||
few-shot:
|
||||
number: 5
|
||||
self-consistency:
|
||||
number: 5
|
||||
multi-turn:
|
||||
enable: false
|
||||
|
||||
corrector:
|
||||
additional:
|
||||
information: true
|
||||
|
||||
functionCall:
|
||||
url: ${s2.pyllm.url}
|
||||
|
||||
embedding:
|
||||
url: ${s2.pyllm.url}
|
||||
persistent:
|
||||
path: /tmp
|
||||
|
||||
demo:
|
||||
names: S2VisitsDemo,S2ArtistDemo
|
||||
enableLLM: true
|
||||
multi-turn:
|
||||
enable: false
|
||||
|
||||
langchain4j:
|
||||
#1.chat-model
|
||||
chat-model:
|
||||
@@ -102,14 +100,4 @@ s2:
|
||||
# hugging-face:
|
||||
# access-token: hg_access_token
|
||||
# model-id: sentence-transformers/all-MiniLM-L6-v2
|
||||
# timeout: 1h
|
||||
|
||||
#langchain4j log
|
||||
logging:
|
||||
level:
|
||||
dev.langchain4j: DEBUG
|
||||
dev.ai4j.openai4j: DEBUG
|
||||
|
||||
inMemoryEmbeddingStore:
|
||||
persistent:
|
||||
path: /tmp
|
||||
# timeout: 1h
|
||||
@@ -30,44 +30,42 @@ authentication:
|
||||
header:
|
||||
key: Authorization
|
||||
|
||||
query:
|
||||
optimizer:
|
||||
enable: true
|
||||
|
||||
time:
|
||||
threshold: 100
|
||||
|
||||
dimension:
|
||||
topn: 20
|
||||
metric:
|
||||
topn: 20
|
||||
|
||||
corrector:
|
||||
additional:
|
||||
information: true
|
||||
|
||||
pyllm:
|
||||
url: http://127.0.0.1:9092
|
||||
llm:
|
||||
parser:
|
||||
url: ${pyllm.url}
|
||||
|
||||
embedding:
|
||||
url: ${pyllm.url}
|
||||
|
||||
functionCall:
|
||||
url: ${pyllm.url}
|
||||
|
||||
text2sql:
|
||||
example:
|
||||
num: 1
|
||||
logging:
|
||||
level:
|
||||
dev.langchain4j: DEBUG
|
||||
dev.ai4j.openai4j: DEBUG
|
||||
|
||||
s2:
|
||||
pyllm:
|
||||
url: http://127.0.0.1:9092
|
||||
|
||||
parser:
|
||||
url: ${s2.pyllm.url}
|
||||
exemplar-recall:
|
||||
number: 10
|
||||
few-shot:
|
||||
number: 5
|
||||
self-consistency:
|
||||
number: 5
|
||||
multi-turn:
|
||||
enable: false
|
||||
|
||||
corrector:
|
||||
additional:
|
||||
information: true
|
||||
|
||||
functionCall:
|
||||
url: ${s2.pyllm.url}
|
||||
|
||||
embedding:
|
||||
url: ${s2.pyllm.url}
|
||||
persistent:
|
||||
path: /tmp
|
||||
|
||||
demo:
|
||||
names: S2VisitsDemo,S2ArtistDemo
|
||||
enableLLM: true
|
||||
multi-turn:
|
||||
enable: false
|
||||
|
||||
langchain4j:
|
||||
#1.chat-model
|
||||
chat-model:
|
||||
@@ -102,14 +100,4 @@ s2:
|
||||
# hugging-face:
|
||||
# access-token: hg_access_token
|
||||
# model-id: sentence-transformers/all-MiniLM-L6-v2
|
||||
# timeout: 1h
|
||||
|
||||
#langchain4j log
|
||||
logging:
|
||||
level:
|
||||
dev.langchain4j: DEBUG
|
||||
dev.ai4j.openai4j: DEBUG
|
||||
|
||||
inMemoryEmbeddingStore:
|
||||
persistent:
|
||||
path: /tmp
|
||||
# timeout: 1h
|
||||
Reference in New Issue
Block a user