Skip to content

Commit

Permalink
Adding @ConditionalOnProperty configuration for OpenAiModerationModel.
Browse files Browse the repository at this point in the history
Added the ability to disable auto configuration of the
OpenAiModerationModel bean.  Addresses reported bug
[2373](spring-projects#2373)

Signed-off-by: Greg Meyer <[email protected]>
  • Loading branch information
gm2552 committed Mar 3, 2025
1 parent 2394ac8 commit 7040a75
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ public OpenAiAudioTranscriptionModel openAiAudioTranscriptionModel(OpenAiConnect

@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty(prefix = OpenAiModerationProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true",
matchIfMissing = true)
public OpenAiModerationModel openAiModerationClient(OpenAiConnectionProperties commonProperties,
OpenAiModerationProperties moderationProperties, RetryTemplate retryTemplate,
ObjectProvider<RestClient.Builder> restClientBuilderProvider, ResponseErrorHandler responseErrorHandler) {
Expand Down

0 comments on commit 7040a75

Please sign in to comment.