Migrate Azure and CosmosDB vector store auto-configurations to dedicated modules
Update dependencies and module names in maven pom.xml files Update corresponding starter modules Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
This commit is contained in:
committed by
Mark Pollack
parent
505046749f
commit
fd1f0d9431
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-ai-autoconfigure-vector-store-azure-cosmos-db</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Spring AI Auto Configuration for Azure Cosmos DB vector store</name>
|
||||
<description>Spring AI Auto Configuration for Azure Cosmos DB vector store</description>
|
||||
<url>https://github.com/spring-projects/spring-ai</url>
|
||||
|
||||
<scm>
|
||||
<url>https://github.com/spring-projects/spring-ai</url>
|
||||
<connection>git://github.com/spring-projects/spring-ai.git</connection>
|
||||
<developerConnection>git@github.com:spring-projects/spring-ai.git</developerConnection>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
<!-- production dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-azure-cosmos-db-store</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-test</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-transformers</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ai.autoconfigure.vectorstore.cosmosdb;
|
||||
package org.springframework.ai.vectorstore.cosmosdb.autoconfigure;
|
||||
|
||||
import com.azure.cosmos.CosmosAsyncClient;
|
||||
import com.azure.cosmos.CosmosClientBuilder;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ai.autoconfigure.vectorstore.cosmosdb;
|
||||
package org.springframework.ai.vectorstore.cosmosdb.autoconfigure;
|
||||
|
||||
import org.springframework.ai.vectorstore.properties.CommonVectorStoreProperties;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# Copyright 2025-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.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
org.springframework.ai.vectorstore.cosmosdb.autoconfigure.CosmosDBVectorStoreAutoConfiguration
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ai.autoconfigure.vectorstore.cosmosdb;
|
||||
package org.springframework.ai.vectorstore.cosmosdb.autoconfigure;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-ai-autoconfigure-vector-store-azure</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Spring AI Auto Configuration for Azure vector store</name>
|
||||
<description>Spring AI Auto Configuration for Azure vector store</description>
|
||||
<url>https://github.com/spring-projects/spring-ai</url>
|
||||
|
||||
<scm>
|
||||
<url>https://github.com/spring-projects/spring-ai</url>
|
||||
<connection>git://github.com/spring-projects/spring-ai.git</connection>
|
||||
<developerConnection>git@github.com:spring-projects/spring-ai.git</developerConnection>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
<!-- production dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-azure-store</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-test</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-transformers</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ai.autoconfigure.vectorstore.azure;
|
||||
package org.springframework.ai.vectorstore.azure.autoconfigure;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ai.autoconfigure.vectorstore.azure;
|
||||
package org.springframework.ai.vectorstore.azure.autoconfigure;
|
||||
|
||||
import org.springframework.ai.vectorstore.properties.CommonVectorStoreProperties;
|
||||
import org.springframework.ai.vectorstore.azure.AzureVectorStore;
|
||||
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# Copyright 2025-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.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
org.springframework.ai.vectorstore.azure.autoconfigure.AzureVectorStoreAutoConfiguration
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ai.autoconfigure.vectorstore.azure;
|
||||
package org.springframework.ai.vectorstore.azure.autoconfigure;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -45,6 +45,7 @@ import org.springframework.core.io.DefaultResourceLoader;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.hamcrest.Matchers.hasSize;
|
||||
import static org.springframework.ai.test.vectorstore.ObservationTestUtil.assertObservationRegistry;
|
||||
|
||||
/**
|
||||
* @author Christian Tzolov
|
||||
@@ -112,9 +113,8 @@ public class AzureVectorStoreAutoConfigurationIT {
|
||||
.until(() -> vectorStore.similaritySearch(SearchRequest.builder().query("Spring").topK(1).build()),
|
||||
hasSize(1));
|
||||
|
||||
org.springframework.ai.autoconfigure.vectorstore.observation.ObservationTestUtil
|
||||
.assertObservationRegistry(observationRegistry, VectorStoreProvider.AZURE,
|
||||
VectorStoreObservationContext.Operation.ADD);
|
||||
assertObservationRegistry(observationRegistry, VectorStoreProvider.AZURE,
|
||||
VectorStoreObservationContext.Operation.ADD);
|
||||
observationRegistry.clear();
|
||||
|
||||
List<Document> results = vectorStore
|
||||
@@ -128,9 +128,8 @@ public class AzureVectorStoreAutoConfigurationIT {
|
||||
assertThat(resultDoc.getMetadata()).hasSize(2);
|
||||
assertThat(resultDoc.getMetadata()).containsKeys("spring", "distance");
|
||||
|
||||
org.springframework.ai.autoconfigure.vectorstore.observation.ObservationTestUtil
|
||||
.assertObservationRegistry(observationRegistry, VectorStoreProvider.AZURE,
|
||||
VectorStoreObservationContext.Operation.QUERY);
|
||||
assertObservationRegistry(observationRegistry, VectorStoreProvider.AZURE,
|
||||
VectorStoreObservationContext.Operation.QUERY);
|
||||
observationRegistry.clear();
|
||||
|
||||
// Remove all documents from the store
|
||||
@@ -140,9 +139,8 @@ public class AzureVectorStoreAutoConfigurationIT {
|
||||
.until(() -> vectorStore.similaritySearch(SearchRequest.builder().query("Spring").topK(1).build()),
|
||||
hasSize(0));
|
||||
|
||||
org.springframework.ai.autoconfigure.vectorstore.observation.ObservationTestUtil
|
||||
.assertObservationRegistry(observationRegistry, VectorStoreProvider.AZURE,
|
||||
VectorStoreObservationContext.Operation.DELETE);
|
||||
assertObservationRegistry(observationRegistry, VectorStoreProvider.AZURE,
|
||||
VectorStoreObservationContext.Operation.DELETE);
|
||||
observationRegistry.clear();
|
||||
|
||||
});
|
||||
6
pom.xml
6
pom.xml
@@ -66,6 +66,8 @@
|
||||
<module>auto-configurations/mcp/spring-ai-autoconfigure-mcp-client</module>
|
||||
<module>auto-configurations/mcp/spring-ai-autoconfigure-mcp-server</module>
|
||||
|
||||
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-azure</module>
|
||||
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-azure-cosmos-db</module>
|
||||
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-cassandra</module>
|
||||
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-chroma</module>
|
||||
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-elasticsearch</module>
|
||||
@@ -118,11 +120,11 @@
|
||||
<module>vector-stores/spring-ai-typesense-store</module>
|
||||
<module>vector-stores/spring-ai-weaviate-store</module>
|
||||
|
||||
<module>spring-ai-spring-boot-starters/spring-ai-starter-azure-cosmos-db-store</module>
|
||||
<module>spring-ai-spring-boot-starters/spring-ai-starter-azure-store</module>
|
||||
<module>spring-ai-spring-boot-starters/spring-ai-starter-coherence-store</module>
|
||||
<module>spring-ai-spring-boot-starters/spring-ai-starter-couchbase-store</module>
|
||||
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-aws-opensearch</module>
|
||||
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-azure</module>
|
||||
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-azure-cosmos-db</module>
|
||||
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-cassandra</module>
|
||||
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-chroma</module>
|
||||
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-elasticsearch</module>
|
||||
|
||||
@@ -132,14 +132,6 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- Azure Vector Store -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-azure-store</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- Vertex AI Embedding -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
|
||||
@@ -29,8 +29,6 @@ org.springframework.ai.autoconfigure.embedding.observation.EmbeddingObservationA
|
||||
org.springframework.ai.autoconfigure.image.observation.ImageObservationAutoConfiguration
|
||||
org.springframework.ai.model.ollama.autoconfigure.OllamaAutoConfiguration
|
||||
org.springframework.ai.model.mistralai.autoconfigure.MistralAiAutoConfiguration
|
||||
org.springframework.ai.autoconfigure.vectorstore.azure.AzureVectorStoreAutoConfiguration
|
||||
org.springframework.ai.autoconfigure.vectorstore.cosmosdb.CosmosDBVectorStoreAutoConfiguration
|
||||
org.springframework.ai.retry.autoconfigure.SpringAiRetryAutoConfiguration
|
||||
org.springframework.ai.model.postgresml.autoconfigure.PostgresMlAutoConfiguration
|
||||
org.springframework.ai.model.anthropic.autoconfigure.AnthropicAutoConfiguration
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-ai-azure-cosmos-db-store-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-vector-store-azure-cosmos-db</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Spring AI Starter - Azure Cosmos DB Vector Store</name>
|
||||
<description>Spring AI Azure Cosmos DB Vector Store Auto Configuration</description>
|
||||
<description>Spring AI Azure Cosmos DB Vector Store Starter</description>
|
||||
<url>https://github.com/spring-projects/spring-ai</url>
|
||||
|
||||
<scm>
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-spring-boot-autoconfigure</artifactId>
|
||||
<artifactId>spring-ai-autoconfigure-vector-store-azure-cosmos-db</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-ai-azure-store-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-vector-store-azure</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Spring AI Starter - Azure Vector Store</name>
|
||||
<description>Spring AI Azure Vector Store Auto Configuration</description>
|
||||
<description>Spring AI Azure Vector Store Starter</description>
|
||||
<url>https://github.com/spring-projects/spring-ai</url>
|
||||
|
||||
<scm>
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-spring-boot-autoconfigure</artifactId>
|
||||
<artifactId>spring-ai-autoconfigure-vector-store-azure</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
Reference in New Issue
Block a user