Skip to content

Commit 779b304

Browse files
joshlongspring-builds
authored andcommitted
Add 'enable' for bedrock cohere and chat propertites
- Tweak readme Fixes #4365 Signed-off-by: Josh Long <54473+joshlong@users.noreply.github.com> (cherry picked from commit 9442c35)
1 parent 85fb718 commit 779b304

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ To clone it you have to either:
6464

6565
## Building
6666

67+
Build using Java 17.
68+
6769
To build with running unit tests
6870

6971
```shell
@@ -100,9 +102,10 @@ A full integration test is done twice a day in the [Spring AI Integration Test R
100102
One way to run integration tests on part of the code is to first do a quick compile and install of the project
101103

102104
```shell
103-
./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
105+
./mvnw spring-javaformat:apply clean install -DskipTests -Dmaven.javadoc.skip=true
104106
```
105107
Then run the integration test for a specific module using the `-pl` option
108+
106109
```shell
107110
./mvnw verify -Pintegration-tests -pl spring-ai-spring-boot-testcontainers
108111
```

auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/main/java/org/springframework/ai/model/bedrock/cohere/autoconfigure/BedrockCohereEmbeddingProperties.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public class BedrockCohereEmbeddingProperties {
3434

3535
public static final String CONFIG_PREFIX = "spring.ai.bedrock.cohere.embedding";
3636

37+
/**
38+
* whether Cohere functionality should be enabled.
39+
*/
40+
private boolean enabled;
41+
3742
/**
3843
* Bedrock Cohere Embedding generative name. Defaults to
3944
* 'cohere.embed-multilingual-v3'.
@@ -62,4 +67,12 @@ public void setOptions(BedrockCohereEmbeddingOptions options) {
6267
this.options = options;
6368
}
6469

70+
public boolean isEnabled() {
71+
return this.enabled;
72+
}
73+
74+
public void setEnabled(boolean enabled) {
75+
this.enabled = enabled;
76+
}
77+
6578
}

auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/main/java/org/springframework/ai/model/bedrock/converse/autoconfigure/BedrockConverseProxyChatProperties.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,19 @@
2525
* Configuration properties for Bedrock Converse.
2626
*
2727
* @author Christian Tzolov
28+
* @author Josh Long
2829
* @since 1.0.0
2930
*/
3031
@ConfigurationProperties(BedrockConverseProxyChatProperties.CONFIG_PREFIX)
3132
public class BedrockConverseProxyChatProperties {
3233

3334
public static final String CONFIG_PREFIX = "spring.ai.bedrock.converse.chat";
3435

36+
/**
37+
* whether Bedrock functionality should be enabled.
38+
*/
39+
private boolean enabled;
40+
3541
@NestedConfigurationProperty
3642
private ToolCallingChatOptions options = ToolCallingChatOptions.builder().temperature(0.7).maxTokens(300).build();
3743

@@ -44,4 +50,12 @@ public void setOptions(ToolCallingChatOptions options) {
4450
this.options = options;
4551
}
4652

53+
public boolean isEnabled() {
54+
return this.enabled;
55+
}
56+
57+
public void setEnabled(boolean enabled) {
58+
this.enabled = enabled;
59+
}
60+
4761
}

0 commit comments

Comments
 (0)