JiriOndrusek opened a new pull request, #8926:
URL: https://github.com/apache/camel-quarkus/pull/8926

   > **Depends on:** https://github.com/apache/camel-quarkus/pull/8923 (adds 
the `camel-quarkus-ai-tool` extension). This PR builds on top of it.
   
   ## Summary
   
   Fixes https://github.com/apache/camel-quarkus/issues/8768
   
   - Bridges Camel's `AiToolRegistry` to langchain4j's `ToolProvider` SPI via 
`CamelAiToolProvider` in `extensions-support/langchain4j`. When both 
`camel-ai-tool` and `quarkus-langchain4j` are on the classpath, the deployment 
processor auto-registers `CamelAiToolProvider` as a CDI bean — all Camel 
`ai-tool:` routes become available to `@RegisterAiService` AI services without 
explicit wiring.
   - Introduces `@CamelAiTools("tag")` annotation for per-AI-service tool 
filtering via a CDI interceptor + ThreadLocal pattern. Services annotated with 
a tag only see tools matching that tag; services without the annotation see all 
tools.
   - Users must add `camel-langchain4j-agent` as an explicit dependency (it is 
optional in the support module and not brought in transitively). This is 
documented in `usage.adoc`.
   
   ## Key files
   
   | File | Purpose |
   |------|---------|
   | `CamelAiToolProvider.java` | `ToolProvider` implementation bridging 
`AiToolRegistry` → langchain4j |
   | `CamelAiTools.java` | `@InterceptorBinding` annotation carrying the tag 
value |
   | `CamelAiToolsInterceptor.java` | CDI interceptor setting ThreadLocal tag 
before AI service calls |
   | `SupportQuarkusLangchain4jProcessor.java` | Build-time discovery of 
`@CamelAiTools` and CDI bean registration |
   | `usage.adoc` | User-facing documentation with dependency note |
   
   ## Test plan
   
   - [x] `./mvnw verify -f integration-tests/ai-tool-langchain4j` — 6 mock 
tests pass (weather/admin chat, tag registry filtering, wrong-tag isolation)
   - [ ] `./mvnw verify -f integration-tests/ai-tool-langchain4j 
-Dollama.test=true -Pollama` — real LLM tests with Ollama
   - [x] `wrongTagShouldNotExposeWeatherTool` — mock model conditionally calls 
`getWeather` only if visible; confirms test fails when interceptor is broken
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to