spring-ai
spring-ai copied to clipboard
Explicit AutoConfiguration import needed for VertexAiEmbeddingConnectionAutoConfiguration
trafficstars
With #4494, VertexAiEmbeddingConnectionAutoConfiguration (and a lot of others) are no longer included in @ImportAutoConfiguration annotations in the relevant AutoConfigurations for the models. However, they also aren't added to the org.springframework.boot.autoconfigure.AutoConfiguration.imports, meaning a using application would have to import the VertexAiEmbeddingConnectionAutoConfiguration themselves.
If you don't:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.ai.vertexai.embedding.VertexAiEmbeddingConnectionDetails' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:2314)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1733)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1653)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:913)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 45 more