[improvement](chat) Add persistence to InMemoryEmbeddingStore, fix the issue of PythonServiceS2EmbeddingStore being empty. (#524)

This commit is contained in:
lexluo09
2023-12-17 11:04:29 +08:00
committed by GitHub
parent 3db443f9b1
commit fe75b3e393
6 changed files with 94 additions and 20 deletions

View File

@@ -37,7 +37,7 @@ public class JavaLLMProxy implements LLMProxy {
public LLMResp query2sql(LLMReq llmReq, String modelClusterKey) {
SqlGeneration sqlGeneration = SqlGenerationFactory.get(
SqlGenerationMode.valueOf(llmReq.getSqlGenerationMode()));
SqlGenerationMode.getMode(llmReq.getSqlGenerationMode()));
String modelName = llmReq.getSchema().getModelName();
Map<String, Double> sqlWeight = sqlGeneration.generation(llmReq, modelClusterKey);

View File

@@ -69,5 +69,14 @@ public class LLMReq {
return name;
}
public static SqlGenerationMode getMode(String name) {
for (SqlGenerationMode sqlGenerationMode : SqlGenerationMode.values()) {
if (sqlGenerationMode.name.equals(name)) {
return sqlGenerationMode;
}
}
return null;
}
}
}