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: README.md
+2-135Lines changed: 2 additions & 135 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,147 +10,14 @@ For further information go to our [Spring AI reference documentation](https://do
10
10
11
11
## Breaking changes
12
12
13
-
On our march to release 1.0.0 M1 we have made several breaking changes. Apologies, it is for the best!
14
-
15
-
**(22.05.2024)**
16
-
17
-
A major change was made that took the 'old' `ChatClient` and moved the functionality into `ChatModel`. The 'new' `ChatClient` now takes an instance of `ChatModel`. This was done do support a fluent API for creating and executing prompts in a style similar to other client classes in the Spring ecosystem, such as `RestClient`, `WebClient`, and `JdbcClient`. Refer to the [JavaDoc](https://docs.spring.io/spring-ai/docs/1.0.0-SNAPSHOT/api/) for more information on the Fluent API, proper reference documentation is coming shortly.
18
-
19
-
We renamed the 'old' `ModelClient` to `Model` and renamed implementing classes, for example `ImageClient` was renamed to `ImageModel`. The `Model` implementation represent the portability layer that converts between the Spring AI API and the underlying AI Model API.
20
-
21
-
### Adapting to the changes
22
-
23
-
NOTE: The `ChatClient` class is now in the package `org.springframework.ai.chat.client`
24
-
25
-
#### Approach 1
26
-
27
-
Now, instead of getting an Autoconfigured `ChatClient` instance, you will get a `ChatModel` instance. The `call` method signatures after renaming remain the same.
28
-
To adapt your code should refactor you code to change use of the type `ChatClient` to `ChatModel`
29
-
Here is an example of existing code before the change
NOTE: The `ChatModel` instance is made available to you through autoconfiguration.
124
-
125
-
#### Approach 3
126
-
127
-
There is a tag in the GitHub repository called [v1.0.0-SNAPSHOT-before-chatclient-changes](https://github.com/spring-projects/spring-ai/tree/v1.0.0-SNAPSHOT-before-chatclient-changes) that you can checkout and do a local build to avoid updating any of your code until you are ready to migrate your code base.
Copy file name to clipboardExpand all lines: spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chatclient.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -181,7 +181,7 @@ After specifying the `stream` method on `ChatClient`, there are a few options fo
181
181
== Using Defaults
182
182
183
183
Creating a ChatClient with default system text in an `@Configuration` class simplifies runtime code.
184
-
By setting defaults, you only need to specify user text when calling `ChatClient, eliminating the need to set system text for each request in your runtime codeala path.
184
+
By setting defaults, you only need to specify user text when calling `ChatClient`, eliminating the need to set system text for each request in your runtime code path.
Copy file name to clipboardExpand all lines: spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc
+137Lines changed: 137 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,143 @@
1
1
[[upgrade-notes]]
2
2
= Upgrading Notes
3
3
4
+
== Upgrading to 1.0.0.M1
5
+
6
+
On our march to release 1.0.0 M1 we have made several breaking changes. Apologies, it is for the best!
7
+
8
+
=== ChatClient changes
9
+
10
+
A major change was made that took the 'old' `ChatClient` and moved the functionality into `ChatModel`. The 'new' `ChatClient` now takes an instance of `ChatModel`. This was done do support a fluent API for creating and executing prompts in a style similar to other client classes in the Spring ecosystem, such as `RestClient`, `WebClient`, and `JdbcClient`. Refer to the [JavaDoc](https://docs.spring.io/spring-ai/docs/1.0.0-SNAPSHOT/api/) for more information on the Fluent API, proper reference documentation is coming shortly.
11
+
12
+
We renamed the 'old' `ModelClient` to `Model` and renamed implementing classes, for example `ImageClient` was renamed to `ImageModel`. The `Model` implementation represent the portability layer that converts between the Spring AI API and the underlying AI Model API.
13
+
14
+
### Adapting to the changes
15
+
16
+
NOTE: The `ChatClient` class is now in the package `org.springframework.ai.chat.client`
17
+
18
+
#### Approach 1
19
+
20
+
Now, instead of getting an Autoconfigured `ChatClient` instance, you will get a `ChatModel` instance. The `call` method signatures after renaming remain the same.
21
+
To adapt your code should refactor you code to change use of the type `ChatClient` to `ChatModel`
22
+
Here is an example of existing code before the change
23
+
24
+
```java
25
+
@RestController
26
+
public class OldSimpleAiController {
27
+
28
+
private final ChatClient chatClient;
29
+
30
+
public OldSimpleAiController(ChatClient chatClient) {
31
+
this.chatClient = chatClient;
32
+
}
33
+
34
+
@GetMapping("/ai/simple")
35
+
Map<String, String> completion(@RequestParam(value = "message", defaultValue = "Tell me a joke") String message) {
NOTE: The `ChatModel` instance is made available to you through autoconfiguration.
117
+
118
+
#### Approach 3
119
+
120
+
There is a tag in the GitHub repository called [v1.0.0-SNAPSHOT-before-chatclient-changes](https://github.com/spring-projects/spring-ai/tree/v1.0.0-SNAPSHOT-before-chatclient-changes) that you can checkout and do a local build to avoid updating any of your code until you are ready to migrate your code base.
Former `spring-ai-vertex-ai` has been renamed to `spring-ai-vertex-ai-palm2` and `spring-ai-vertex-ai-spring-boot-starter` has been renamed to `spring-ai-vertex-ai-palm2-spring-boot-starter`.
0 commit comments