Skip to content

Commit 9442c35

Browse files
joshlongmarkpollack
authored andcommitted
Add 'enable' for bedrock cohere and chat propertites
- Tweak readme Auto-cherry-pick to 1.0.x Fixes #4365 Signed-off-by: Josh Long <[email protected]>
1 parent f3aab2f commit 9442c35

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
@@ -65,6 +65,8 @@ To clone it you have to either:
6565

6666
## Building
6767

68+
Build using Java 17.
69+
6870
To build with running unit tests
6971

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

103105
```shell
104-
./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
106+
./mvnw spring-javaformat:apply clean install -DskipTests -Dmaven.javadoc.skip=true
105107
```
106108
Then run the integration test for a specific module using the `-pl` option
109+
107110
```shell
108111
./mvnw verify -Pintegration-tests -pl spring-ai-spring-boot-testcontainers
109112
```

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 BedrockChatOptions options = BedrockChatOptions.builder().temperature(0.7).maxTokens(300).build();
3743

@@ -44,4 +50,12 @@ public void setOptions(BedrockChatOptions 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)