diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/bedrock-converse.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/bedrock-converse.adoc index 685ac4dbe35..d207d4ab645 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/bedrock-converse.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/bedrock-converse.adoc @@ -73,7 +73,7 @@ The prefix `spring.ai.bedrock.converse.chat` is the property prefix that configu |==== | Property | Description | Default -| spring.ai.bedrock.converse.chat.enabled | Enable Bedrock Converse chat model. | true +| spring.ai.bedrock.converse.chat.enabled | Enable Bedrock Converse chat model. | false | spring.ai.bedrock.converse.chat.options.model | The model ID to use. You can use the https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html[Supported models and model features] | anthropic.claude-3-sonnet-20240229-v1:0 | spring.ai.bedrock.converse.chat.options.temperature | Controls the randomness of the output. Values can range over [0.0,1.0] | 0.8 | spring.ai.bedrock.converse.chat.options.top-p | The maximum cumulative probability of tokens to consider when sampling. | AWS Bedrock default diff --git a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatAutoConfiguration.java b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatAutoConfiguration.java index 869885eb409..f47316819e8 100644 --- a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatAutoConfiguration.java +++ b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatAutoConfiguration.java @@ -53,7 +53,7 @@ @EnableConfigurationProperties({ BedrockConverseProxyChatProperties.class, BedrockAwsConnectionConfiguration.class }) @ConditionalOnClass({ BedrockRuntimeClient.class, BedrockRuntimeAsyncClient.class }) @ConditionalOnProperty(prefix = BedrockConverseProxyChatProperties.CONFIG_PREFIX, name = "enabled", - havingValue = "true", matchIfMissing = true) + havingValue = "true") @Import(BedrockAwsConnectionConfiguration.class) public class BedrockConverseProxyChatAutoConfiguration { diff --git a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatProperties.java b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatProperties.java index 88f5068025a..0efec2f7784 100644 --- a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatProperties.java +++ b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatProperties.java @@ -35,7 +35,7 @@ public class BedrockConverseProxyChatProperties { /** * Enable Bedrock Converse chat model. */ - private boolean enabled = true; + private boolean enabled = false; @NestedConfigurationProperty private PortableFunctionCallingOptions options = PortableFunctionCallingOptions.builder() diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatAutoConfigurationIT.java index e43845a5b8c..7e5ab42e641 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatAutoConfigurationIT.java @@ -43,7 +43,7 @@ public class BedrockConverseProxyChatAutoConfigurationIT { private static final Log logger = LogFactory.getLog(BedrockConverseProxyChatAutoConfigurationIT.class); private final ApplicationContextRunner contextRunner = BedrockTestUtils.getContextRunner() - .withPropertyValues( + .withPropertyValues("spring.ai.bedrock.converse.chat.enabled=true", "spring.ai.bedrock.converse.chat.options.model=" + "anthropic.claude-3-5-sonnet-20240620-v1:0", "spring.ai.bedrock.converse.chat.options.temperature=0.5") .withConfiguration(AutoConfigurations.of(BedrockConverseProxyChatAutoConfiguration.class)); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatPropertiesTests.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatPropertiesTests.java index 4b4bb809a44..b1e38c398ee 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatPropertiesTests.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/BedrockConverseProxyChatPropertiesTests.java @@ -35,6 +35,7 @@ public void chatOptionsTest() { new ApplicationContextRunner().withPropertyValues( // @formatter:off + "spring.ai.bedrock.converse.chat.enabled=true", "spring.ai.bedrock.converse.chat.options.model=MODEL_XYZ", "spring.ai.bedrock.converse.chat.options.max-tokens=123", @@ -65,10 +66,10 @@ public void chatOptionsTest() { @Test public void chatCompletionDisabled() { - // It is enabled by default + // It is disabled by default new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(BedrockConverseProxyChatAutoConfiguration.class)) - .run(context -> assertThat(context.getBeansOfType(BedrockConverseProxyChatProperties.class)).isNotEmpty()); + .run(context -> assertThat(context.getBeansOfType(BedrockConverseProxyChatProperties.class)).isEmpty()); // Explicitly enable the chat auto-configuration. new ApplicationContextRunner().withPropertyValues("spring.ai.bedrock.converse.chat.enabled=true") diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/tool/FunctionCallWithFunctionBeanIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/tool/FunctionCallWithFunctionBeanIT.java index b869d5a464d..d68e64642c9 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/tool/FunctionCallWithFunctionBeanIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/bedrock/converse/tool/FunctionCallWithFunctionBeanIT.java @@ -55,7 +55,7 @@ class FunctionCallWithFunctionBeanIT { void functionCallTest() { this.contextRunner - .withPropertyValues( + .withPropertyValues("spring.ai.bedrock.converse.chat.enabled=true", "spring.ai.bedrock.converse.chat.options.model=" + "anthropic.claude-3-5-sonnet-20240620-v1:0") .run(context -> { @@ -84,7 +84,7 @@ void functionCallTest() { void functionStreamTest() { this.contextRunner - .withPropertyValues( + .withPropertyValues("spring.ai.bedrock.converse.chat.enabled=true", "spring.ai.bedrock.converse.chat.options.model=" + "anthropic.claude-3-5-sonnet-20240620-v1:0") .run(context -> {