The goal is to support Spring Boot 3.4.x, 3.5.x, and Boot 4.0/Spring Framework 7 within the same branch/version of Spring AI
Spring AI depends on Boot only for the auto-configuraiton modules.
Spring AI has a tight dependency on Spring Framework web client classes such as WebClient and RestClient.
An initial pass to upgrade to Boot 4/ SF 7 was promising. See this diff on this branch.
Takeaways
- Create a wrapper class in RetryUtils so that the method signature change in
ResponseErrorHandler
is handled correctly for both a SF 6 and SF 7 code base. - the addAll method for headers has changed when using restClient/webClient. A workaround is to not call the newly changed method, but instead to iterate over the header map and use the 'add' method.
HttpHeaders
removed the method containsKey and replaced it with containsHeader. Instead can switch to useif (headers.get(headerName) != null)
in the code base as that will be portable between both SF 6 and SF 7ChatClientExtensions.kt
should use the more strict kotlin 2.1 enforced syntax, it will be compatible with kotlin 1.9- Boot 3.5 pulls in elasticsearch-java client 8.18 where as boot 3.4.5 pulls in elasticsearch-java client 8.15. This requires a code change to work with 8.18. Spring AI should take over the mgmt of this away from Spring Boot and use the 8.18 client always.
Comment From: prashant092-pc
Hi 👋 I’d like to work on this issue. Let me know if that's okay!"
Comment From: ThomasVitale
Will Spring AI 2.0 have a Spring Boot 4 baseline? It would be great if it was possible to use the new Programmatic Bean Registration APIs introduced in Spring Framework 7 to support auto-configuration of multiple beans of the same type, enabling auto-config for multiple ChatModels and ChatClients.