Skip to content

Commit 688eab1

Browse files
ThomasVitalemarkpollack
authored andcommitted
Add missing metadata for spring.ai.model.* properties
* The new spring.ai.model.* properties introduced in M7 were missing Spring Boot configuration metadata. * Furthermore, the breaking change was not documented as the previous properties have been completely removed. Documentation has been added in the upgrade notes for this change. Signed-off-by: Thomas Vitale <[email protected]>
1 parent faa8778 commit 688eab1

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"properties": [
3+
{
4+
"name": "spring.ai.model.chat",
5+
"type": "java.lang.String",
6+
"description": "The primary ChatModel to autoconfigure. If not set, each ChatModel auto-configuration is enabled by default.",
7+
"defaultValue": ""
8+
},
9+
{
10+
"name": "spring.ai.model.embedding",
11+
"type": "java.lang.String",
12+
"description": "The primary EmbeddingModel to autoconfigure. If not set, each EmbeddingModel auto-configuration is enabled by default.",
13+
"defaultValue": ""
14+
},
15+
{
16+
"name": "spring.ai.model.embedding.text",
17+
"type": "java.lang.String",
18+
"description": "The primary EmbeddingModel for text embeddings to autoconfigure. If not set, each text EmbeddingModel auto-configuration is enabled by default.",
19+
"defaultValue": ""
20+
},
21+
{
22+
"name": "spring.ai.model.embedding.multimodal",
23+
"type": "java.lang.String",
24+
"description": "The primary EmbeddingModel for multimodal embeddings to autoconfigure. If not set, each multimodal EmbeddingModel auto-configuration is enabled by default.",
25+
"defaultValue": ""
26+
},
27+
{
28+
"name": "spring.ai.model.image",
29+
"type": "java.lang.String",
30+
"description": "The primary ImageModel to autoconfigure. If not set, each ImageModel auto-configuration is enabled by default.",
31+
"defaultValue": ""
32+
},
33+
{
34+
"name": "spring.ai.model.audio.transcription",
35+
"type": "java.lang.String",
36+
"description": "The primary TranscriptionModel to autoconfigure. If not set, each TranscriptionModel auto-configuration is enabled by default.",
37+
"defaultValue": ""
38+
},
39+
{
40+
"name": "spring.ai.model.audio.speech",
41+
"type": "java.lang.String",
42+
"description": "The primary SpeechModel to autoconfigure. If not set, each SpeechModel auto-configuration is enabled by default.",
43+
"defaultValue": ""
44+
},
45+
{
46+
"name": "spring.ai.model.moderation",
47+
"type": "java.lang.String",
48+
"description": "The primary ModerationModel to autoconfigure. If not set, each ModerationModel auto-configuration is enabled by default.",
49+
"defaultValue": ""
50+
}
51+
]
52+
}

spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,30 @@ CreateMessageResult result = exchange.createMessage(new CreateMessageRequest(...
237237

238238
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].
239239

240+
=== Enabling/Disabling Model Auto-Configuration
241+
242+
The previous configuration properties for enabling/disabling model auto-configuration have been removed:
243+
244+
* `spring.ai.<provider>.chat.enabled`
245+
* `spring.ai.<provider>.embedding.enabled`
246+
* `spring.ai.<provider>.image.enabled`
247+
* `spring.ai.<provider>.moderation.enabled`
248+
249+
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.
250+
251+
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`).
252+
253+
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.
254+
255+
* `spring.ai.model.audio.speech=<model-provider|none>`
256+
* `spring.ai.model.audio.transcription=<model-provider|none>`
257+
* `spring.ai.model.chat=<model-provider|none>`
258+
* `spring.ai.model.embedding=<model-provider|none>`
259+
* `spring.ai.model.embedding.multimodal=<model-provider|none>`
260+
* `spring.ai.model.embedding.text=<model-provider|none>`
261+
* `spring.ai.model.image=<model-provider|none>`
262+
* `spring.ai.model.moderation=<model-provider|none>`
263+
240264
=== Automating upgrading using AI
241265

242266
You can automate the upgrade process to 1.0.0-M7 using the Claude Code CLI tool with a provided prompt:

0 commit comments

Comments
 (0)