|
22 | 22 | import org.springframework.ai.embedding.BatchingStrategy; |
23 | 23 | import org.springframework.ai.embedding.EmbeddingModel; |
24 | 24 | import org.springframework.ai.embedding.TokenCountBatchingStrategy; |
25 | | -import org.springframework.ai.vectorstore.RedisVectorStore; |
26 | | -import org.springframework.ai.vectorstore.RedisVectorStore.RedisVectorStoreConfig; |
| 25 | +import org.springframework.ai.redis.vectorstore.RedisVectorStore; |
| 26 | +import org.springframework.ai.redis.vectorstore.RedisVectorStore.RedisVectorStoreConfig; |
27 | 27 | import org.springframework.ai.vectorstore.observation.VectorStoreObservationConvention; |
28 | 28 | import org.springframework.beans.factory.ObjectProvider; |
29 | 29 | import org.springframework.boot.autoconfigure.AutoConfiguration; |
@@ -61,15 +61,16 @@ public RedisVectorStore vectorStore(EmbeddingModel embeddingModel, RedisVectorSt |
61 | 61 | ObjectProvider<VectorStoreObservationConvention> customObservationConvention, |
62 | 62 | BatchingStrategy batchingStrategy) { |
63 | 63 |
|
64 | | - var config = RedisVectorStoreConfig.builder() |
65 | | - .withIndexName(properties.getIndex()) |
66 | | - .withPrefix(properties.getPrefix()) |
| 64 | + return RedisVectorStore |
| 65 | + .builder(new JedisPooled(jedisConnectionFactory.getHostName(), jedisConnectionFactory.getPort())) |
| 66 | + .embeddingModel(embeddingModel) |
| 67 | + .initializeSchema(properties.isInitializeSchema()) |
| 68 | + .observationRegistry(observationRegistry.getIfUnique(() -> ObservationRegistry.NOOP)) |
| 69 | + .customObservationConvention(customObservationConvention.getIfAvailable(() -> null)) |
| 70 | + .batchingStrategy(batchingStrategy) |
| 71 | + .indexName(properties.getIndex()) |
| 72 | + .prefix(properties.getPrefix()) |
67 | 73 | .build(); |
68 | | - |
69 | | - return new RedisVectorStore(config, embeddingModel, |
70 | | - new JedisPooled(jedisConnectionFactory.getHostName(), jedisConnectionFactory.getPort()), |
71 | | - properties.isInitializeSchema(), observationRegistry.getIfUnique(() -> ObservationRegistry.NOOP), |
72 | | - customObservationConvention.getIfAvailable(() -> null), batchingStrategy); |
73 | 74 | } |
74 | 75 |
|
75 | 76 | } |
0 commit comments