(improvement)(Headless) Embedding data related to metadata is not restored from persistent files. (#748)

This commit is contained in:
lexluo09
2024-02-23 18:22:28 +08:00
committed by GitHub
parent 01bc4dcacf
commit e610dd8246
13 changed files with 25 additions and 16 deletions

View File

@@ -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) {