fix: Chroma VectorStore auto configuration
- Add null check for the Chroma vector store ObservationConvention - Since the builder enforces non null check, the ChromaVectorStore builder in its autoconfiguration will only set the ObservationConvention if it is not null.
This commit is contained in:
@@ -86,14 +86,17 @@ public class ChromaVectorStoreAutoConfiguration {
|
||||
ChromaVectorStoreProperties storeProperties, ObjectProvider<ObservationRegistry> observationRegistry,
|
||||
ObjectProvider<VectorStoreObservationConvention> customObservationConvention,
|
||||
BatchingStrategy chromaBatchingStrategy) {
|
||||
return ChromaVectorStore.builder(chromaApi)
|
||||
ChromaVectorStore.ChromaBuilder chromaBuilder = ChromaVectorStore.builder(chromaApi)
|
||||
.embeddingModel(embeddingModel)
|
||||
.collectionName(storeProperties.getCollectionName())
|
||||
.initializeSchema(storeProperties.isInitializeSchema())
|
||||
.observationRegistry(observationRegistry.getIfUnique(() -> ObservationRegistry.NOOP))
|
||||
.customObservationConvention(customObservationConvention.getIfAvailable(() -> null))
|
||||
.batchingStrategy(chromaBatchingStrategy)
|
||||
.build();
|
||||
.batchingStrategy(chromaBatchingStrategy);
|
||||
VectorStoreObservationConvention observationConvention = customObservationConvention.getIfAvailable();
|
||||
if (observationConvention != null) {
|
||||
chromaBuilder.customObservationConvention(observationConvention);
|
||||
}
|
||||
return chromaBuilder.build();
|
||||
}
|
||||
|
||||
static class PropertiesChromaConnectionDetails implements ChromaConnectionDetails {
|
||||
|
||||
Reference in New Issue
Block a user