[improvement][project] Keep the style consistent when displaying various SQL queries on the Chat page. (#684)

This commit is contained in:
lexluo09
2024-01-23 15:10:48 +08:00
committed by GitHub
parent 42a6f61456
commit 9d6f96e6d4
14 changed files with 141 additions and 139 deletions

View File

@@ -33,7 +33,7 @@ public class OnePassSCSqlGeneration implements SqlGeneration, InitializingBean {
private ChatLanguageModel chatLanguageModel;
@Autowired
private SqlExampleLoader sqlExampleLoader;
private SqlExamplarLoader sqlExamplarLoader;
@Autowired
private OptimizationConfig optimizationConfig;
@@ -46,7 +46,7 @@ public class OnePassSCSqlGeneration implements SqlGeneration, InitializingBean {
//1.retriever sqlExamples and generate exampleListPool
keyPipelineLog.info("modelClusterKey:{},llmReq:{}", modelClusterKey, llmReq);
List<Map<String, String>> sqlExamples = sqlExampleLoader.retrieverSqlExamples(llmReq.getQueryText(),
List<Map<String, String>> sqlExamples = sqlExamplarLoader.retrieverSqlExamples(llmReq.getQueryText(),
optimizationConfig.getText2sqlCollectionName(), optimizationConfig.getText2sqlExampleNum());
List<List<Map<String, String>>> exampleListPool = sqlPromptGenerator.getExampleCombos(sqlExamples,

View File

@@ -31,7 +31,7 @@ public class OnePassSqlGeneration implements SqlGeneration, InitializingBean {
private ChatLanguageModel chatLanguageModel;
@Autowired
private SqlExampleLoader sqlExampleLoader;
private SqlExamplarLoader sqlExamplarLoader;
@Autowired
private OptimizationConfig optimizationConfig;
@@ -43,7 +43,7 @@ public class OnePassSqlGeneration implements SqlGeneration, InitializingBean {
public LLMResp generation(LLMReq llmReq, String modelClusterKey) {
//1.retriever sqlExamples
keyPipelineLog.info("modelClusterKey:{},llmReq:{}", modelClusterKey, llmReq);
List<Map<String, String>> sqlExamples = sqlExampleLoader.retrieverSqlExamples(llmReq.getQueryText(),
List<Map<String, String>> sqlExamples = sqlExamplarLoader.retrieverSqlExamples(llmReq.getQueryText(),
optimizationConfig.getText2sqlCollectionName(), optimizationConfig.getText2sqlExampleNum());
//2.generator linking and sql prompt by sqlExamples,and generate response.

View File

@@ -24,7 +24,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
public class SqlExampleLoader {
public class SqlExamplarLoader {
private static final String EXAMPLE_JSON_FILE = "s2ql_examplar.json";

View File

@@ -30,7 +30,7 @@ public class TwoPassSCSqlGeneration implements SqlGeneration, InitializingBean {
private ChatLanguageModel chatLanguageModel;
@Autowired
private SqlExampleLoader sqlExampleLoader;
private SqlExamplarLoader sqlExamplarLoader;
@Autowired
private OptimizationConfig optimizationConfig;
@@ -42,7 +42,7 @@ public class TwoPassSCSqlGeneration implements SqlGeneration, InitializingBean {
public LLMResp generation(LLMReq llmReq, String modelClusterKey) {
//1.retriever sqlExamples and generate exampleListPool
keyPipelineLog.info("modelClusterKey:{},llmReq:{}", modelClusterKey, llmReq);
List<Map<String, String>> sqlExamples = sqlExampleLoader.retrieverSqlExamples(llmReq.getQueryText(),
List<Map<String, String>> sqlExamples = sqlExamplarLoader.retrieverSqlExamples(llmReq.getQueryText(),
optimizationConfig.getText2sqlCollectionName(), optimizationConfig.getText2sqlExampleNum());
List<List<Map<String, String>>> exampleListPool = sqlPromptGenerator.getExampleCombos(sqlExamples,

View File

@@ -30,7 +30,7 @@ public class TwoPassSqlGeneration implements SqlGeneration, InitializingBean {
private ChatLanguageModel chatLanguageModel;
@Autowired
private SqlExampleLoader sqlExampleLoader;
private SqlExamplarLoader sqlExamplarLoader;
@Autowired
private OptimizationConfig optimizationConfig;
@@ -41,7 +41,7 @@ public class TwoPassSqlGeneration implements SqlGeneration, InitializingBean {
@Override
public LLMResp generation(LLMReq llmReq, String modelClusterKey) {
keyPipelineLog.info("modelClusterKey:{},llmReq:{}", modelClusterKey, llmReq);
List<Map<String, String>> sqlExamples = sqlExampleLoader.retrieverSqlExamples(llmReq.getQueryText(),
List<Map<String, String>> sqlExamples = sqlExamplarLoader.retrieverSqlExamples(llmReq.getQueryText(),
optimizationConfig.getText2sqlCollectionName(), optimizationConfig.getText2sqlExampleNum());
String linkingPromptStr = sqlPromptGenerator.generateLinkingPrompt(llmReq, sqlExamples);