-
Notifications
You must be signed in to change notification settings - Fork 2k
Use methods from HttpHeaders which are available both from Spring 6 and Spring 7 #4817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…nd Spring 7 Signed-off-by: Filip Hrisafov <[email protected]>
|
Hi @filiphr, thanks for your PR that could be a good first step indeed. Forcing the use of spring-web 7 though (by adding <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>7.0.0-M8</version>
</dependency>
in the dependencies sections), and after skipping over some other deprecations, I still get a couple of wrong API usages (in hugging-face first, but there could be others). Could you take a look and try to cover the last extra mile? |
|
Thanks for reviewing @ericbottard, there were indeed some more spring-web 7 compilation problems. I have that fixed locally. I'll push it. I can also push a GitHub workflow that will run a compile with Spring 7. |
ad53fe4 to
fc89e2a
Compare
* Add GitHub Worklfow that runs the suite with Spring 7 * Uncomment `@Override` from methods implementing from ResponseHandler * Add custom ApiClient.mustache, original copied from https://github.com/swagger-api/swagger-codegen/blob/92fcc8196bd90fef199c2932903135e3b519f689/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache and adjusted the use of the HttpHeaders to be compliant with Spring 7 * Adjust ChatCLientExtensions.kt to be compatible with Kotlin 2 Signed-off-by: Filip Hrisafov <[email protected]>
fc89e2a to
6abae08
Compare
|
@ericbottard I've done the additional adjustments so that the entire code base can compile with Spring 7. I also added a GitHub workflow build so that a PR check is run with the compilation. The "biggest" change is the Let me know what you think |
Signed-off-by: Filip Hrisafov <[email protected]>
3f0f462 to
8dca2fa
Compare
|
|
||
| <!-- production dependencies --> | ||
| <spring-boot.version>3.5.7</spring-boot.version> | ||
| <spring-framework.version>6.2.12</spring-framework.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume changes to this file were not meant to be commited?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a spring_7 to the pr-check GitHub Action. It is needed if you would like to have that run always. If that's not something that you are interested then I will remove the changes in the pom.xml and remove the GitHub action.
|
@filiphr Thanks for your prompt replies. I'll bring up the discussion about this PR with the team today and gauge whether this is a smart inclusion for 1.1 |
|
Thanks a lot for considering this @ericbottard. I really hope that at least you will include the changes around the |
I know that Spring AI 1.x is only compatible with Spring Boot 3 and Spring 6. However, we are trying to migrate to Spring Boot 4 and keep using Spring AI 1.x. Once Spring AI 2.x is released we are going to migrate to it.
However, in the meantime it is not possible due to few things:
HttpHeaders- Use of certain methods fromHttpHeaderswhich are no longer available in Spring 7.This PR is trying to use alternative methods which are available both in Spring 6 and Spring 7. This means that things like the
OpenAiAPI,AnthropicApietc. can still be used on Spring 7.I hope that you can consider this PR and consider porting it to Spring AI 1.1.