Add langchain4j-interop: Spring AI 2.0 and LangChain4j 1.22 side by side
Same order assistant in both frameworks against a local fake OpenAI server: starter bean collision, wire differences, tool failure and loop bounds, observability meters, MCP-first tools, and a compile check of the 2025 article's snippets and Maven coordinates. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G8ikz8xdWuTP5yun8DZ1hk
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Both starters in one Spring Boot 4.1.1 application
|
||||
|
||||
Spring AI: spring-ai-starter-model-openai 2.0.1. LangChain4j: langchain4j-open-ai-spring-boot4-starter 1.22.0-beta32.
|
||||
|
||||
1. Both starters, nothing else:
|
||||
FAILED: BeanDefinitionOverrideException: bean 'openAiChatModel' is defined twice, by org.springframework.ai.model.openai.autoconfigure.OpenAiChatAutoConfiguration and by dev.langchain4j.openai.spring.OpenAiAutoConfiguration
|
||||
|
||||
2. spring.autoconfigure.exclude=dev.langchain4j.openai.spring.OpenAiAutoConfiguration:
|
||||
context started
|
||||
bean chatClientBuilder -> org.springframework.ai.chat.client.ChatClient$Builder
|
||||
bean openAiChatModel -> org.springframework.ai.openai.OpenAiChatModel
|
||||
beans of type dev.langchain4j.model.chat.ChatModel: 0
|
||||
beans of type org.springframework.ai.chat.model.ChatModel: 1
|
||||
|
||||
3. spring.main.allow-bean-definition-overriding=true:
|
||||
context started
|
||||
bean openAiChatModel -> org.springframework.ai.openai.OpenAiChatModel
|
||||
bean chatClientBuilder -> org.springframework.ai.chat.client.ChatClient$Builder
|
||||
beans of type dev.langchain4j.model.chat.ChatModel: 0
|
||||
beans of type org.springframework.ai.chat.model.ChatModel: 1
|
||||
Reference in New Issue
Block a user