Skip to content

Commit d45ff8e

Browse files
committed
Refactorings
- Avoid overlapping package names Changed in spring-ai-commons package from org.sf.ai.model to org.sf.ai.content Refactor advisor module name to be spring-ai-advisors-vector-store Moved advisors into org.springframework.ai.chat.client.advisor.vectorstore - Created top level memory directory - Create new module spring-ai-model-chat-memory-neo4j and moved neo4j memory classes out of the vectorstore module Updated neo4j autoconfiguation
1 parent e3f9b7c commit d45ff8e

File tree

67 files changed

+152
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+152
-77
lines changed

advisors/spring-ai-advisors/pom.xml renamed to advisors/spring-ai-advisors-vector-store/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<version>1.0.0-SNAPSHOT</version>
2525
<relativePath>../../pom.xml</relativePath>
2626
</parent>
27-
<artifactId>spring-ai-advisors</artifactId>
27+
<artifactId>spring-ai-advisors-vector-store</artifactId>
2828
<packaging>jar</packaging>
2929
<name>Spring AI Advisors</name>
3030
<description>Chat client advisors for Spring AI</description>

advisors/spring-ai-advisors/src/main/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisor.java renamed to advisors/spring-ai-advisors-vector-store/src/main/java/org/springframework/ai/chat/client/advisor/vectorstore/QuestionAnswerAdvisor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.ai.chat.client.advisor;
17+
package org.springframework.ai.chat.client.advisor.vectorstore;
1818

1919
import java.util.HashMap;
2020
import java.util.List;

advisors/spring-ai-advisors/src/main/java/org/springframework/ai/chat/client/advisor/VectorStoreChatMemoryAdvisor.java renamed to advisors/spring-ai-advisors-vector-store/src/main/java/org/springframework/ai/chat/client/advisor/vectorstore/VectorStoreChatMemoryAdvisor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.ai.chat.client.advisor;
17+
package org.springframework.ai.chat.client.advisor.vectorstore;
1818

1919
import java.util.HashMap;
2020
import java.util.List;
@@ -23,6 +23,7 @@
2323

2424
import reactor.core.publisher.Flux;
2525

26+
import org.springframework.ai.chat.client.advisor.AbstractChatMemoryAdvisor;
2627
import org.springframework.ai.chat.client.advisor.api.AdvisedRequest;
2728
import org.springframework.ai.chat.client.advisor.api.AdvisedResponse;
2829
import org.springframework.ai.chat.client.advisor.api.Advisor;

advisors/spring-ai-advisors/src/main/java/org/springframework/ai/chat/client/advisor/package-info.java renamed to advisors/spring-ai-advisors-vector-store/src/main/java/org/springframework/ai/chat/client/advisor/vectorstore/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
@NonNullApi
2121
@NonNullFields
22-
package org.springframework.ai.chat.client.advisor;
22+
package org.springframework.ai.chat.client.advisor.vectorstore;
2323

2424
import org.springframework.lang.NonNullApi;
2525
import org.springframework.lang.NonNullFields;

advisors/spring-ai-advisors/src/test/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisorTests.java renamed to advisors/spring-ai-advisors-vector-store/src/test/java/org/springframework/ai/chat/client/advisor/vectorstore/QuestionAnswerAdvisorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.ai.chat.client.advisor;
17+
package org.springframework.ai.chat.client.advisor.vectorstore;
1818

1919
import java.time.Duration;
2020
import java.util.List;

auto-configurations/models/chat/memory/spring-ai-autoconfigure-model-chat-memory-neo4j/pom.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,11 @@
2626

2727
<dependency>
2828
<groupId>org.springframework.ai</groupId>
29-
<artifactId>spring-ai-client-chat</artifactId>
29+
<artifactId>spring-ai-model-chat-memory-neo4j</artifactId>
3030
<version>${project.parent.version}</version>
3131
</dependency>
3232

33-
<dependency>
34-
<groupId>org.springframework.ai</groupId>
35-
<artifactId>spring-ai-neo4j-store</artifactId>
36-
<version>${project.parent.version}</version>
37-
</dependency>
33+
3834

3935
<!-- Boot dependencies -->
4036
<dependency>

auto-configurations/models/chat/memory/spring-ai-autoconfigure-model-chat-memory-neo4j/src/test/java/org/springframework/ai/model/chat/memory/neo4j/autoconfigure/Neo4jChatMemoryAutoConfigurationIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import org.springframework.ai.chat.messages.ToolResponseMessage;
3737
import org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse;
3838
import org.springframework.ai.chat.messages.UserMessage;
39-
import org.springframework.ai.model.Media;
39+
import org.springframework.ai.content.Media;
4040
import org.springframework.boot.autoconfigure.AutoConfigurations;
4141
import org.springframework.boot.autoconfigure.neo4j.Neo4jAutoConfiguration;
4242
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2023-2024 the original author or authors.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<project xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.springframework.ai</groupId>
24+
<artifactId>spring-ai</artifactId>
25+
<version>1.0.0-SNAPSHOT</version>
26+
<relativePath>../../pom.xml</relativePath>
27+
</parent>
28+
29+
<artifactId>spring-ai-model-chat-memory-neo4j</artifactId>
30+
<name>Spring AI Neo4j Chat Memory</name>
31+
<description>Spring AI Neo4j Chat Memory implementation</description>
32+
33+
<dependencies>
34+
<dependency>
35+
<groupId>org.springframework.ai</groupId>
36+
<artifactId>spring-ai-client-chat</artifactId>
37+
<version>${project.version}</version>
38+
</dependency>
39+
40+
<dependency>
41+
<groupId>org.springframework.data</groupId>
42+
<artifactId>spring-data-neo4j</artifactId>
43+
</dependency>
44+
45+
<dependency>
46+
<groupId>org.springframework.boot</groupId>
47+
<artifactId>spring-boot-starter-test</artifactId>
48+
<scope>test</scope>
49+
</dependency>
50+
51+
<dependency>
52+
<groupId>org.springframework.ai</groupId>
53+
<artifactId>spring-ai-test</artifactId>
54+
<version>${project.version}</version>
55+
<scope>test</scope>
56+
</dependency>
57+
58+
<dependency>
59+
<groupId>org.springframework.boot</groupId>
60+
<artifactId>spring-boot-testcontainers</artifactId>
61+
<scope>test</scope>
62+
</dependency>
63+
64+
<dependency>
65+
<groupId>org.neo4j.driver</groupId>
66+
<artifactId>neo4j-java-driver</artifactId>
67+
</dependency>
68+
69+
<dependency>
70+
<groupId>org.testcontainers</groupId>
71+
<artifactId>neo4j</artifactId>
72+
<scope>test</scope>
73+
</dependency>
74+
</dependencies>
75+
76+
</project>

0 commit comments

Comments
 (0)