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,19 @@
|
||||
# A tool that throws (ORD-500 raises IllegalStateException: order database unavailable)
|
||||
|
||||
Case 1: a well-behaved model. It asks for the tool once, then answers from whatever the tool message says.
|
||||
Spring AI : 2 requests, tool body ran 1 time(s). Tool message the model received: "order database unavailable"
|
||||
answer: Done: order database unavailable
|
||||
LangChain4j : 2 requests, tool body ran 1 time(s). Tool message the model received: "order database unavailable"
|
||||
answer: Done: order database unavailable
|
||||
|
||||
Case 2: an insistent model. It asks for the tool again after every result. The server stops it with an HTTP 500 after 30 requests.
|
||||
Spring AI : 31 requests, tool body ran 30 time(s)
|
||||
exception InternalServerException: 500: cutoff reached
|
||||
LangChain4j : 31 requests, tool body ran 30 time(s)
|
||||
exception InternalServerException (root: HttpException): {"error":{"message":"cutoff reached"}}
|
||||
|
||||
Case 3: the same insistent model, each framework asked to stop after 5 tool rounds.
|
||||
Spring AI (ToolCallingAdvisor + our MaxToolRounds(5) checker): 6 requests, tool body ran 5 time(s)
|
||||
answer:
|
||||
LangChain4j (maxSequentialToolsInvocations(5)) : 6 requests, tool body ran 5 time(s)
|
||||
exception RuntimeException: Something is wrong, exceeded 5 tool calling round trips (maxToolCallingRoundTrips)
|
||||
Reference in New Issue
Block a user