Commit ea5b12f21e2c0eb3e9e833b12e1af3bfad0681f1
1 parent
39ecf5eb
fix:【AI 大模型】RedisVectorStore 支持 username、password
Showing
2 changed files
with
3 additions
and
4 deletions
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/ai/core/AiModelFactoryImpl.java
| @@ -690,10 +690,9 @@ public class AiModelFactoryImpl implements AiModelFactory { | @@ -690,10 +690,9 @@ public class AiModelFactoryImpl implements AiModelFactory { | ||
| 690 | Map<String, Class<?>> metadataFields) { | 690 | Map<String, Class<?>> metadataFields) { |
| 691 | // 创建 JedisPooled 对象 | 691 | // 创建 JedisPooled 对象 |
| 692 | RedisProperties redisProperties = SpringUtils.getBean(RedisProperties.class); | 692 | RedisProperties redisProperties = SpringUtils.getBean(RedisProperties.class); |
| 693 | - JedisPooled jedisPooled = new JedisPooled(redisProperties.getHost(), redisProperties.getPort()); | 693 | + JedisPooled jedisPooled = new JedisPooled(redisProperties.getHost(), redisProperties.getPort(), |
| 694 | + redisProperties.getUsername(), redisProperties.getPassword()); | ||
| 694 | // 创建 RedisVectorStoreProperties 对象 | 695 | // 创建 RedisVectorStoreProperties 对象 |
| 695 | - // TODO @芋艿:index-name 可能影响索引名; | ||
| 696 | - RedisVectorStoreAutoConfiguration configuration = new RedisVectorStoreAutoConfiguration(); | ||
| 697 | RedisVectorStoreProperties properties = SpringUtil.getBean(RedisVectorStoreProperties.class); | 696 | RedisVectorStoreProperties properties = SpringUtil.getBean(RedisVectorStoreProperties.class); |
| 698 | RedisVectorStore redisVectorStore = RedisVectorStore.builder(jedisPooled, embeddingModel) | 697 | RedisVectorStore redisVectorStore = RedisVectorStore.builder(jedisPooled, embeddingModel) |
| 699 | .indexName(properties.getIndexName()).prefix(properties.getPrefix()) | 698 | .indexName(properties.getIndexName()).prefix(properties.getPrefix()) |
yudao-server/src/main/resources/application.yaml
| @@ -150,7 +150,7 @@ spring: | @@ -150,7 +150,7 @@ spring: | ||
| 150 | vectorstore: # 向量存储 | 150 | vectorstore: # 向量存储 |
| 151 | redis: | 151 | redis: |
| 152 | initialize-schema: true | 152 | initialize-schema: true |
| 153 | - index: knowledge_index # Redis 中向量索引的名称:用于存储和检索向量数据的索引标识符,所有相关的向量搜索操作都会基于这个索引进行 | 153 | + index-name: knowledge_index # Redis 中向量索引的名称:用于存储和检索向量数据的索引标识符,所有相关的向量搜索操作都会基于这个索引进行 |
| 154 | prefix: "knowledge_segment:" # Redis 中存储向量数据的键名前缀:这个前缀会添加到每个存储在 Redis 中的向量数据键名前,每个 document 都是一个 hash 结构 | 154 | prefix: "knowledge_segment:" # Redis 中存储向量数据的键名前缀:这个前缀会添加到每个存储在 Redis 中的向量数据键名前,每个 document 都是一个 hash 结构 |
| 155 | qdrant: | 155 | qdrant: |
| 156 | initialize-schema: true | 156 | initialize-schema: true |