Refactor VectorStoreObservationContext builder methods

This commit deprecates builder methods with the "with" prefix in the VectorStoreObservationContext class
and introduces new methods without the prefix for a cleaner API. For example:

withCollectionName() → collectionName()
withDimensions() → dimensions()
withNamespace() → namespace()

The old methods are marked as deprecated for maintaining backward compatibility.

All vector store implementations have been updated to use the new method names.
This commit is contained in:
Ilayaperumal Gopinathan
2024-12-18 14:34:15 +00:00
committed by Soby Chacko
parent 8ce8374825
commit 26fab03c2c
24 changed files with 137 additions and 77 deletions

View File

@@ -272,8 +272,8 @@ public class ChromaVectorStore extends AbstractObservationVectorStore implements
@Override
public VectorStoreObservationContext.Builder createObservationContextBuilder(String operationName) {
return VectorStoreObservationContext.builder(VectorStoreProvider.CHROMA.value(), operationName)
.withDimensions(this.embeddingModel.dimensions())
.withCollectionName(this.collectionName + ":" + this.collectionId);
.dimensions(this.embeddingModel.dimensions())
.collectionName(this.collectionName + ":" + this.collectionId);
}
public static class ChromaBuilder extends AbstractVectorStoreBuilder<ChromaBuilder> {