-
Notifications
You must be signed in to change notification settings - Fork 1.9k
GH-868: Fix inconsistency in autoconfigured beans #1112
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
Conversation
@sobychacko , Perhaps we should crate a dedicated boot-starter for each Bedrock provider and then we can enable the models for this provider? |
* @since 0.8.0 | ||
*/ | ||
@AutoConfiguration | ||
@ConditionalOnClass(AnthropicChatBedrockApi.class) | ||
@EnableConfigurationProperties({ BedrockAnthropicChatProperties.class, BedrockAwsConnectionProperties.class }) | ||
@ConditionalOnProperty(prefix = BedrockAnthropicChatProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true") | ||
@ConditionalOnProperty(prefix = BedrockAnthropicChatProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true", | ||
matchIfMissing = true) |
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.
Because, currently, we are using a single boot starter for all Bedrock providers, the Bedrock models should be disabled by default.
* @since 0.8.0 | ||
*/ | ||
@AutoConfiguration | ||
@ConditionalOnClass(Anthropic3ChatBedrockApi.class) | ||
@EnableConfigurationProperties({ BedrockAnthropic3ChatProperties.class, BedrockAwsConnectionProperties.class }) | ||
@ConditionalOnProperty(prefix = BedrockAnthropic3ChatProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true") | ||
@ConditionalOnProperty(prefix = BedrockAnthropic3ChatProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true", | ||
matchIfMissing = true) |
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.
Because, currently, we are using a single boot starter for all Bedrock providers, the Bedrock models should be disabled by default.
* @since 0.8.0 | ||
*/ | ||
@AutoConfiguration | ||
@ConditionalOnClass(CohereChatBedrockApi.class) | ||
@EnableConfigurationProperties({ BedrockCohereChatProperties.class, BedrockAwsConnectionProperties.class }) | ||
@ConditionalOnProperty(prefix = BedrockCohereChatProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true") | ||
@ConditionalOnProperty(prefix = BedrockCohereChatProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true", | ||
matchIfMissing = true) |
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.
Because, currently, we are using a single boot starter for all Bedrock providers, the Bedrock models should be disabled by default.
* @since 0.8.0 | ||
*/ | ||
@AutoConfiguration | ||
@ConditionalOnClass(CohereEmbeddingBedrockApi.class) | ||
@EnableConfigurationProperties({ BedrockCohereEmbeddingProperties.class, BedrockAwsConnectionProperties.class }) | ||
@ConditionalOnProperty(prefix = BedrockCohereEmbeddingProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true") | ||
@ConditionalOnProperty(prefix = BedrockCohereEmbeddingProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true", | ||
matchIfMissing = true) |
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.
Because, currently, we are using a single boot starter for all Bedrock providers, the Bedrock models should be disabled by default.
* @since 1.0.0 | ||
*/ | ||
@AutoConfiguration | ||
@ConditionalOnClass(Ai21Jurassic2ChatBedrockApi.class) | ||
@EnableConfigurationProperties({ BedrockAi21Jurassic2ChatProperties.class, BedrockAwsConnectionProperties.class }) | ||
@ConditionalOnProperty(prefix = BedrockAi21Jurassic2ChatProperties.CONFIG_PREFIX, name = "enabled", | ||
havingValue = "true") | ||
havingValue = "true", matchIfMissing = true) |
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.
Because, currently, we are using a single boot starter for all Bedrock providers, the Bedrock models should be disabled by default.
@@ -44,7 +44,8 @@ | |||
@AutoConfiguration | |||
@ConditionalOnClass(LlamaChatBedrockApi.class) | |||
@EnableConfigurationProperties({ BedrockLlamaChatProperties.class, BedrockAwsConnectionProperties.class }) | |||
@ConditionalOnProperty(prefix = BedrockLlamaChatProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true") | |||
@ConditionalOnProperty(prefix = BedrockLlamaChatProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true", | |||
matchIfMissing = true) |
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.
Because, currently, we are using a single boot starter for all Bedrock providers, the Bedrock models should be disabled by default.
@@ -74,6 +77,8 @@ public VertexAI vertexAi(VertexAiGeminiConnectionProperties connectionProperties | |||
|
|||
@Bean | |||
@ConditionalOnMissingBean | |||
@ConditionalOnProperty(prefix = VertexAiGeminiChatProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true", | |||
matchIfMissing = true) |
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.
Because, currently, we are using a single boot starter for all Bedrock providers, the Bedrock models should be disabled by default.
* Fixing auto configured beans where they are missing `@ConditionalOnMissingBean` * Add `matchIfMissing` on `@ConditionalOnProperty` where it is missing with value `true` Resolves spring-projects#868
@tzolov Removed the |
LGTM |
rebased, squashed and merged at ce59613 |
@ConditionalOnMissingBean
matchIfMissing
on@ConditionalOnProperty
where it is missing with valuetrue
Resolves #868