Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove vector store related deprecations introduced in 1.0.0-M5 #2048

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
import org.springframework.ai.embedding.EmbeddingModel;
import org.springframework.ai.embedding.TokenCountBatchingStrategy;
import org.springframework.ai.vectorstore.cosmosdb.CosmosDBVectorStore;
import org.springframework.ai.vectorstore.cosmosdb.CosmosDBVectorStoreConfig;
import org.springframework.ai.vectorstore.observation.VectorStoreObservationConvention;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import java.util.List;

/**
* {@link AutoConfiguration Auto-configuration} for CosmosDB Vector Store.
Expand Down Expand Up @@ -71,14 +71,14 @@ public CosmosDBVectorStore cosmosDBVectorStore(ObservationRegistry observationRe
CosmosDBVectorStoreProperties properties, CosmosAsyncClient cosmosAsyncClient,
EmbeddingModel embeddingModel, BatchingStrategy batchingStrategy) {

CosmosDBVectorStoreConfig config = new CosmosDBVectorStoreConfig();
config.setDatabaseName(properties.getDatabaseName());
config.setContainerName(properties.getContainerName());
config.setMetadataFields(properties.getMetadataFields());
config.setVectorStoreThroughput(properties.getVectorStoreThroughput());
config.setVectorDimensions(properties.getVectorDimensions());
return new CosmosDBVectorStore(observationRegistry, customObservationConvention.getIfAvailable(),
cosmosAsyncClient, config, embeddingModel, batchingStrategy);
return CosmosDBVectorStore.builder(cosmosAsyncClient, embeddingModel)
.databaseName(properties.getDatabaseName())
.containerName(properties.getContainerName())
.metadataFields(List.of(properties.getMetadataFields()))
.vectorStoreThroughput(properties.getVectorStoreThroughput())
.vectorDimensions(properties.getVectorDimensions())
.build();

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.springframework.ai.embedding.EmbeddingModel;
import org.springframework.ai.embedding.TokenCountBatchingStrategy;
import org.springframework.ai.vectorstore.pinecone.PineconeVectorStore;
import org.springframework.ai.vectorstore.pinecone.PineconeVectorStore.PineconeVectorStoreConfig;
import org.springframework.ai.vectorstore.observation.VectorStoreObservationConvention;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.AutoConfiguration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2024 the original author or authors.
* Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,6 @@
import org.springframework.ai.embedding.EmbeddingModel;
import org.springframework.ai.embedding.TokenCountBatchingStrategy;
import org.springframework.ai.vectorstore.typesense.TypesenseVectorStore;
import org.springframework.ai.vectorstore.typesense.TypesenseVectorStore.TypesenseVectorStoreConfig;
import org.springframework.ai.vectorstore.observation.VectorStoreObservationConvention;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.AutoConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.junit.jupiter.api.Test;

import org.springframework.ai.vectorstore.cassandra.CassandraVectorStore;
import org.springframework.ai.vectorstore.cassandra.CassandraVectorStoreConfig;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2024 the original author or authors.
* Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -102,50 +102,6 @@ public class CosmosDBVectorStore extends AbstractObservationVectorStore implemen

private CosmosAsyncContainer container;

/**
* Creates a new CosmosDBVectorStore with basic configuration.
* @param observationRegistry the observation registry
* @param customObservationConvention the custom observation convention
* @param cosmosClient the Cosmos DB client
* @param properties the configuration properties
* @param embeddingModel the embedding model
* @deprecated Since 1.0.0-M5, use {@link #builder(CosmosAsyncClient, EmbeddingModel)}
* ()} instead
*/
@Deprecated(since = "1.0.0-M5", forRemoval = true)
public CosmosDBVectorStore(ObservationRegistry observationRegistry,
VectorStoreObservationConvention customObservationConvention, CosmosAsyncClient cosmosClient,
CosmosDBVectorStoreConfig properties, EmbeddingModel embeddingModel) {
this(observationRegistry, customObservationConvention, cosmosClient, properties, embeddingModel,
new TokenCountBatchingStrategy());
}

/**
* Creates a new CosmosDBVectorStore with full configuration.
* @param observationRegistry the observation registry
* @param customObservationConvention the custom observation convention
* @param cosmosClient the Cosmos DB client
* @param properties the configuration properties
* @param embeddingModel the embedding model
* @param batchingStrategy the batching strategy
* @deprecated Since 1.0.0-M5, use {@link #builder(CosmosAsyncClient, EmbeddingModel)}
* ()} instead
*/
@Deprecated(since = "1.0.0-M5", forRemoval = true)
public CosmosDBVectorStore(ObservationRegistry observationRegistry,
VectorStoreObservationConvention customObservationConvention, CosmosAsyncClient cosmosClient,
CosmosDBVectorStoreConfig properties, EmbeddingModel embeddingModel, BatchingStrategy batchingStrategy) {
this(builder(cosmosClient, embeddingModel).containerName(properties.getContainerName())
.databaseName(properties.getDatabaseName())
.partitionKeyPath(properties.getPartitionKeyPath())
.vectorStoreThroughput(properties.getVectorStoreThroughput())
.vectorDimensions(properties.getVectorDimensions())
.metadataFields(properties.getMetadataFieldsList())
.observationRegistry(observationRegistry)
.customObservationConvention(customObservationConvention)
.batchingStrategy(batchingStrategy));
}

/**
* Protected constructor that accepts a builder instance. This is the preferred way to
* create new CosmosDBVectorStore instances.
Expand Down

This file was deleted.

Loading
Loading