zbendhiba opened a new pull request, #25271:
URL: https://github.com/apache/camel/pull/25271
…amel-langchain4j-tools
### Description
Step 4: Add tool-calling to camel-langchain4j-chat producer, deprecate
camel-langchain4j-tools
### Why deprecate camel-langchain4j-tools?
`camel-langchain4j-tools `was doing two jobs in one component: defining
tools (consumer) and running the tool-calling loop (producer). Both tightly
coupled to LangChain4j.
With `camel-ai-tool `(Step 1), tool definitions are now framework-agnostic.
The same ai-tool: routes work with langchain4j, Spring AI, or anything else.
That left the tools producer doing one thing: chat with tool specs attached.
That's just a chat operation. It belongs in the chat component.
One component for chat. One component for tools. No more juggling two
LangChain4j components for a single conversation.
### Summary
- Tool-calling loop: when tags is set on the chat producer, tools are
discovered from AiToolRegistry, converted via AiToolSpecToLangChain4j bridge,
and sent as ToolSpecification in the ChatRequest. The producer loops until the
LLM stops requesting tools or maxToolCallingRoundTrips (default 10) is reached
- RAG + tools: augmented data and tool calling work together in the same
request
- Deprecation: all camel-langchain4j-tools classes annotated
@Deprecated(since = "4.22.0"), deprecation warning logged on startup, doc and
pom.xml updated
- Tests: 7 unit tests with OpenAIMock, 7 IT wrappers for Ollama, security
test for undeclared argument filtering
- Docs: tool-calling section in langchain4j-chat component doc, migration
path in upgrade guide
No changes to other modules.
### Roadmap
- [x] Step 1: Create the new camel-ai-tool module - PR #24473
- [x] Step 2: Wire camel-langchain4j-agent producer to AiToolRegistry - PR
#24988
- [x] Step 3: Wire camel-spring-ai-chat producer to AiToolRegistry - PR
#24862
- [ ] Step 4 (this PR): Add tool-calling to camel-langchain4j-chat,
deprecate camel-langchain4j-tools
- [ ] Step 5: Remove or deprecate camel-spring-ai-tools
- [ ] Step 6: Add tool support to camel-openai
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]