|
27 | 27 | import org.springframework.ai.embedding.BatchingStrategy;
|
28 | 28 | import org.springframework.ai.embedding.EmbeddingModel;
|
29 | 29 | import org.springframework.ai.embedding.TokenCountBatchingStrategy;
|
30 |
| -import org.springframework.ai.vectorstore.MilvusVectorStore; |
31 |
| -import org.springframework.ai.vectorstore.MilvusVectorStore.MilvusVectorStoreConfig; |
| 30 | +import org.springframework.ai.milvus.vectorstore.MilvusVectorStore; |
| 31 | +import org.springframework.ai.milvus.vectorstore.MilvusVectorStore.MilvusVectorStoreConfig; |
32 | 32 | import org.springframework.ai.vectorstore.observation.VectorStoreObservationConvention;
|
33 | 33 | import org.springframework.beans.factory.ObjectProvider;
|
34 | 34 | import org.springframework.boot.autoconfigure.AutoConfiguration;
|
@@ -71,23 +71,14 @@ public MilvusVectorStore vectorStore(MilvusServiceClient milvusClient, Embedding
|
71 | 71 | ObjectProvider<ObservationRegistry> observationRegistry,
|
72 | 72 | ObjectProvider<VectorStoreObservationConvention> customObservationConvention) {
|
73 | 73 |
|
74 |
| - MilvusVectorStoreConfig config = MilvusVectorStoreConfig.builder() |
75 |
| - .withCollectionName(properties.getCollectionName()) |
76 |
| - .withDatabaseName(properties.getDatabaseName()) |
77 |
| - .withIndexType(IndexType.valueOf(properties.getIndexType().name())) |
78 |
| - .withMetricType(MetricType.valueOf(properties.getMetricType().name())) |
79 |
| - .withIndexParameters(properties.getIndexParameters()) |
80 |
| - .withEmbeddingDimension(properties.getEmbeddingDimension()) |
81 |
| - .withIDFieldName(properties.getIdFieldName()) |
82 |
| - .withAutoId(properties.isAutoId()) |
83 |
| - .withContentFieldName(properties.getContentFieldName()) |
84 |
| - .withMetadataFieldName(properties.getMetadataFieldName()) |
85 |
| - .withEmbeddingFieldName(properties.getEmbeddingFieldName()) |
| 74 | + return MilvusVectorStore.builder() |
| 75 | + .milvusClient(milvusClient) |
| 76 | + .embeddingModel(embeddingModel) |
| 77 | + .initializeSchema(properties.isInitializeSchema()) |
| 78 | + .batchingStrategy(batchingStrategy) |
| 79 | + .observationRegistry(observationRegistry.getIfUnique(() -> ObservationRegistry.NOOP)) |
| 80 | + .customObservationConvention(customObservationConvention.getIfAvailable(() -> null)) |
86 | 81 | .build();
|
87 |
| - |
88 |
| - return new MilvusVectorStore(milvusClient, embeddingModel, config, properties.isInitializeSchema(), |
89 |
| - batchingStrategy, observationRegistry.getIfUnique(() -> ObservationRegistry.NOOP), |
90 |
| - customObservationConvention.getIfAvailable(() -> null)); |
91 | 82 | }
|
92 | 83 |
|
93 | 84 | @Bean
|
|
0 commit comments