Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public class AnthropicChatProperties {

public static final String CONFIG_PREFIX = "spring.ai.anthropic.chat";

/**
* Enable Anthropic chat model.
*/
private boolean enabled = true;

/**
* Client lever Ollama options. Use this property to configure generative temperature,
* topK and topP and alike parameters. The null values are ignored defaulting to the
Expand All @@ -54,12 +49,4 @@ public AnthropicChatOptions getOptions() {
return this.options;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public void connectionProperties() {

assertThat(chatProperties.getOptions().getModel()).isEqualTo("MODEL_XYZ");
assertThat(chatProperties.getOptions().getTemperature()).isEqualTo(0.55);
// enabled is true by default
assertThat(chatProperties.isEnabled()).isTrue();
});
}

Expand Down Expand Up @@ -111,7 +109,7 @@ public void chatCompletionDisabled() {
});

// Explicitly enable the chat auto-configuration.
new ApplicationContextRunner().withPropertyValues("spring.ai.anthropic.chat.enabled=true")
new ApplicationContextRunner().withPropertyValues("spring.ai.model.chat=anthropic")
.withConfiguration(AutoConfigurations.of(SpringAiRetryAutoConfiguration.class,
RestClientAutoConfiguration.class, AnthropicChatAutoConfiguration.class))
.run(context -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,9 @@ public class AzureOpenAiAudioTranscriptionProperties {

public static final String CONFIG_PREFIX = "spring.ai.azure.openai.audio.transcription";

/**
* Enable AzureOpenAI audio transcription model.
*/
private boolean enabled = true;

@NestedConfigurationProperty
private AzureOpenAiAudioTranscriptionOptions options = AzureOpenAiAudioTranscriptionOptions.builder().build();

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public AzureOpenAiAudioTranscriptionOptions getOptions() {
return this.options;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public class AzureOpenAiChatProperties {

private static final Double DEFAULT_TEMPERATURE = 0.7;

/**
* Enable Azure OpenAI chat model.
*/
private boolean enabled = true;

@NestedConfigurationProperty
private AzureOpenAiChatOptions options = AzureOpenAiChatOptions.builder()
.deploymentName(DEFAULT_DEPLOYMENT_NAME)
Expand All @@ -48,12 +43,4 @@ public void setOptions(AzureOpenAiChatOptions options) {
this.options = options;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ public class AzureOpenAiEmbeddingProperties {

public static final String CONFIG_PREFIX = "spring.ai.azure.openai.embedding";

/**
* Enable Azure OpenAI embedding model.
*/
private boolean enabled = true;

@NestedConfigurationProperty
private AzureOpenAiEmbeddingOptions options = AzureOpenAiEmbeddingOptions.builder()
.deploymentName("text-embedding-ada-002")
Expand All @@ -57,12 +52,4 @@ public void setMetadataMode(MetadataMode metadataMode) {
this.metadataMode = metadataMode;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ public class AzureOpenAiImageOptionsProperties {

public static final String CONFIG_PREFIX = "spring.ai.azure.openai.image";

/**
* Enable Azure OpenAI chat client.
*/
private boolean enabled = true;

@NestedConfigurationProperty
private AzureOpenAiImageOptions options = AzureOpenAiImageOptions.builder().build();

Expand All @@ -47,12 +42,4 @@ public void setOptions(AzureOpenAiImageOptions options) {
this.options = options;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ public class BedrockCohereEmbeddingProperties {

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

/**
* Enable Bedrock Cohere Embedding Model. False by default.
*/
private boolean enabled = false;

/**
* Bedrock Cohere Embedding generative name. Defaults to
* 'cohere.embed-multilingual-v3'.
Expand All @@ -51,14 +46,6 @@ public class BedrockCohereEmbeddingProperties {
.truncate(CohereEmbeddingRequest.Truncate.NONE)
.build();

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public String getModel() {
return this.model;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,13 @@ public class BedrockConverseProxyChatProperties {

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

/**
* Enable Bedrock Converse chat model.
*/
private boolean enabled = true;

@NestedConfigurationProperty
private ToolCallingChatOptions options = ToolCallingChatOptions.builder()
.temperature(0.7)
.maxTokens(300)
.topK(10)
.build();

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public ToolCallingChatOptions getOptions() {
return this.options;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ public class BedrockTitanEmbeddingProperties {

public static final String CONFIG_PREFIX = "spring.ai.bedrock.titan.embedding";

/**
* Enable Bedrock Titan Embedding Model. False by default.
*/
private boolean enabled = false;

/**
* Bedrock Titan Embedding generative name. Defaults to 'amazon.titan-embed-image-v1'.
*/
Expand All @@ -51,14 +46,6 @@ public static String getConfigPrefix() {
return CONFIG_PREFIX;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public String getModel() {
return this.model;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void batchEmbedding() {
public void propertiesTest() {

BedrockTestUtils.getContextRunnerWithUserConfiguration()
.withPropertyValues("spring.ai.bedrock.cohere.embedding.enabled=true",
.withPropertyValues("spring.ai.model.embedding=bedrock-cohere",
"spring.ai.bedrock.aws.access-key=ACCESS_KEY", "spring.ai.bedrock.aws.secret-key=SECRET_KEY",
"spring.ai.bedrock.aws.region=" + Region.US_EAST_1.id(),
"spring.ai.bedrock.cohere.embedding.model=MODEL_XYZ",
Expand All @@ -96,7 +96,6 @@ public void propertiesTest() {
var properties = context.getBean(BedrockCohereEmbeddingProperties.class);
var awsProperties = context.getBean(BedrockAwsConnectionProperties.class);

assertThat(properties.isEnabled()).isTrue();
assertThat(awsProperties.getRegion()).isEqualTo(Region.US_EAST_1.id());
assertThat(properties.getModel()).isEqualTo("MODEL_XYZ");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ public void chatOptionsTest() {
.run(context -> {
var chatProperties = context.getBean(BedrockConverseProxyChatProperties.class);

assertThat(chatProperties.isEnabled()).isTrue();

assertThat(chatProperties.getOptions().getModel()).isEqualTo("MODEL_XYZ");
assertThat(chatProperties.getOptions().getMaxTokens()).isEqualTo(123);
assertThat(chatProperties.getOptions().getStopSequences()).contains("boza", "koza");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
public class BedrockTitanEmbeddingAutoConfigurationIT {

private final ApplicationContextRunner contextRunner = BedrockTestUtils.getContextRunner()
.withPropertyValues("spring.ai.bedrock.titan.embedding.enabled=true",
.withPropertyValues("spring.ai.model.embedding=bedrock-titan",
"spring.ai.bedrock.aws.access-key=" + System.getenv("AWS_ACCESS_KEY_ID"),
"spring.ai.bedrock.aws.secret-key=" + System.getenv("AWS_SECRET_ACCESS_KEY"),
"spring.ai.bedrock.aws.region=" + Region.US_EAST_1.id(),
Expand Down Expand Up @@ -86,7 +86,7 @@ public void singleImageEmbedding() {
public void propertiesTest() {

BedrockTestUtils.getContextRunnerWithUserConfiguration()
.withPropertyValues("spring.ai.bedrock.titan.embedding.enabled=true",
.withPropertyValues("spring.ai.model.embedding=bedrock-titan",
"spring.ai.bedrock.aws.access-key=ACCESS_KEY", "spring.ai.bedrock.aws.secret-key=SECRET_KEY",
"spring.ai.bedrock.aws.region=" + Region.US_EAST_1.id(),
"spring.ai.bedrock.titan.embedding.model=MODEL_XYZ",
Expand All @@ -96,7 +96,6 @@ public void propertiesTest() {
var properties = context.getBean(BedrockTitanEmbeddingProperties.class);
var awsProperties = context.getBean(BedrockAwsConnectionProperties.class);

assertThat(properties.isEnabled()).isTrue();
assertThat(awsProperties.getRegion()).isEqualTo(Region.US_EAST_1.id());
assertThat(properties.getModel()).isEqualTo("MODEL_XYZ");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ public class HuggingfaceChatProperties {
*/
private String url;

/**
* Enable Hugging Face chat model.
*/
private boolean enabled = true;

public String getApiKey() {
return this.apiKey;
}
Expand All @@ -62,12 +57,4 @@ public void setUrl(String url) {
this.url = url;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ public class MiniMaxChatProperties extends MiniMaxParentProperties {

private static final Double DEFAULT_TEMPERATURE = 0.7;

/**
* Enable MiniMax chat model.
*/
private boolean enabled = true;

@NestedConfigurationProperty
private MiniMaxChatOptions options = MiniMaxChatOptions.builder()
.model(DEFAULT_CHAT_MODEL)
Expand All @@ -54,12 +49,4 @@ public void setOptions(MiniMaxChatOptions options) {
this.options = options;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ public class MiniMaxEmbeddingProperties extends MiniMaxParentProperties {

public static final String DEFAULT_EMBEDDING_MODEL = MiniMaxApi.EmbeddingModel.Embo_01.value;

/**
* Enable MiniMax embedding model.
*/
private boolean enabled = true;

private MetadataMode metadataMode = MetadataMode.EMBED;

@NestedConfigurationProperty
Expand All @@ -60,12 +55,4 @@ public void setMetadataMode(MetadataMode metadataMode) {
this.metadataMode = metadataMode;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void embeddingActivation() {

new ApplicationContextRunner()
.withPropertyValues("spring.ai.minimax.api-key=API_KEY", "spring.ai.minimax.base-url=TEST_BASE_URL",
"spring.ai.minimax.embedding.enabled=true")
"spring.ai.model.embedding=minimax")
.withConfiguration(AutoConfigurations.of(SpringAiRetryAutoConfiguration.class,
RestClientAutoConfiguration.class, MiniMaxEmbeddingAutoConfiguration.class))
.run(context -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ public class MistralAiChatProperties extends MistralAiParentProperties {

private static final Boolean IS_ENABLED = false;

/**
* Enable OpenAI chat model.
*/
private boolean enabled = true;

@NestedConfigurationProperty
private MistralAiChatOptions options = MistralAiChatOptions.builder()
.model(DEFAULT_CHAT_MODEL)
Expand All @@ -68,12 +63,4 @@ public void setOptions(MistralAiChatOptions options) {
this.options = options;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

}
Loading