jamesnetherton commented on issue #8836:
URL: https://github.com/apache/camel-quarkus/issues/8836#issuecomment-4915680569

   Some potential options to fix this (in order of complexity):
   
   1. Set `AiServiceContext.chatMemoryService` field to `null` directly when 
`AiAgentWithoutMemoryService` is created.
   
   ```java
   AiServiceContext ctx = 
AiServiceContext.create(AiAgentWithoutMemoryService.class);
   ctx.chatMemoryService = null;
   AiServices.<AiAgentWithoutMemoryService>builder(ctx).chatModel(...).build();
   ```
   
   This works, but relies on `@Internal` APIs (QL4J actually uses these classes 
directly already).
   
   2. Fix LangChain4j
   
   Make `chatMemoryProvider(null)` on that `AiServices` builder actually clear 
memory instead of ignoring `null`. E.g remove `null` guard here:
   
   
https://github.com/langchain4j/langchain4j/blob/c2aa57844eb1974572f9c9d12e6a74566d2a57f6/langchain4j/src/main/java/dev/langchain4j/service/AiServices.java#L431-L433
   
   Then the `chatMemoryProvider` could be nullified in 
`AgentWithoutMemory.createAiAgentService`.
   
   3. Fix QL4J add and an exclusion mechanism where the Camel agent interfaces 
could be excluded from build time discovery.
   
   E.g by providing a build item with a predicate that matches against a FQCN. 
Similar to how `IgnoreJaxbAnnotatedClassesBuildItem` works. 
   


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