mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-20 06:34:55 +00:00
[improvement](chat) Change llmparser to pyllm, retrieve LLMProxy from environment variables, defaulting to JavaLLMProxy. (#497)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
package com.tencent.supersonic;
|
||||
|
||||
import com.tencent.supersonic.chat.config.OptimizationConfig;
|
||||
import com.tencent.supersonic.chat.parser.JavaLLMProxy;
|
||||
import com.tencent.supersonic.chat.parser.sql.llm.SqlExample;
|
||||
import com.tencent.supersonic.chat.parser.sql.llm.SqlExampleLoader;
|
||||
import com.tencent.supersonic.chat.parser.JavaLLMProxy;
|
||||
import com.tencent.supersonic.chat.parser.LLMProxy;
|
||||
import com.tencent.supersonic.chat.utils.ComponentFactory;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -18,7 +17,6 @@ import org.springframework.stereotype.Component;
|
||||
@Order(4)
|
||||
public class EmbeddingInitListener implements CommandLineRunner {
|
||||
|
||||
protected LLMProxy llmProxy = ComponentFactory.getLLMProxy();
|
||||
@Autowired
|
||||
private SqlExampleLoader sqlExampleLoader;
|
||||
@Autowired
|
||||
@@ -31,7 +29,7 @@ public class EmbeddingInitListener implements CommandLineRunner {
|
||||
|
||||
public void initSqlExamples() {
|
||||
try {
|
||||
if (llmProxy instanceof JavaLLMProxy) {
|
||||
if (ComponentFactory.getLLMProxy() instanceof JavaLLMProxy) {
|
||||
List<SqlExample> sqlExamples = sqlExampleLoader.getSqlExamples();
|
||||
String collectionName = optimizationConfig.getText2sqlCollectionName();
|
||||
sqlExampleLoader.addEmbeddingStore(sqlExamples, collectionName);
|
||||
|
||||
@@ -29,9 +29,6 @@ com.tencent.supersonic.chat.processor.ParseResultProcessor=\
|
||||
com.tencent.supersonic.chat.processor.TimeCostProcessor, \
|
||||
com.tencent.supersonic.chat.processor.RespBuildProcessor
|
||||
|
||||
com.tencent.supersonic.chat.parser.LLMProxy=\
|
||||
com.tencent.supersonic.chat.parser.JavaLLMProxy
|
||||
|
||||
com.tencent.supersonic.chat.api.component.SemanticInterpreter=\
|
||||
com.tencent.supersonic.knowledge.semantic.LocalSemanticInterpreter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user