You've already forked DataMate
@@ -164,8 +164,3 @@ datamate:
|
||||
quality-control:
|
||||
enabled: ${QC_ENABLED:true}
|
||||
threshold: ${QC_THRESHOLD:0.8}
|
||||
|
||||
# RAG配置
|
||||
rag:
|
||||
milvus-host: ${MILVUS_HOST:milvus-standalone}
|
||||
milvus-port: ${MILVUS_PORT:19530}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class OperatorService {
|
||||
|
||||
private final FileService fileService;
|
||||
|
||||
@Value("${operator.base.path:/operator}")
|
||||
@Value("${operator.base.path:/operators}")
|
||||
private String operatorBasePath;
|
||||
|
||||
public List<OperatorDto> getOperators(Integer page, Integer size, List<String> categories,
|
||||
|
||||
@@ -51,9 +51,9 @@ import java.util.concurrent.Semaphore;
|
||||
public class RagEtlService {
|
||||
private static final Semaphore SEMAPHORE = new Semaphore(10);
|
||||
|
||||
@Value("${datamate.rag.milvus-host}")
|
||||
@Value("${datamate.rag.milvus-host:-milvus-standalone}")
|
||||
private String milvusHost;
|
||||
@Value("${datamate.rag.milvus-port}")
|
||||
@Value("${datamate.rag.milvus-port:-19530}")
|
||||
private int milvusPort;
|
||||
|
||||
private final RagFileRepository ragFileRepository;
|
||||
@@ -122,7 +122,7 @@ public class RagEtlService {
|
||||
// 调用嵌入模型获取嵌入向量
|
||||
List<Embedding> content = embeddingModel.embedAll(split).content();
|
||||
// 存储嵌入向量到 Milvus
|
||||
embeddingStore(embeddingModel, ragFile.getKnowledgeBaseId()).addAll(content, split);
|
||||
embeddingStore(embeddingModel, event.knowledgeBase().getName()).addAll(content, split);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,11 +152,11 @@ public class RagEtlService {
|
||||
};
|
||||
}
|
||||
|
||||
public EmbeddingStore<TextSegment> embeddingStore(EmbeddingModel embeddingModel, String knowledgeBaseId) {
|
||||
public EmbeddingStore<TextSegment> embeddingStore(EmbeddingModel embeddingModel, String knowledgeBaseName) {
|
||||
return MilvusEmbeddingStore.builder()
|
||||
.host(milvusHost)
|
||||
.port(milvusPort)
|
||||
.collectionName("datamate_" + knowledgeBaseId)
|
||||
.collectionName(knowledgeBaseName)
|
||||
.dimension(embeddingModel.dimension())
|
||||
.build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user