zbendhiba opened a new pull request, #24988:
URL: https://github.com/apache/camel/pull/24988
…ol component
# Description
Step 2: Wire camel-langchain4j-agent producer to discover tools from
AiToolRegistry
# Summary
Migrate the camel-langchain4j-agent producer from camel-langchain4j-tools
(CamelToolExecutorCache) to the unified camel-ai-tool module (AiToolRegistry).
- Bridge adapter: new AiToolSpecToLangChain4j converts AiToolSpec →
LangChain4j ToolSpecification, with locale-safe type mapping (string, integer,
number, boolean, enum) and required parameter handling
- Error handling: parseArguments returns an error to the LLM on malformed
JSON instead of silently executing with empty args; ArgumentError returns a
descriptive message so the LLM can self-correct
- Tool discovery: per-exchange lookup from AiToolRegistry with tag-based
filtering and deduplication via LinkedHashMap
- Dependency swap: added camel-ai-tool to pom.xml
- Tests: new AiToolSpecToLangChain4jTest (9 test cases covering all
parameter types), migrated integration tests to ai-tool: consumer
- Docs: updated upgrade guide with migration instructions
No changes to other modules.
# Roadmap
- [x] Step 1: Create the new camel-ai-tool module - PR
https://github.com/apache/camel/pull/24473
- [x] Step 2 (this PR): Wire camel-langchain4j-agent producer to
AiToolRegistry
- [x] Step 3: Wire camel-spring-ai-chat producer to AiToolRegistry - PR
https://github.com/apache/camel/pull/24862
- [ ] Step 4: Wire camel-langchain4j-tools producer to AiToolRegistry
- [ ] Step 5: Deprecate camel-langchain4j-tools consumer, remove
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]