Fix null issues with custom observation convention
- Relax null constraints for custom observation convention in AbstractVectorStoreBuilder
This commit is contained in:
@@ -72,7 +72,6 @@ public abstract class AbstractVectorStoreBuilder<T extends AbstractVectorStoreBu
|
||||
|
||||
@Override
|
||||
public T customObservationConvention(VectorStoreObservationConvention convention) {
|
||||
Assert.notNull(convention, "VectorStoreObservationConvention must not be null");
|
||||
this.customObservationConvention = convention;
|
||||
return self();
|
||||
}
|
||||
|
||||
@@ -86,17 +86,14 @@ public class ChromaVectorStoreAutoConfiguration {
|
||||
ChromaVectorStoreProperties storeProperties, ObjectProvider<ObservationRegistry> observationRegistry,
|
||||
ObjectProvider<VectorStoreObservationConvention> customObservationConvention,
|
||||
BatchingStrategy chromaBatchingStrategy) {
|
||||
ChromaVectorStore.ChromaBuilder chromaBuilder = ChromaVectorStore.builder(chromaApi)
|
||||
return ChromaVectorStore.builder(chromaApi)
|
||||
.embeddingModel(embeddingModel)
|
||||
.collectionName(storeProperties.getCollectionName())
|
||||
.initializeSchema(storeProperties.isInitializeSchema())
|
||||
.observationRegistry(observationRegistry.getIfUnique(() -> ObservationRegistry.NOOP))
|
||||
.batchingStrategy(chromaBatchingStrategy);
|
||||
VectorStoreObservationConvention observationConvention = customObservationConvention.getIfAvailable();
|
||||
if (observationConvention != null) {
|
||||
chromaBuilder.customObservationConvention(observationConvention);
|
||||
}
|
||||
return chromaBuilder.build();
|
||||
.customObservationConvention(customObservationConvention.getIfAvailable(() -> null))
|
||||
.batchingStrategy(chromaBatchingStrategy)
|
||||
.build();
|
||||
}
|
||||
|
||||
static class PropertiesChromaConnectionDetails implements ChromaConnectionDetails {
|
||||
|
||||
Reference in New Issue
Block a user