Skip to content
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

Modularise Spring AI Spring Boot autoconfigurations #2289

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ilayaperumalg
Copy link
Member

@ilayaperumalg ilayaperumalg commented Feb 21, 2025

  • Split spring-ai-spring-boot-autoconfigure into modules

    • This PR addresses the restructuring of the following spring boot autoconfigurations:

      • spring-ai retry -> common
      • spring-ai chat client/model/memory -> chat
      • spring-ai chat/embedding/image observation -> observation
      • spring-ai chat/embedding models -> models
    • Update the Spring AI BOM and boot starters with the new autoconfigure modules

@ThomasVitale
Copy link
Contributor

ThomasVitale commented Feb 21, 2025

This modularisation track will be really beneficial, thank you!

Is the split between autoconfigure and starter modules necessary? I know that when Spring Boot started, the idea was to have an autoconfigure module separate from the starter modules so that users could build their own custom starters re-using the same autoconfigure module (one autoconfigure, multiple starters). I wonder if that's still a current requirement for Spring AI, considering there won't be a single autoconfigure module anymore.

For the sake of simplicity, I would consider moving the autconfiguration to the existing starter modules. So, for example, the Weaviate auto configuration would be placed in the spring-ai-weaviate-store-spring-boot-starter. Would that make sense?

@markpollack
Copy link
Member

markpollack commented Feb 21, 2025

There is a really good reason to keep it separate, but I’m embarrassed to say I can’t remember the argument presented to me. I think it along the lines keeping it separate is a better separation of concerns, I shouldn’t be forced to pick up autoconfig with a starter whose responsibility is dep mgmt. Let me sleep on it😁

@tzolov
Copy link
Contributor

tzolov commented Feb 21, 2025

@ThomasVitale,
The main reason to keep auto-configurations separate from boot starters is that you can compose auto-configurations but not boot starters. If auto-configurations are nested inside starter modules, they become unusable for composition.
So collocating auto-configs inside the starters doesn't seem a good idea.

   - Split spring-ai-spring-boot-autoconfigure into modules

     - This PR addresses the restructuring of the following spring boot autoconfigurations:

       - spring-ai retry -> common
       - spring-ai chat client/model/memory -> chat
       - spring-ai chat/embedding/image observation -> observation
       - spring-ai chat/embedding models -> models

     - Update the Spring AI BOM and boot starters with the new autoconfigure modules

Signed-off-by: Ilayaperumal Gopinathan <[email protected]>
@ilayaperumalg ilayaperumalg force-pushed the spring-boot-autoconfigs branch from 9895b6d to b73b93a Compare February 21, 2025 16:10
@ThomasVitale
Copy link
Contributor

Thanks for the explanation! That makes sense! I was more thinking about the "leaf" auto config (like "weaviate"), but I see that also in that case, if it ever needed to be composed into something else, having it inside the starter would be a limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants