mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-16 21:33:40 +00:00
feat(knowledge): 实现Milvus向量库策略并重构配置管理
- 新增Milvus向量库策略实现类MilvusVectorStoreStrategy - 重构向量库配置管理,使用VectorStoreProperties统一配置 - 修改AbstractVectorStoreStrategy抽象类依赖注入方式 - 更新Weaviate策略实现类适配新的配置方式 - 移除旧的ConfigService配置读取方式 - 添加向量库类型配置项,默认使用weaviate - 实现Milvus集合创建、数据存储、向量搜索和删除功能 - 优化向量库策略工厂类VectorStoreStrategyFactory初始化逻辑 - 删除已废弃的Milvus实现指南文档 - 升级Milvus SDK版本并调整相关API调用方式
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package org.ruoyi.common.core.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 向量库配置属性
|
||||
*
|
||||
* @author ageer
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "vector-store")
|
||||
public class VectorStoreProperties {
|
||||
|
||||
/**
|
||||
* 向量库类型
|
||||
*/
|
||||
private String type = "weaviate";
|
||||
|
||||
/**
|
||||
* Weaviate配置
|
||||
*/
|
||||
private Weaviate weaviate = new Weaviate();
|
||||
|
||||
/**
|
||||
* Milvus配置
|
||||
*/
|
||||
private Milvus milvus = new Milvus();
|
||||
|
||||
@Data
|
||||
public static class Weaviate {
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
private String protocol = "http";
|
||||
|
||||
/**
|
||||
* 主机地址
|
||||
*/
|
||||
private String host = "localhost:8080";
|
||||
|
||||
/**
|
||||
* 类名
|
||||
*/
|
||||
private String classname = "Document";
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Milvus {
|
||||
/**
|
||||
* 连接URL
|
||||
*/
|
||||
private String url = "http://localhost:19530";
|
||||
|
||||
/**
|
||||
* 集合名称
|
||||
*/
|
||||
private String collectionname = "knowledge_base";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user