Skip to content

Commit 511ff56

Browse files
committed
Update Spring AI to 1.0.1
1 parent 2fd9c9e commit 511ff56

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ext.webjarsLocatorLiteVersion = "1.0.1"
3232
ext.webjarsFontawesomeVersion = "4.7.0"
3333
ext.webjarsBootstrapVersion = "5.3.3"
3434
ext.webjarsMarkedVersion = "14.1.2"
35-
ext.springAiVersion = "1.0.0-M8"
35+
ext.springAiVersion = "1.0.1"
3636

3737
dependencies {
3838
// Workaround for AOT issue (https://github.com/spring-projects/spring-framework/pull/33949) -->

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<maven-checkstyle.version>3.6.0</maven-checkstyle.version>
3939
<nohttp-checkstyle.version>0.0.11</nohttp-checkstyle.version>
4040
<spring-format.version>0.0.43</spring-format.version>
41-
<spring-ai.version>1.0.0-M8</spring-ai.version>
41+
<spring-ai.version>1.0.1</spring-ai.version>
4242
</properties>
4343

4444
<dependencies>

src/main/java/org/springframework/samples/petclinic/genai/ChatConfiguration.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@
2020
import org.springframework.ai.chat.client.advisor.MessageChatMemoryAdvisor;
2121
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
2222
import org.springframework.ai.chat.memory.ChatMemory;
23-
import org.springframework.ai.chat.memory.InMemoryChatMemory;
2423
import org.springframework.beans.factory.annotation.Value;
2524
import org.springframework.context.annotation.Bean;
2625
import org.springframework.context.annotation.Configuration;
2726
import org.springframework.core.io.Resource;
2827

29-
import static org.springframework.ai.chat.client.advisor.AbstractChatMemoryAdvisor.DEFAULT_CHAT_MEMORY_CONVERSATION_ID;
30-
3128
@Configuration
3229
class ChatConfiguration {
3330

@@ -40,7 +37,7 @@ ChatClient chatClient(ChatClient.Builder chatClientBuilder, ChatMemory chatMemor
4037
return chatClientBuilder
4138
.defaultAdvisors(
4239
// Chat memory helps us keep context when using the chatbot for up to 10 previous messages.
43-
new MessageChatMemoryAdvisor(chatMemory, DEFAULT_CHAT_MEMORY_CONVERSATION_ID, 10), // CHAT MEMORY
40+
MessageChatMemoryAdvisor.builder(chatMemory).build(),
4441
new SimpleLoggerAdvisor()
4542
)
4643
.defaultSystem(systemResource)
@@ -49,9 +46,4 @@ ChatClient chatClient(ChatClient.Builder chatClientBuilder, ChatMemory chatMemor
4946
// @formatter:on
5047
}
5148

52-
@Bean
53-
public ChatMemory chatMemory() {
54-
return new InMemoryChatMemory();
55-
}
56-
5749
}

0 commit comments

Comments
 (0)