diff --git a/auto-configurations/models/chat/client/spring-ai-autoconfigure-model-chat-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/auto-configurations/models/chat/client/spring-ai-autoconfigure-model-chat-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..aec436ff8 --- /dev/null +++ b/auto-configurations/models/chat/client/spring-ai-autoconfigure-model-chat-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,52 @@ +{ + "properties": [ + { + "name": "spring.ai.model.chat", + "type": "java.lang.String", + "description": "The primary ChatModel to autoconfigure. If not set, each ChatModel auto-configuration is enabled by default.", + "defaultValue": "" + }, + { + "name": "spring.ai.model.embedding", + "type": "java.lang.String", + "description": "The primary EmbeddingModel to autoconfigure. If not set, each EmbeddingModel auto-configuration is enabled by default.", + "defaultValue": "" + }, + { + "name": "spring.ai.model.embedding.text", + "type": "java.lang.String", + "description": "The primary EmbeddingModel for text embeddings to autoconfigure. If not set, each text EmbeddingModel auto-configuration is enabled by default.", + "defaultValue": "" + }, + { + "name": "spring.ai.model.embedding.multimodal", + "type": "java.lang.String", + "description": "The primary EmbeddingModel for multimodal embeddings to autoconfigure. If not set, each multimodal EmbeddingModel auto-configuration is enabled by default.", + "defaultValue": "" + }, + { + "name": "spring.ai.model.image", + "type": "java.lang.String", + "description": "The primary ImageModel to autoconfigure. If not set, each ImageModel auto-configuration is enabled by default.", + "defaultValue": "" + }, + { + "name": "spring.ai.model.audio.transcription", + "type": "java.lang.String", + "description": "The primary TranscriptionModel to autoconfigure. If not set, each TranscriptionModel auto-configuration is enabled by default.", + "defaultValue": "" + }, + { + "name": "spring.ai.model.audio.speech", + "type": "java.lang.String", + "description": "The primary SpeechModel to autoconfigure. If not set, each SpeechModel auto-configuration is enabled by default.", + "defaultValue": "" + }, + { + "name": "spring.ai.model.moderation", + "type": "java.lang.String", + "description": "The primary ModerationModel to autoconfigure. If not set, each ModerationModel auto-configuration is enabled by default.", + "defaultValue": "" + } + ] +} diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc index 3ff3daf31..c7304e5cd 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc @@ -237,6 +237,30 @@ CreateMessageResult result = exchange.createMessage(new CreateMessageRequest(... For a complete guide to migrating MCP code, refer to the https://github.com/spring-projects/spring-ai/blob/main/spring-ai-docs/src/main/antora/modules/ROOT/pages/mcp-migration.adoc[MCP Migration Guide]. +=== Enabling/Disabling Model Auto-Configuration + +The previous configuration properties for enabling/disabling model auto-configuration have been removed: + +* `spring.ai..chat.enabled` +* `spring.ai..embedding.enabled` +* `spring.ai..image.enabled` +* `spring.ai..moderation.enabled` + +By default, if a model provider (e.g., OpenAI, Ollama) is found on the classpath, its corresponding auto-configuration for relevant model types (chat, embedding, etc.) is enabled. If multiple providers for the same model type are present (e.g., both `spring-ai-openai-spring-boot-starter` and `spring-ai-ollama-spring-boot-starter`), you can use the following properties to select *which* provider's auto-configuration should be active, effectively disabling the others for that specific model type. + +To disable auto-configuration for a specific model type entirely, even if only one provider is present, set the corresponding property to a value that does not match any provider on the classpath (e.g., `none` or `disabled`). + +You can refer to the https://github.com/spring-projects/spring-ai/blob/main/spring-ai-model/src/main/java/org/springframework/ai/model/SpringAIModels.java[`SpringAIModels`] enumeration for a list of well-known provider values. + +* `spring.ai.model.audio.speech=` +* `spring.ai.model.audio.transcription=` +* `spring.ai.model.chat=` +* `spring.ai.model.embedding=` +* `spring.ai.model.embedding.multimodal=` +* `spring.ai.model.embedding.text=` +* `spring.ai.model.image=` +* `spring.ai.model.moderation=` + === Automating upgrading using AI You can automate the upgrade process to 1.0.0-M7 using the Claude Code CLI tool with a provided prompt: