Skip to content

Commit b39805a

Browse files
committed
clean up upgrade-notes.adoc
1 parent c347c6f commit b39805a

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ This approach can save time and reduce the chance of errors when upgrading multi
4646
[[upgrading-to-1-0-0-m8]]
4747
== Upgrading to 1.0.0-M8
4848

49+
You can automate the upgrade process to 1.0.0-M8 using an OpenRewrite recipe.
50+
This recipe helps apply many of the necessary code changes for this version.
51+
Find the recipe and usage instructions at https://github.com/arconia-io/arconia-migrations/blob/main/docs/spring-ai.md[Arconia Spring AI Migrations].
52+
4953
=== Chat Client
5054

51-
* The `ChatClient` has been enhanced to solve some inconsistencies or unwanted behaviour whenever user and system prompts were not rendered before using them in an advisor. The new behavior ensures that the user and system prompts are always rendered before executing the chain of advisors. As part of this enhancement, the `AdvisedRequest` and `AdvisedResponse` APIs have been deprecated, replaced by `ChatClientRequest` and `ChatClientResponse`. Advisors now act on a fully built `Prompt` object included in a `ChatClientRequest` instead of the destructured format used in `AdvisedRequest`, guaranteeing consistency and completeness.
55+
* The `ChatClient` has been enhanced to solve some inconsistencies or unwanted behavior whenever user and system prompts were not rendered before using them in an advisor. The new behavior ensures that the user and system prompts are always rendered before executing the chain of advisors. As part of this enhancement, the `AdvisedRequest` and `AdvisedResponse` APIs have been deprecated, replaced by `ChatClientRequest` and `ChatClientResponse`. Advisors now act on a fully built `Prompt` object included in a `ChatClientRequest` instead of the destructured format used in `AdvisedRequest`, guaranteeing consistency and completeness.
5256

5357
For example, if you had a custom advisor that modified the request prompt in the `before` method, you would refactor it as follows:
5458

@@ -133,7 +137,8 @@ This change addresses potential confusion where the Java compiler might not sele
133137

134138
=== Prompt Templating and Advisors
135139

136-
Several classes and methods related to prompt creation and advisor customization have been deprecated in favor of more flexible approaches using the builder pattern and the `TemplateRenderer` interface.
140+
Several classes and methods related to prompt creation and advisor customization have been deprecated in favor of more flexible approaches using the builder pattern and the `TemplateRenderer` interface.
141+
See xref:api/prompt.adoc#_prompttemplate[PromptTemplate] for details on the new API.
137142

138143
==== PromptTemplate Deprecations
139144

@@ -614,7 +619,6 @@ new DefaultUsage(Long promptTokens, Long generationTokens, Long totalTokens)
614619
new DefaultUsage(Integer promptTokens, Integer completionTokens, Integer totalTokens)
615620
----
616621

617-
618622
NOTE: For more information on handling Usage, refer xref:api/usage-handling.adoc[here]
619623

620624
==== JSON Ser/Deser changes
@@ -666,7 +670,7 @@ NOTE: Refer to xref:api/chat/bedrock-converse.adoc[Bedrock Converse] documentati
666670

667671
=== Changes to use Spring Boot 3.4.2 for dependency management
668672

669-
Spring AI updates to use Spring Boot 3.4.2 for the dependency management. You can refer https://github.com/spring-projects/spring-boot/blob/v3.4.2/spring-boot-project/spring-boot-dependencies/build.gradle[here] for the dependencies which Spring Boot 3.4.2
673+
Spring AI updates to use Spring Boot 3.4.2 for the dependency management. You can refer https://github.com/spring-projects/spring-boot/blob/v3.4.2/spring-boot-project/spring-boot-dependencies/build.gradle[here] for the dependencies managed by Spring Boot 3.4.2
670674

671675
==== Required Actions
672676

@@ -732,18 +736,18 @@ On our march to release 1.0.0 M1 we have made several breaking changes. Apologi
732736

733737
=== ChatClient changes
734738

735-
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/api) for more information on the Fluent API, proper reference documentation is coming shortly.
739+
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 to 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/api) for more information on the Fluent API, proper reference documentation is coming shortly.
736740

737-
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.
741+
We renamed the 'old' `ModelClient` to `Model` and renamed implementing classes, for example `ImageClient` was renamed to `ImageModel`. The `Model` implementation represents the portability layer that converts between the Spring AI API and the underlying AI Model API.
738742

739743
### Adapting to the changes
740744

741745
NOTE: The `ChatClient` class is now in the package `org.springframework.ai.chat.client`
742746

743747
#### Approach 1
744748

745-
Now, instead of getting an Autoconfigured `ChatClient` instance, you will get a `ChatModel` instance. The `call` method signatures after renaming remain the same.
746-
To adapt your code should refactor you code to change use of the type `ChatClient` to `ChatModel`
749+
Now, instead of getting an Autoconfigured `ChatClient` instance, you will get a `ChatModel` instance. The `call` method signatures after renaming remain the same.
750+
To adapt your code should refactor your code to change the use of the type `ChatClient` to `ChatModel`
747751
Here is an example of existing code before the change
748752

749753
```java
@@ -837,12 +841,11 @@ class SimpleAiController {
837841
}
838842
```
839843

840-
841844
NOTE: The `ChatModel` instance is made available to you through autoconfiguration.
842845

843846
#### Approach 3
844847

845-
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.
848+
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 check out and do a local build to avoid updating any of your code until you are ready to migrate your code base.
846849

847850
```bash
848851
git checkout tags/v1.0.0-SNAPSHOT-before-chatclient-changes
@@ -918,14 +921,14 @@ to
918921

919922
=== January 24, 2024 Update
920923

921-
* Moving the `prompt` and `messages` and `metadata` packages to subpackages of `org.sf.ai.chat`
924+
* Moving the `prompt` and `messages` and `metadata` packages to subpackages of `org.springframework.ai.chat`
922925
* New functionality is *text to image* clients. Classes are `OpenAiImageModel` and `StabilityAiImageModel`. See the integration tests for usage, docs are coming soon.
923-
* A new package `model` that contains interfaces and base classes to support creating AI Model Clients for any input/output data type combination. At the moment the chat and image model packages implement this. We will be updating the embedding package to this new model soon.
924-
* A new "portable options" design pattern. We wanted to provide as much portability in the `ModelCall` as possible across different chat based AI Models. There is a common set of generation options and then those that are specific to a model provider. A sort of "duck typing" approach is used. `ModelOptions` in the model package is a marker interface indicating implementations of this class will provide the options for a model. See `ImageOptions`, a subinterface that defines portable options across all text->image `ImageModel` implementations. Then `StabilityAiImageOptions` and `OpenAiImageOptions` provide the options specific to each model provider. All options classes are created via a fluent API builder all can be passed into the portable `ImageModel` API. These option data types are using in autoconfiguration/configuration properties for the `ImageModel` implementations.
926+
* A new package `model` that contains interfaces and base classes to support creating AI Model Clients for any input/output data type combination. At the moment, the chat and image model packages implement this. We will be updating the embedding package to this new model soon.
927+
* A new "portable options" design pattern. We wanted to provide as much portability in the `ModelCall` as possible across different chat based AI Models. There is a common set of generation options and then those that are specific to a model provider. A sort of "duck typing" approach is used. `ModelOptions` in the model package is a marker interface indicating implementations of this class will provide the options for a model. See `ImageOptions`, a subinterface that defines portable options across all text->image `ImageModel` implementations. Then `StabilityAiImageOptions` and `OpenAiImageOptions` provide the options specific to each model provider. All options classes are created via a fluent API builder, all can be passed into the portable `ImageModel` API. These option data types are used in autoconfiguration/configuration properties for the `ImageModel` implementations.
925928

926929
=== January 13, 2024 Update
927930

928-
The following OpenAi Autoconfiguration chat properties has changed
931+
The following OpenAi Autoconfiguration chat properties have changed
929932

930933
* from `spring.ai.openai.model` to `spring.ai.openai.chat.options.model`.
931934
* from `spring.ai.openai.temperature` to `spring.ai.openai.chat.options.temperature`.

0 commit comments

Comments
 (0)