AI智能工牌的门店管理, 销售管理 , 项目管理, 客户管理, 设备管理, 录音管理, 视频管理 ,代码骨架
This commit is contained in:
@@ -88,7 +88,7 @@ public class EnbedingModelConfig {
|
||||
|
||||
// @Bean("myEmbeddingStoreInRedis") 不要打开,否则每次都会调用 阿里云的向量化模型 ,消耗token
|
||||
// @Primary
|
||||
public EmbeddingStore embeddingStoreInRedis() throws IOException {
|
||||
public EmbeddingStore embeddingStoreInRedis(EmbeddingStore redisEmbeddingStore) throws IOException {
|
||||
//1 , 加载知识库文档进 内存
|
||||
List<Document> documents1 = ClassPathDocumentLoader.loadDocuments("knowledge\\pdf",new ApachePdfBoxDocumentParser());
|
||||
// List<Document> documents2 = ClassPathDocumentLoader.loadDocuments("knowledge");
|
||||
@@ -107,9 +107,10 @@ public class EnbedingModelConfig {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ContentRetriever contentRetriever(){
|
||||
public ContentRetriever contentRetriever(@Qualifier("myEmbeddingStoreInMemory")EmbeddingStore store){
|
||||
EmbeddingStoreContentRetriever contentRetriever = EmbeddingStoreContentRetriever.builder()
|
||||
.embeddingStore(redisEmbeddingStore)
|
||||
// .embeddingStore(redisEmbeddingStore)
|
||||
.embeddingStore( redisEmbeddingStore)
|
||||
.embeddingModel(embeddingModel)
|
||||
.minScore(0.5)//相似度
|
||||
.maxResults(3) //最多返回3条
|
||||
|
||||
Reference in New Issue
Block a user