Migrate to Spring AI 1.0
ProprietaryMigrate applications from Spring AI 0.8 and the 1.0 milestones to Spring AI 1.0. This moves the Spring Boot starters to their spring-ai-starter-model-*, spring-ai-starter-vector-store-* and spring-ai-starter-mcp-* names, replaces spring-ai-core with the modules it was split into, and upgrades Spring AI dependencies to 1.0. In code it renames the 0.8 *Client model types to *Model, the output parsers to structured output converters, moves the types that changed packages, drops the with prefix of builder methods, builds SearchRequests, APIs and advisors through their builders, migrates the FunctionCallback API to the ToolCallback API and the MCP server registrations to specifications, and replaces InMemoryChatMemory. It also renames the observation and chat memory repository configuration properties.
io. moderne. java. spring. ai1. UpgradeSpringAi_1_0mod run . --recipe= io. moderne. java. spring. ai1. UpgradeSpringAi_1_0Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Replace
FunctionCallback.builder()withFunctionToolCallback.builder(..) - Drop the
withprefix of Spring AI builder methods - Build Spring AI
SearchRequests withSearchRequest.builder() - Create the Spring AI Ollama and OpenAI APIs with their builders
- Change method target to static
- Change type
ChatOptionsBuildertoChatOptions$Builder - Change type
FunctionCallingOptionsBuildertoToolCallingChatOptions$Builder - Migrate MCP server registrations to specifications
- Change method name
org.springframework.ai.parser.Parser parse(java.lang.String)toconvert - Change method name
org.springframework.ai.chat.metadata.Usage getGenerationTokens()togetCompletionTokens - Change method name
org.springframework.ai.chat.client.ChatClient$ChatClientRequestSpec functions(java.lang.String...)totoolNames - Change method name
org.springframework.ai.chat.client.ChatClient$ChatClientRequestSpec tools(java.lang.String...)totoolNames - Change method name
org.springframework.ai.chat.client.ChatClient$ChatClientRequestSpec functions(org.springframework.ai.model.function.FunctionCallback...)totoolCallbacks - Change method name
org.springframework.ai.chat.client.ChatClient$ChatClientRequestSpec tools(org.springframework.ai.model.function.FunctionCallback...)totoolCallbacks - Change method name
org.springframework.ai.chat.client.ChatClient$ChatClientRequestSpec tools(java.util.List)totoolCallbacks - Change method name
org.springframework.ai.chat.client.ChatClient$ChatClientRequestSpec tools(org.springframework.ai.tool.ToolCallbackProvider...)totoolCallbacks - Change method name
org.springframework.ai.chat.client.ChatClient$Builder defaultFunctions(java.lang.String...)todefaultToolNames - Change method name
org.springframework.ai.chat.client.ChatClient$Builder defaultTools(java.lang.String...)todefaultToolNames - Change method name
org.springframework.ai.chat.client.ChatClient$Builder defaultFunctions(org.springframework.ai.model.function.FunctionCallback...)todefaultToolCallbacks - Change method name
org.springframework.ai.chat.client.ChatClient$Builder defaultTools(org.springframework.ai.model.function.FunctionCallback...)todefaultToolCallbacks - Change method name
org.springframework.ai.chat.client.ChatClient$Builder defaultTools(java.util.List)todefaultToolCallbacks - Change method name
org.springframework.ai.chat.client.ChatClient$Builder defaultTools(org.springframework.ai.tool.ToolCallbackProvider...)todefaultToolCallbacks - Change method name
org.springframework.ai..* functionCallbacks(..)totoolCallbacks - Change method name
org.springframework.ai..* functions(java.util.Set)totoolNames - Change method name
org.springframework.ai..* function(java.lang.String)totoolNames - Change method name
org.springframework.ai..* getFunctionCallbacks()togetToolCallbacks - Change method name
org.springframework.ai..* setFunctionCallbacks(java.util.List)tosetToolCallbacks - Change method name
org.springframework.ai..* getFunctions()togetToolNames - Change method name
org.springframework.ai..* setFunctions(java.util.Set)tosetToolNames - Replace constant with another constant
- Replace constant with literal value
- Replace constant with literal value
- Replace constant with another constant
- Change type
ChatClienttoChatModel - Change type
StreamingChatClienttoStreamingChatModel - Change type
org.springframework.ai.chat.ChatResponsetoorg.springframework.ai.chat.model.ChatResponse - Change type
org.springframework.ai.chat.Generationtoorg.springframework.ai.chat.model.Generation - Change type
org.springframework.ai.chat.messages.Mediatoorg.springframework.ai.content.Media - Change type
ModelClienttoModel - Change type
StreamingModelClienttoStreamingModel - Change type
EmbeddingClienttoEmbeddingModel - Change type
AbstractEmbeddingClienttoAbstractEmbeddingModel - Change type
ImageClienttoImageModel - Change type
AzureOpenAiChatClienttoAzureOpenAiChatModel - Change type
AzureOpenAiEmbeddingClienttoAzureOpenAiEmbeddingModel - Change type
BedrockCohereEmbeddingClienttoBedrockCohereEmbeddingModel - Change type
BedrockTitanEmbeddingClienttoBedrockTitanEmbeddingModel - Change type
HuggingfaceChatClienttoHuggingfaceChatModel - Change type
MistralAiChatClienttoMistralAiChatModel - Change type
MistralAiEmbeddingClienttoMistralAiEmbeddingModel - Change type
OllamaChatClienttoOllamaChatModel - Change type
OllamaEmbeddingClienttoOllamaEmbeddingModel - Change type
OpenAiAudioTranscriptionClienttoOpenAiAudioTranscriptionModel - Change type
OpenAiChatClienttoOpenAiChatModel - Change type
OpenAiEmbeddingClienttoOpenAiEmbeddingModel - Change type
OpenAiImageClienttoOpenAiImageModel - Change type
PostgresMlEmbeddingClienttoPostgresMlEmbeddingModel - Change type
StabilityAiImageClienttoStabilityAiImageModel - Change type
TransformersEmbeddingClienttoTransformersEmbeddingModel - Change type
VertexAiGeminiChatClienttoVertexAiGeminiChatModel - Change type
org.springframework.ai.openai.audio.transcription.AudioTranscriptiontoorg.springframework.ai.audio.transcription.AudioTranscription - Change type
org.springframework.ai.openai.audio.transcription.AudioTranscriptionPrompttoorg.springframework.ai.audio.transcription.AudioTranscriptionPrompt - Change type
org.springframework.ai.openai.audio.transcription.AudioTranscriptionResponsetoorg.springframework.ai.audio.transcription.AudioTranscriptionResponse - Change type
OutputParsertoStructuredOutputConverter - Change type
BeanOutputParsertoBeanOutputConverter - Change type
ListOutputParsertoListOutputConverter - Change type
MapOutputParsertoMapOutputConverter - Change type
AbstractConversionServiceOutputParsertoAbstractConversionServiceOutputConverter - Change type
AbstractMessageConverterOutputParsertoAbstractMessageOutputConverter - Change type
org.springframework.ai.parser.FormatProvidertoorg.springframework.ai.converter.FormatProvider - Change type
org.springframework.ai.ResourceUtilstoorg.springframework.ai.util.ResourceUtils - Change type
org.springframework.ai.vectorsore.ChromaVectorStoretoorg.springframework.ai.chroma.vectorstore.ChromaVectorStore - Change type
org.springframework.ai.chroma.ChromaApitoorg.springframework.ai.chroma.vectorstore.ChromaApi - Change type
org.springframework.ai.vectorstore.filter.converter.ChromaFilterExpressionConvertertoorg.springframework.ai.chroma.vectorstore.ChromaFilterExpressionConverter - Change type
org.springframework.ai.vectorstore.MilvusVectorStoretoorg.springframework.ai.vectorstore.milvus.MilvusVectorStore - Change type
org.springframework.ai.vectorstore.filter.converter.MilvusFilterExpressionConvertertoorg.springframework.ai.vectorstore.milvus.MilvusFilterExpressionConverter - Change type
org.springframework.ai.vectorstore.Neo4jVectorStoretoorg.springframework.ai.vectorstore.neo4j.Neo4jVectorStore - Change type
org.springframework.ai.vectorstore.filter.Neo4jVectorFilterExpressionConvertertoorg.springframework.ai.vectorstore.neo4j.filter.Neo4jVectorFilterExpressionConverter - Change type
org.springframework.ai.vectorstore.PgVectorStoretoorg.springframework.ai.vectorstore.pgvector.PgVectorStore - Change type
org.springframework.ai.vectorstore.filter.converter.PgVectorFilterExpressionConvertertoorg.springframework.ai.vectorstore.pgvector.PgVectorFilterExpressionConverter - Change type
org.springframework.ai.vectorstore.PineconeVectorStoretoorg.springframework.ai.vectorstore.pinecone.PineconeVectorStore - Change type
org.springframework.ai.vectorstore.RedisVectorStoretoorg.springframework.ai.vectorstore.redis.RedisVectorStore - Change type
org.springframework.ai.vectorstore.RedisFilterExpressionConvertertoorg.springframework.ai.vectorstore.redis.RedisFilterExpressionConverter - Change type
org.springframework.ai.vectorstore.WeaviateVectorStoretoorg.springframework.ai.vectorstore.weaviate.WeaviateVectorStore - Change type
org.springframework.ai.vectorstore.WeaviateFilterExpressionConvertertoorg.springframework.ai.vectorstore.weaviate.WeaviateFilterExpressionConverter - Change type
org.springframework.ai.chat.client.advisor.QuestionAnswerAdvisortoorg.springframework.ai.chat.client.advisor.vectorstore.QuestionAnswerAdvisor - Change type
org.springframework.ai.chat.client.advisor.VectorStoreChatMemoryAdvisortoorg.springframework.ai.chat.client.advisor.vectorstore.VectorStoreChatMemoryAdvisor - Change type
org.springframework.ai.chat.client.advisor.RetrievalAugmentationAdvisortoorg.springframework.ai.rag.advisor.RetrievalAugmentationAdvisor - Change type
org.springframework.ai.evaluation.FactCheckingEvaluatortoorg.springframework.ai.chat.evaluation.FactCheckingEvaluator - Change type
org.springframework.ai.evaluation.RelevancyEvaluatortoorg.springframework.ai.chat.evaluation.RelevancyEvaluator - Change type
org.springframework.ai.model.Contenttoorg.springframework.ai.content.Content - Change type
org.springframework.ai.model.Mediatoorg.springframework.ai.content.Media - Change type
org.springframework.ai.model.MediaContenttoorg.springframework.ai.content.MediaContent - Change type
org.springframework.ai.tool.ToolCallbackstoorg.springframework.ai.support.ToolCallbacks - Change type
org.springframework.ai.tool.util.ToolUtilstoorg.springframework.ai.tool.support.ToolUtils - Change type
org.springframework.ai.transformer.KeywordMetadataEnrichertoorg.springframework.ai.model.transformer.KeywordMetadataEnricher - Change type
org.springframework.ai.transformer.SummaryMetadataEnrichertoorg.springframework.ai.model.transformer.SummaryMetadataEnricher - Change type
org.springframework.ai.util.PromptAsserttoorg.springframework.ai.rag.util.PromptAssert - Change type
FunctionCallingOptionstoToolCallingChatOptions - Change type
FunctionCallbacktoToolCallback - Rename package name
org.springframework.ai.chat.memory.cassandratoorg.springframework.ai.chat.memory.repository.cassandra - Rename package name
org.springframework.ai.chat.memory.jdbctoorg.springframework.ai.chat.memory.repository.jdbc - Rename package name
org.springframework.ai.chat.memory.neo4jtoorg.springframework.ai.chat.memory.repository.neo4j - Create Spring AI advisors with their builders
- Add comment to method invocations
- Add comment to method invocations
- Add comment to method invocations
- Add comment to method invocations
- Replace
InMemoryChatMemorywithMessageWindowChatMemory - Migrate Spring AI properties to 1.0
- Migrate Spring AI dependencies to 1.0