mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 22:25:19 +00:00
[improvement][project] Keep the style consistent when displaying various SQL queries on the Chat page. (#684)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user