(improvement)(headless)Change several info-mode logs to debug-mode

This commit is contained in:
jerryjzhang
2024-05-25 00:40:00 +08:00
parent 044cf8f31e
commit 6745df5a2e
8 changed files with 11 additions and 13 deletions

View File

@@ -17,16 +17,14 @@ public class LLMConfig {
private String modelName; private String modelName;
private Double temperature; private Double temperature = 0.0d;
private Long timeOut; private Long timeOut = 60L;
public LLMConfig(String provider, String baseUrl, String apiKey, String modelName) { public LLMConfig(String provider, String baseUrl, String apiKey, String modelName) {
this.provider = provider; this.provider = provider;
this.baseUrl = baseUrl; this.baseUrl = baseUrl;
this.apiKey = apiKey; this.apiKey = apiKey;
this.modelName = modelName; this.modelName = modelName;
this.temperature = 0.0d;
this.timeOut = 60L;
} }
} }

View File

@@ -37,7 +37,7 @@ public abstract class BaseSemanticCorrector implements SemanticCorrector {
return; return;
} }
doCorrect(queryContext, semanticParseInfo); doCorrect(queryContext, semanticParseInfo);
log.info("sqlCorrection:{} sql:{}", this.getClass().getSimpleName(), semanticParseInfo.getSqlInfo()); log.debug("sqlCorrection:{} sql:{}", this.getClass().getSimpleName(), semanticParseInfo.getSqlInfo());
} catch (Exception e) { } catch (Exception e) {
log.error(String.format("correct error,sqlInfo:%s", semanticParseInfo.getSqlInfo()), e); log.error(String.format("correct error,sqlInfo:%s", semanticParseInfo.getSqlInfo()), e);
} }

View File

@@ -168,12 +168,12 @@ public class HanlpHelper {
} }
public static boolean addToCustomDictionary(DictWord dictWord) { public static boolean addToCustomDictionary(DictWord dictWord) {
log.info("dictWord:{}", dictWord); log.debug("dictWord:{}", dictWord);
return getDynamicCustomDictionary().insert(dictWord.getWord(), dictWord.getNatureWithFrequency()); return getDynamicCustomDictionary().insert(dictWord.getWord(), dictWord.getNatureWithFrequency());
} }
public static void removeFromCustomDictionary(DictWord dictWord) { public static void removeFromCustomDictionary(DictWord dictWord) {
log.info("dictWord:{}", dictWord); log.debug("dictWord:{}", dictWord);
CoreDictionary.Attribute attribute = getDynamicCustomDictionary().get(dictWord.getWord()); CoreDictionary.Attribute attribute = getDynamicCustomDictionary().get(dictWord.getWord());
if (attribute == null) { if (attribute == null) {
return; return;

View File

@@ -89,7 +89,7 @@ public class HanlpDictMatchStrategy extends BaseMatchStrategy<HanlpMapResult> {
.filter(term -> CollectionUtils.isNotEmpty(term.getNatures())) .filter(term -> CollectionUtils.isNotEmpty(term.getNatures()))
.collect(Collectors.toCollection(LinkedHashSet::new)); .collect(Collectors.toCollection(LinkedHashSet::new));
log.info("detectSegment:{},after isSimilarity parseResults:{}", detectSegment, hanlpMapResults); log.debug("detectSegment:{},after isSimilarity parseResults:{}", detectSegment, hanlpMapResults);
hanlpMapResults = hanlpMapResults.stream().map(parseResult -> { hanlpMapResults = hanlpMapResults.stream().map(parseResult -> {
parseResult.setOffset(offset); parseResult.setOffset(offset);

View File

@@ -35,14 +35,14 @@ public class DefaultQueryParser implements QueryParser {
if (Objects.isNull(queryStatement.getMetricQueryParam())) { if (Objects.isNull(queryStatement.getMetricQueryParam())) {
queryStatement.setMetricQueryParam(new MetricQueryParam()); queryStatement.setMetricQueryParam(new MetricQueryParam());
} }
log.info("SemanticConverter before [{}]", queryParam); log.debug("SemanticConverter before [{}]", queryParam);
for (HeadlessConverter headlessConverter : ComponentFactory.getSemanticConverters()) { for (HeadlessConverter headlessConverter : ComponentFactory.getSemanticConverters()) {
if (headlessConverter.accept(queryStatement)) { if (headlessConverter.accept(queryStatement)) {
log.info("SemanticConverter accept [{}]", headlessConverter.getClass().getName()); log.info("SemanticConverter accept [{}]", headlessConverter.getClass().getName());
headlessConverter.convert(queryStatement); headlessConverter.convert(queryStatement);
} }
} }
log.info("SemanticConverter after {} {} {}", queryParam, queryStatement.getDataSetQueryParam(), log.debug("SemanticConverter after {} {} {}", queryParam, queryStatement.getDataSetQueryParam(),
queryStatement.getMetricQueryParam()); queryStatement.getMetricQueryParam());
if (!queryStatement.getDataSetQueryParam().getSql().isEmpty()) { if (!queryStatement.getDataSetQueryParam().getSql().isEmpty()) {
queryStatement = parser(queryStatement.getDataSetQueryParam(), queryStatement); queryStatement = parser(queryStatement.getDataSetQueryParam(), queryStatement);

View File

@@ -75,7 +75,7 @@ public class SqlInfoProcessor implements ResultProcessor {
} }
SqlInfo sqlInfo = parseInfo.getSqlInfo(); SqlInfo sqlInfo = parseInfo.getSqlInfo();
if (semanticQuery instanceof LLMSqlQuery) { if (semanticQuery instanceof LLMSqlQuery) {
keyPipelineLog.info("\ns2sql:{}\ncorrectS2SQL:{}\nquerySQL:{}", sqlInfo.getS2SQL(), keyPipelineLog.info("\nparsedS2SQL:{}\ncorrectedS2SQL:{}\nfinalSQL:{}", sqlInfo.getS2SQL(),
sqlInfo.getCorrectS2SQL(), explainSql); sqlInfo.getCorrectS2SQL(), explainSql);
} }
sqlInfo.setQuerySQL(explainSql); sqlInfo.setQuerySQL(explainSql);

View File

@@ -64,7 +64,7 @@ public class WorkflowServiceImpl implements WorkflowService {
public void performParsing(QueryContext queryCtx, ChatContext chatCtx) { public void performParsing(QueryContext queryCtx, ChatContext chatCtx) {
semanticParsers.forEach(parser -> { semanticParsers.forEach(parser -> {
parser.parse(queryCtx, chatCtx); parser.parse(queryCtx, chatCtx);
log.info("{} result:{}", parser.getClass().getSimpleName(), JsonUtil.toString(queryCtx)); log.debug("{} result:{}", parser.getClass().getSimpleName(), JsonUtil.toString(queryCtx));
}); });
} }

View File

@@ -1,2 +1,2 @@
root=. root=.
CustomDictionaryPath=data/dictionary/custom/DimValue_1_1.txt;data/dictionary/custom/DimValue_1_2.txt;data/dictionary/custom/DimValue_1_3.txt;data/dictionary/custom/benchmark_cspider.txt; CustomDictionaryPath=data/dictionary/custom/DimValue_1_1.txt;data/dictionary/custom/DimValue_1_2.txt;data/dictionary/custom/DimValue_1_3.txt;