feature: 对接deer-flow (#54)

feature: 对接deer-flow
This commit is contained in:
hhhhsc701
2025-11-04 20:30:40 +08:00
committed by GitHub
parent dc30b0d892
commit f3958f08d9
710 changed files with 112812 additions and 52 deletions

View File

@@ -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();
}