From 8ca3d41e68adfa0ad9a5ad93de8f86bfabc370b3 Mon Sep 17 00:00:00 2001 From: Ilayaperumal Gopinathan Date: Wed, 2 Apr 2025 16:09:49 +0100 Subject: [PATCH] Refactoring cleanup - Update Spring AI BOM with the newly added modules - Remove unnecessary dependencies from the modules' POM file --- .../spring-ai-advisors-vector-store/pom.xml | 36 +------------ .../ChatObservationAutoConfiguration.java | 3 +- .../pom.xml | 2 +- .../ai/chat/memory/neo4j/Neo4jChatMemory.java | 14 ++++- spring-ai-bom/pom.xml | 54 +++++++++++++++++++ spring-ai-client-chat/pom.xml | 32 +---------- .../ai/aot/SpringAiCoreRuntimeHints.java | 3 +- spring-ai-commons/pom.xml | 1 - spring-ai-model/pom.xml | 14 +---- spring-ai-rag/pom.xml | 28 ---------- spring-ai-test/pom.xml | 6 +++ spring-ai-vector-store/pom.xml | 20 ------- .../spring-ai-azure-cosmos-db-store/pom.xml | 2 +- vector-stores/spring-ai-azure-store/pom.xml | 2 +- .../spring-ai-cassandra-store/pom.xml | 2 +- vector-stores/spring-ai-chroma-store/pom.xml | 2 +- .../spring-ai-coherence-store/pom.xml | 2 +- .../spring-ai-couchbase-store/pom.xml | 2 +- .../spring-ai-elasticsearch-store/pom.xml | 2 +- vector-stores/spring-ai-gemfire-store/pom.xml | 2 +- vector-stores/spring-ai-hanadb-store/pom.xml | 2 +- vector-stores/spring-ai-mariadb-store/pom.xml | 2 +- vector-stores/spring-ai-milvus-store/pom.xml | 2 +- .../spring-ai-mongodb-atlas-store/pom.xml | 2 +- .../spring-ai-opensearch-store/pom.xml | 2 +- vector-stores/spring-ai-oracle-store/pom.xml | 2 +- .../spring-ai-pgvector-store/pom.xml | 2 +- .../spring-ai-pinecone-store/pom.xml | 2 +- vector-stores/spring-ai-qdrant-store/pom.xml | 2 +- vector-stores/spring-ai-redis-store/pom.xml | 2 +- .../spring-ai-typesense-store/pom.xml | 2 +- .../spring-ai-weaviate-store/pom.xml | 2 +- 32 files changed, 100 insertions(+), 153 deletions(-) diff --git a/advisors/spring-ai-advisors-vector-store/pom.xml b/advisors/spring-ai-advisors-vector-store/pom.xml index 4df992ddd..15b90e48d 100644 --- a/advisors/spring-ai-advisors-vector-store/pom.xml +++ b/advisors/spring-ai-advisors-vector-store/pom.xml @@ -1,6 +1,6 @@ - - org.springframework - spring-context - - - - com.fasterxml.jackson.core - jackson-databind - - - - io.projectreactor - reactor-core - - - - org.jetbrains.kotlin - kotlin-stdlib - true - - - - org.jetbrains.kotlin - kotlin-reflect - true - - org.springframework.boot spring-boot-starter-test test - - - com.fasterxml.jackson.module - jackson-module-kotlin - test - diff --git a/auto-configurations/models/chat/observation/spring-ai-autoconfigure-model-chat-observation/src/main/java/org/springframework/ai/model/chat/observation/autoconfigure/ChatObservationAutoConfiguration.java b/auto-configurations/models/chat/observation/spring-ai-autoconfigure-model-chat-observation/src/main/java/org/springframework/ai/model/chat/observation/autoconfigure/ChatObservationAutoConfiguration.java index 81aee1992..d4a4dc6cd 100644 --- a/auto-configurations/models/chat/observation/spring-ai-autoconfigure-model-chat-observation/src/main/java/org/springframework/ai/model/chat/observation/autoconfigure/ChatObservationAutoConfiguration.java +++ b/auto-configurations/models/chat/observation/spring-ai-autoconfigure-model-chat-observation/src/main/java/org/springframework/ai/model/chat/observation/autoconfigure/ChatObservationAutoConfiguration.java @@ -36,7 +36,6 @@ import org.springframework.ai.chat.observation.ChatModelPromptContentObservation import org.springframework.ai.embedding.observation.EmbeddingModelObservationContext; import org.springframework.ai.image.observation.ImageModelObservationContext; import org.springframework.ai.model.observation.ErrorLoggingObservationHandler; -import org.springframework.ai.vectorstore.observation.VectorStoreObservationContext; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; @@ -148,7 +147,7 @@ public class ChatObservationAutoConfiguration { return new ErrorLoggingObservationHandler(tracer, List.of(EmbeddingModelObservationContext.class, ImageModelObservationContext.class, ChatModelObservationContext.class, ChatClientObservationContext.class, - AdvisorObservationContext.class, VectorStoreObservationContext.class)); + AdvisorObservationContext.class)); } } diff --git a/auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-observation/pom.xml b/auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-observation/pom.xml index c25e6efc1..2ddb898d1 100644 --- a/auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-observation/pom.xml +++ b/auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-observation/pom.xml @@ -40,7 +40,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/memory/spring-ai-model-chat-memory-neo4j/src/main/java/org/springframework/ai/chat/memory/neo4j/Neo4jChatMemory.java b/memory/spring-ai-model-chat-memory-neo4j/src/main/java/org/springframework/ai/chat/memory/neo4j/Neo4jChatMemory.java index 61157c7f2..7fdcb9b1a 100644 --- a/memory/spring-ai-model-chat-memory-neo4j/src/main/java/org/springframework/ai/chat/memory/neo4j/Neo4jChatMemory.java +++ b/memory/spring-ai-model-chat-memory-neo4j/src/main/java/org/springframework/ai/chat/memory/neo4j/Neo4jChatMemory.java @@ -20,14 +20,24 @@ import org.neo4j.driver.Driver; import org.neo4j.driver.Result; import org.neo4j.driver.Transaction; import org.springframework.ai.chat.memory.ChatMemory; -import org.springframework.ai.chat.messages.*; +import org.springframework.ai.chat.messages.AssistantMessage; +import org.springframework.ai.chat.messages.Message; +import org.springframework.ai.chat.messages.MessageType; +import org.springframework.ai.chat.messages.SystemMessage; +import org.springframework.ai.chat.messages.ToolResponseMessage; +import org.springframework.ai.chat.messages.UserMessage; import org.springframework.ai.content.Media; import org.springframework.ai.content.MediaContent; import org.springframework.util.MimeType; import java.net.MalformedURLException; import java.net.URI; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; /** * Chat memory implementation using Neo4j. diff --git a/spring-ai-bom/pom.xml b/spring-ai-bom/pom.xml index c58e24f85..80f9a62ba 100644 --- a/spring-ai-bom/pom.xml +++ b/spring-ai-bom/pom.xml @@ -42,6 +42,46 @@ + + + + org.springframework.ai + spring-ai-commons + ${project.version} + + + + + + org.springframework.ai + spring-ai-model + ${project.version} + + + + + + org.springframework.ai + spring-ai-vector-store + ${project.version} + + + + + + org.springframework.ai + spring-ai-rag + ${project.version} + + + + + + org.springframework.ai + spring-ai-advisors-vector-store + ${project.version} + + @@ -100,6 +140,20 @@ ${project.version} + + + + org.springframework.ai + spring-ai-model-chat-memory-cassandra + ${project.version} + + + + org.springframework.ai + spring-ai-model-chat-memory-neo4j + ${project.version} + + diff --git a/spring-ai-client-chat/pom.xml b/spring-ai-client-chat/pom.xml index 0f6e70863..e296e6489 100644 --- a/spring-ai-client-chat/pom.xml +++ b/spring-ai-client-chat/pom.xml @@ -26,8 +26,8 @@ spring-ai-client-chat jar - Spring AI Core - Core domain for AI programming + Spring AI Chat Client + Spring AI Chat Client AI programming https://github.com/spring-projects/spring-ai @@ -38,18 +38,6 @@ - - org.springframework.ai - spring-ai-commons - ${project.version} - - - - org.springframework.ai - spring-ai-vector-store - ${project.version} - - org.springframework.ai spring-ai-model @@ -91,22 +79,6 @@ spring-messaging - - io.micrometer - micrometer-core - - - - io.micrometer - context-propagation - - - - io.micrometer - micrometer-tracing-bridge-otel - true - - com.knuddels jtokkit diff --git a/spring-ai-client-chat/src/main/java/org/springframework/ai/aot/SpringAiCoreRuntimeHints.java b/spring-ai-client-chat/src/main/java/org/springframework/ai/aot/SpringAiCoreRuntimeHints.java index 2c488914a..fa28973e5 100644 --- a/spring-ai-client-chat/src/main/java/org/springframework/ai/aot/SpringAiCoreRuntimeHints.java +++ b/spring-ai-client-chat/src/main/java/org/springframework/ai/aot/SpringAiCoreRuntimeHints.java @@ -55,8 +55,7 @@ public class SpringAiCoreRuntimeHints implements RuntimeHintsRegistrar { Method getName = ReflectionUtils.findMethod(FunctionCallback.class, "getName"); hints.reflection().registerMethod(getName, ExecutableMode.INVOKE); - for (var r : Set.of("antlr4/org/springframework/ai/vectorstore/filter/antlr4/Filters.g4", - "embedding/embedding-model-dimensions.properties")) { + for (var r : Set.of("embedding/embedding-model-dimensions.properties")) { hints.resources().registerResource(new ClassPathResource(r)); } diff --git a/spring-ai-commons/pom.xml b/spring-ai-commons/pom.xml index 40b2b4f19..4ad96220e 100644 --- a/spring-ai-commons/pom.xml +++ b/spring-ai-commons/pom.xml @@ -59,7 +59,6 @@ true - com.fasterxml.jackson.module jackson-module-jsonSchema diff --git a/spring-ai-model/pom.xml b/spring-ai-model/pom.xml index 5aa767ce5..500e3cfd2 100644 --- a/spring-ai-model/pom.xml +++ b/spring-ai-model/pom.xml @@ -47,17 +47,6 @@ ${project.parent.version} - - - org.springframework - spring-context - - - - com.fasterxml.jackson.core - jackson-databind - - io.micrometer micrometer-observation @@ -80,6 +69,7 @@ ${ST4.version} + org.antlr antlr4-runtime @@ -109,7 +99,7 @@ swagger-annotations ${swagger-annotations.version} - + org.jetbrains.kotlin kotlin-stdlib diff --git a/spring-ai-rag/pom.xml b/spring-ai-rag/pom.xml index 23aee038d..30f956ec9 100644 --- a/spring-ai-rag/pom.xml +++ b/spring-ai-rag/pom.xml @@ -54,34 +54,6 @@ ${project.parent.version} - - - org.springframework - spring-context - - - - com.fasterxml.jackson.core - jackson-databind - - - - io.projectreactor - reactor-core - - - - org.jetbrains.kotlin - kotlin-stdlib - true - - - - org.jetbrains.kotlin - kotlin-reflect - true - - org.springframework.boot diff --git a/spring-ai-test/pom.xml b/spring-ai-test/pom.xml index bc1ae117e..aaeeec2cc 100644 --- a/spring-ai-test/pom.xml +++ b/spring-ai-test/pom.xml @@ -56,6 +56,12 @@ ${project.version} + + org.springframework.ai + spring-ai-vector-store + ${project.version} + + org.springframework.boot spring-boot-starter-test diff --git a/spring-ai-vector-store/pom.xml b/spring-ai-vector-store/pom.xml index be547bdde..380d985d9 100644 --- a/spring-ai-vector-store/pom.xml +++ b/spring-ai-vector-store/pom.xml @@ -53,27 +53,7 @@ true - - - - org.antlr - antlr4-runtime - ${antlr.version} - - - - - org.springframework - spring-context - - - - - - - - org.springframework.boot diff --git a/vector-stores/spring-ai-azure-cosmos-db-store/pom.xml b/vector-stores/spring-ai-azure-cosmos-db-store/pom.xml index 9795d07fa..7a0330def 100644 --- a/vector-stores/spring-ai-azure-cosmos-db-store/pom.xml +++ b/vector-stores/spring-ai-azure-cosmos-db-store/pom.xml @@ -49,7 +49,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-azure-store/pom.xml b/vector-stores/spring-ai-azure-store/pom.xml index 329a4ebce..261d8455e 100644 --- a/vector-stores/spring-ai-azure-store/pom.xml +++ b/vector-stores/spring-ai-azure-store/pom.xml @@ -44,7 +44,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-cassandra-store/pom.xml b/vector-stores/spring-ai-cassandra-store/pom.xml index e186b9808..6710e3901 100644 --- a/vector-stores/spring-ai-cassandra-store/pom.xml +++ b/vector-stores/spring-ai-cassandra-store/pom.xml @@ -44,7 +44,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-chroma-store/pom.xml b/vector-stores/spring-ai-chroma-store/pom.xml index 2dd0cd867..63aebf3c8 100644 --- a/vector-stores/spring-ai-chroma-store/pom.xml +++ b/vector-stores/spring-ai-chroma-store/pom.xml @@ -40,7 +40,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-coherence-store/pom.xml b/vector-stores/spring-ai-coherence-store/pom.xml index 930036665..53dc5cc41 100644 --- a/vector-stores/spring-ai-coherence-store/pom.xml +++ b/vector-stores/spring-ai-coherence-store/pom.xml @@ -28,7 +28,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-couchbase-store/pom.xml b/vector-stores/spring-ai-couchbase-store/pom.xml index 087dc9876..75a592d89 100644 --- a/vector-stores/spring-ai-couchbase-store/pom.xml +++ b/vector-stores/spring-ai-couchbase-store/pom.xml @@ -29,7 +29,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${parent.version} diff --git a/vector-stores/spring-ai-elasticsearch-store/pom.xml b/vector-stores/spring-ai-elasticsearch-store/pom.xml index 379acb8f9..273df1cf9 100644 --- a/vector-stores/spring-ai-elasticsearch-store/pom.xml +++ b/vector-stores/spring-ai-elasticsearch-store/pom.xml @@ -46,7 +46,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-gemfire-store/pom.xml b/vector-stores/spring-ai-gemfire-store/pom.xml index 467c5a954..13afc1287 100644 --- a/vector-stores/spring-ai-gemfire-store/pom.xml +++ b/vector-stores/spring-ai-gemfire-store/pom.xml @@ -44,7 +44,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-hanadb-store/pom.xml b/vector-stores/spring-ai-hanadb-store/pom.xml index 9566097f5..f9e11ab12 100644 --- a/vector-stores/spring-ai-hanadb-store/pom.xml +++ b/vector-stores/spring-ai-hanadb-store/pom.xml @@ -45,7 +45,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-mariadb-store/pom.xml b/vector-stores/spring-ai-mariadb-store/pom.xml index b40e046c2..f3da3eb83 100644 --- a/vector-stores/spring-ai-mariadb-store/pom.xml +++ b/vector-stores/spring-ai-mariadb-store/pom.xml @@ -39,7 +39,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-milvus-store/pom.xml b/vector-stores/spring-ai-milvus-store/pom.xml index 5f50ccde4..dc7fdbba2 100644 --- a/vector-stores/spring-ai-milvus-store/pom.xml +++ b/vector-stores/spring-ai-milvus-store/pom.xml @@ -44,7 +44,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-mongodb-atlas-store/pom.xml b/vector-stores/spring-ai-mongodb-atlas-store/pom.xml index 6a9c837a0..0c3956762 100644 --- a/vector-stores/spring-ai-mongodb-atlas-store/pom.xml +++ b/vector-stores/spring-ai-mongodb-atlas-store/pom.xml @@ -43,7 +43,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-opensearch-store/pom.xml b/vector-stores/spring-ai-opensearch-store/pom.xml index be796d300..d2233c753 100644 --- a/vector-stores/spring-ai-opensearch-store/pom.xml +++ b/vector-stores/spring-ai-opensearch-store/pom.xml @@ -44,7 +44,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-oracle-store/pom.xml b/vector-stores/spring-ai-oracle-store/pom.xml index 89648657a..513d99340 100644 --- a/vector-stores/spring-ai-oracle-store/pom.xml +++ b/vector-stores/spring-ai-oracle-store/pom.xml @@ -44,7 +44,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-pgvector-store/pom.xml b/vector-stores/spring-ai-pgvector-store/pom.xml index b9ee543d5..878cd0a8c 100644 --- a/vector-stores/spring-ai-pgvector-store/pom.xml +++ b/vector-stores/spring-ai-pgvector-store/pom.xml @@ -44,7 +44,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-pinecone-store/pom.xml b/vector-stores/spring-ai-pinecone-store/pom.xml index deaaa0326..6a0236ec2 100644 --- a/vector-stores/spring-ai-pinecone-store/pom.xml +++ b/vector-stores/spring-ai-pinecone-store/pom.xml @@ -43,7 +43,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-qdrant-store/pom.xml b/vector-stores/spring-ai-qdrant-store/pom.xml index bb88611e3..08481c13e 100644 --- a/vector-stores/spring-ai-qdrant-store/pom.xml +++ b/vector-stores/spring-ai-qdrant-store/pom.xml @@ -44,7 +44,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-redis-store/pom.xml b/vector-stores/spring-ai-redis-store/pom.xml index 3d36ef800..98d8f8b86 100644 --- a/vector-stores/spring-ai-redis-store/pom.xml +++ b/vector-stores/spring-ai-redis-store/pom.xml @@ -46,7 +46,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-typesense-store/pom.xml b/vector-stores/spring-ai-typesense-store/pom.xml index 23053133d..5704369ad 100644 --- a/vector-stores/spring-ai-typesense-store/pom.xml +++ b/vector-stores/spring-ai-typesense-store/pom.xml @@ -45,7 +45,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version} diff --git a/vector-stores/spring-ai-weaviate-store/pom.xml b/vector-stores/spring-ai-weaviate-store/pom.xml index d4a3f8f92..0510e27d4 100644 --- a/vector-stores/spring-ai-weaviate-store/pom.xml +++ b/vector-stores/spring-ai-weaviate-store/pom.xml @@ -43,7 +43,7 @@ org.springframework.ai - spring-ai-client-chat + spring-ai-vector-store ${project.parent.version}