zbendhiba commented on issue #8768:
URL: https://github.com/apache/camel-quarkus/issues/8768#issuecomment-4933752075

   ## Update:
   
   Camel 4.22 introduces camel-ai-tool 
([CAMEL-23382](https://issues.apache.org/jira/browse/CAMEL-23382)). It lets you 
define Camel routes as LLM-callable tools, registered in a shared 
AiToolRegistry and grouped by tags. Arguments are passed as exchange headers. 
   
   ```
    from("ai-tool:getOrderStatus?tags=support&description=Get order status by 
ID" +
         "&parameter.orderId=string&parameter.orderId.required=true")
         .to("sql:SELECT status FROM orders WHERE id = ${header.orderId}");
   ```
   
   (tracking PR https://github.com/apache/camel/pull/24473)
   
   ## Revised Proposal:
   
   Two extensions:
   
   1. `camel-quarkus-ai-tool`: standard Quarkus extension for camel-ai-tool. 
Framework-agnostic. Other AI producer extensions depend on it 
(`camel-quarkus-langchain4j-agent`, `camel-quarkus-openai`, future 
`camel-quarkus-mcp-server`).
   2. `LangChain4j bridge extension (name TBD)`: separate extension that 
bridges `AiToolRegistry` to `@RegisterAiService` via the ToolProvider SPI. 
Provides a `@CamelTools("tag")` annotation for tag filtering and mixed tool 
support.
   
   ## Usage
   
   ### Camel tools only.
   Add the bridge extension, all ai-tool: routes are discovered automatically:
   ```
     @RegisterAiService
     interface SupportAgent {
         String chat(String message);
     }
   ```
   
     ### Tag-filtered:
     ```
   @RegisterAiService
     @CamelTools("support")
     interface SupportAgent {
         String chat(String message);
     }
   ```
   
     ### Mixed
   Java `@Tool` classes and Camel routes together:
   ```
     @RegisterAiService(tools = CalculatorTools.class)
     @CamelTools("support")
     interface MixedAgent {
         String chat(String message);
     }
   ```
   
   PS: `@CamelTools` wires an explicit toolProviderSupplier under the hood, 
since `BeanIfExistsToolProviderSupplier` is skipped when `tools=` is set.
   
   
   
   
   


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