1
0
Files
spring-ai-2-migration/LICENSE
Ankur cb777068a7 Spring AI 1.x to 2.0 migration: breaking-change reference and offline verification suite
Companion code for the ankurm.com guide. Verified on Spring AI 2.0.0, Spring Boot 4.1.0,
JDK 25.0.3. run.txt is unedited mvn test output: 5 tests, 0 failures.

Runs with NO API key, no network and no provider account. A canned ChatModel returns fixed
responses; ChatClient, advisors and chat memory all sit above the model, so everything that
changed is still exercised faithfully. TestChatModel records each Prompt it receives, which
lets the tests assert what Spring AI SENT rather than what a model replied.

docs/01  complete breaking-change reference: platform (Boot 4 mandatory, Jackson 2 to 3),
         artifact renames (spring-ai-advisors-vector-store -> spring-ai-vector-store-advisor,
         spring-ai-core split, OCI and Minimax removals, MCP transports moved into Spring AI),
         options builders replacing setters, the dropped .options property prefix, tool
         calling (internalToolExecutionEnabled and toolNames removed outright, not renamed),
         chat memory, structured output schema changes, and a migration order that works.

Tested here
  - Chat memory becomes stricter: 2.0 removes the remaining default-ID and builder-based
    configuration paths (ChatMemory.DEFAULT_CONVERSATION_ID and .conversationId() are both
    gone). Explicit per-request conversation ids - introduced during the 1.x line and already
    the recommended approach - become the only migration target.
  - CONVERSATION_ID survives as the metadata KEY. It and the removed DEFAULT_CONVERSATION_ID
    look interchangeable and are opposites; swapping them to clear a compile error restores
    exactly the shared-conversation behaviour that removing it was meant to take away.
  - PromptChatMemoryAdvisor is gone; MessageChatMemoryAdvisor replaces it, and the difference
    is not cosmetic (system-prompt text vs real Message objects, so token counts change).
  - A test asserts two conversation ids cannot see each other.
2026-08-01 10:51:02 +05:30

22 lines
1.0 KiB
Plaintext

MIT License
Copyright (c) 2026 Ankur Mhatre
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.