Update/remove autoconfiguration enable/disable configurations

- Since the model autoconfiguration enable/disable flags are no longer used, remove them

   - Currently, the model autoconfigurations can be enabled/disabled via top level Spring AI properties such as spring.ai.model.chat/embedding/image/moderation=<model-provider-name>

   - Update documentation to add note section about this change

- Update note on the autoconfiguration section to point to the configuration changes

- Align the vertex ai text/multimodal keys in line with the other properties

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
This commit is contained in:
Ilayaperumal Gopinathan
2025-03-25 17:44:04 +00:00
committed by Christian Tzolov
parent fc955c74eb
commit 9eacd40aa9
110 changed files with 941 additions and 520 deletions

View File

@@ -36,11 +36,6 @@ public class PostgresMlEmbeddingProperties {
public static final String CONFIG_PREFIX = "spring.ai.postgresml.embedding";
/**
* Enable Postgres ML embedding model.
*/
private boolean enabled = true;
/**
* Create the extensions required for embedding
*/
@@ -68,14 +63,6 @@ public class PostgresMlEmbeddingProperties {
this.options = options;
}
public boolean isEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public boolean isCreateExtension() {
return this.createExtension;
}

View File

@@ -84,15 +84,14 @@ public class PostgresMlEmbeddingAutoConfigurationIT {
void embeddingActivation() {
new ApplicationContextRunner().withBean(JdbcTemplate.class, () -> this.jdbcTemplate)
.withConfiguration(AutoConfigurations.of(PostgresMlEmbeddingAutoConfiguration.class))
.withPropertyValues("spring.ai.postgresml.embedding.enabled=false")
.withPropertyValues("spring.ai.model.embedding=none")
.run(context -> {
assertThat(context.getBeansOfType(PostgresMlEmbeddingProperties.class)).isNotEmpty();
assertThat(context.getBeansOfType(PostgresMlEmbeddingProperties.class)).isEmpty();
assertThat(context.getBeansOfType(PostgresMlEmbeddingModel.class)).isEmpty();
});
new ApplicationContextRunner().withBean(JdbcTemplate.class, () -> this.jdbcTemplate)
.withConfiguration(AutoConfigurations.of(PostgresMlEmbeddingAutoConfiguration.class))
.withPropertyValues("spring.ai.postgresml.embedding.enabled=true")
.withPropertyValues("spring.ai.model.embedding=postgresml")
.run(context -> {
assertThat(context.getBeansOfType(PostgresMlEmbeddingProperties.class)).isNotEmpty();
assertThat(context.getBeansOfType(PostgresMlEmbeddingModel.class)).isNotEmpty();