mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-19 08:50:57 +00:00
(improvement)(Headless) Embedding data related to metadata is not restored from persistent files. (#748)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
package com.tencent.supersonic;
|
||||
|
||||
import com.tencent.supersonic.chat.core.config.OptimizationConfig;
|
||||
import com.tencent.supersonic.chat.core.parser.JavaLLMProxy;
|
||||
import com.tencent.supersonic.chat.core.parser.sql.llm.SqlExamplarLoader;
|
||||
import com.tencent.supersonic.chat.core.parser.sql.llm.SqlExample;
|
||||
import com.tencent.supersonic.chat.core.utils.ComponentFactory;
|
||||
import com.tencent.supersonic.common.config.EmbeddingConfig;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -20,7 +20,7 @@ public class EmbeddingInitListener implements CommandLineRunner {
|
||||
@Autowired
|
||||
private SqlExamplarLoader sqlExamplarLoader;
|
||||
@Autowired
|
||||
private OptimizationConfig optimizationConfig;
|
||||
private EmbeddingConfig embeddingConfig;
|
||||
|
||||
@Override
|
||||
public void run(String... args) {
|
||||
@@ -31,7 +31,7 @@ public class EmbeddingInitListener implements CommandLineRunner {
|
||||
try {
|
||||
if (ComponentFactory.getLLMProxy() instanceof JavaLLMProxy) {
|
||||
List<SqlExample> sqlExamples = sqlExamplarLoader.getSqlExamples();
|
||||
String collectionName = optimizationConfig.getText2sqlCollectionName();
|
||||
String collectionName = embeddingConfig.getText2sqlCollectionName();
|
||||
sqlExamplarLoader.addEmbeddingStore(sqlExamples, collectionName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user