You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc
+62-12Lines changed: 62 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -29,25 +29,50 @@ For details, refer to:
29
29
[[upgrading-to-1-0-0-RC1]]
30
30
== Upgrading to 1.0.0-RC1
31
31
32
-
=== Chat Client and Advisors
32
+
You can automate the upgrade process to 1.0.0-RC1 using an OpenRewrite recipe.
33
+
This recipe helps apply many of the necessary code changes for this version.
34
+
Find the recipe and usage instructions at https://github.com/arconia-io/arconia-migrations/blob/main/docs/spring-ai.md[Arconia Spring AI Migrations].
35
+
36
+
37
+
=== Feature Enhancements
33
38
34
39
* When building a `Prompt` from the ChatClient input, the `SystemMessage` built from `systemText()` is now placed first in the message list. Before, it was put last, resulting in errors with several model providers.
35
-
* `MessageAggregator` has a new method to aggregate messages from `ChatClientRequest`. The previous method aggregating messages from the old `AdvisedRequest` has been removed, since it was already marked as deprecated in M8.
40
+
41
+
=== Breaking Changes
42
+
43
+
==== Watson
44
+
The Watson AI model was removed as it was based on the older text generation that is considered outdated as there is a new chat generation model available.
45
+
Hopefully Watson will reappear in a future version of Spring AI
46
+
47
+
==== MoonShot and QianFan
48
+
49
+
Mooonshot and Qianfan have been removed since they are not accessible from outside China. These have been moved to the Spring AI Community repository.
50
+
51
+
==== Chat Client and Advisors
52
+
53
+
The main changes that impact end user code are:
54
+
* In `VectorStoreChatMemoryAdvisor`:
55
+
** The constant `CHAT_MEMORY_RETRIEVE_SIZE_KEY` has been renamed to `TOP_K`.
56
+
** The constant `DEFAULT_CHAT_MEMORY_RESPONSE_SIZE` (value: 100) has been renamed to `DEFAULT_TOP_K` with a new default value of 20.
57
+
58
+
* The constant `CHAT_MEMORY_CONVERSATION_ID_KEY` has been renamed to `CONVERSATION_ID` and moved from `AbstractChatMemoryAdvisor` to the `ChatMemory` interface. Update your imports to use `org.springframework.ai.chat.memory.ChatMemory.CONVERSATION_ID`.
59
+
60
+
Other changes are:
61
+
36
62
* In `SimpleLoggerAdvisor`, the `requestToString` input argument needs to be updated to use `ChatClientRequest`. It's a breaking change since the alternative was not part of M8 yet. Same thing about the constructor.
37
63
* `AbstractChatMemoryAdvisor` has been replaced with a `BaseChatMemoryAdvisor` interface in the `api` package. This is a breaking change for any code that directly extended `AbstractChatMemoryAdvisor`.
38
64
* Public constructors in `MessageChatMemoryAdvisor`, `PromptChatMemoryAdvisor`, and `VectorStoreChatMemoryAdvisor` have been made private. You must now use the builder pattern to create instances (e.g., `MessageChatMemoryAdvisor.builder(chatMemory).build()`).
39
-
* The constant `CHAT_MEMORY_CONVERSATION_ID_KEY` has been renamed to `CONVERSATION_ID` and moved from `AbstractChatMemoryAdvisor` to the `ChatMemory` interface. Update your imports to use `org.springframework.ai.chat.memory.ChatMemory.CONVERSATION_ID`.
40
65
* In `VectorStoreChatMemoryAdvisor`:
41
-
** The constant `DEFAULT_CHAT_MEMORY_RESPONSE_SIZE` (value: 100) has been renamed to `DEFAULT_TOP_K` with a new default value of 20.
42
66
** The builder method `chatMemoryRetrieveSize(int)` has been renamed to `defaultTopK(int)`. Update your code to use the new method name: `VectorStoreChatMemoryAdvisor.builder(vectorStore).defaultTopK(1).build()`.
43
67
** The `systemTextAdvise(String)` builder method has been removed. Use the `systemPromptTemplate(PromptTemplate)` method instead.
44
68
* In `PromptChatMemoryAdvisor`, the `systemTextAdvise(String)` builder method has been removed. Use the `systemPromptTemplate(PromptTemplate)` method instead.
45
69
* In `MessageChatMemoryAdvisor`, `PromptChatMemoryAdvisor`, and `VectorStoreChatMemoryAdvisor`, the `protectFromBlocking(boolean)` method has been removed. Use the `scheduler()` method instead. By default, the advisors protect from blocking, so you don't need to set this method unless you want to disable the protection or customize the Reactor Scheduler.
46
70
47
-
==== Self-contained Templates in Advisors
71
+
===== Self-contained Templates in Advisors
48
72
49
73
The built-in advisors that perform prompt augmentation have been updated to use self-contained templates. The goal is for each advisor to be able to perform templating operations without affecting nor being affected by templating and prompt decisions in other advisors.
50
-
If you were providing custom templates for the following advisors, you'll need to update them to ensure all expected placeholders are included.
74
+
75
+
*If you were providing custom templates for the following advisors, you'll need to update them to ensure all expected placeholders are included.*
51
76
52
77
* The `QuestionAnswerAdvisor` expects a template with the following placeholders (see xref:api/retrieval-augmented-generation.adoc#_questionansweradvisor[more details]):
53
78
** a `query` placeholder to receive the user question.
@@ -59,11 +84,6 @@ If you were providing custom templates for the following advisors, you'll need t
59
84
** an `instructions` placeholder to receive the original system message.
60
85
** a `long_term_memory` placeholder to receive the retrieved conversation memory.
61
86
62
-
=== Breaking Changes
63
-
64
-
The Watson AI model was removed as it was based on the older text generation that is considered outdated as there is a new chat generation model available.
65
-
Hopefully Watson will reappear in a future version of Spring AI
66
-
67
87
==== Chat Memory Repository Module and Autoconfiguration Renaming
68
88
69
89
In 1.0.0-RC1, the chat memory modules, starters, and autoconfiguration classes for Cassandra, JDBC, and Neo4j have been renamed to include the `repository` suffix for clarity. This impacts artifact IDs, Java package names, and class names. For example:
@@ -89,6 +109,36 @@ In 1.0.0-RC1, the chat memory modules, starters, and autoconfiguration classes f
89
109
- Update your Maven/Gradle dependencies to use the new artifact IDs.
90
110
- Update any imports, class references, or configuration that used the old package or class names.
91
111
112
+
=== Message Aggregator
113
+
114
+
* `MessageAggregator` has a new method to aggregate messages from `ChatClientRequest`. The previous method aggregating messages from the old `AdvisedRequest` has been removed, since it was already marked as deprecated in M8.
115
+
116
+
==== MessageAggregator Refactoring
117
+
118
+
===== Changes
119
+
120
+
* `MessageAggregator` class has been moved from `org.springframework.ai.chat.model` package in the `spring-ai-client-chat` module to the `spring-ai-model` module (same package name)
121
+
* The `aggregateChatClientResponse` method has been removed from `MessageAggregator` and moved to a new class `ChatClientMessageAggregator` in the `org.springframework.ai.chat.client` package
122
+
123
+
===== Migration Guide
124
+
125
+
If you were directly using the `aggregateChatClientResponse` method from `MessageAggregator`, you need to use the new `ChatClientMessageAggregator` class instead:
126
+
127
+
[source,java]
128
+
----
129
+
// Before
130
+
new MessageAggregator().aggregateChatClientResponse(chatClientResponses, aggregationHandler);
131
+
132
+
// After
133
+
new ChatClientMessageAggregator().aggregateChatClientResponse(chatClientResponses, aggregationHandler);
@@ -128,7 +178,7 @@ chatClient.prompt("What day is tomorrow?")
128
178
129
179
==== Why This Change Was Made
130
180
131
-
The Spring AI team renamed the overloaded `tools()` methods to improve clarity and prevent ambiguity in method dispatching. The previous API design led to confusion when the Java compiler needed to select between multiple overloaded methods based on parameter types.
181
+
The Spring AI team renamed the overloaded `tools()` methods to improve clarity and prevent ambiguity in method dispatchingbased on argument types.
0 commit comments