Jiri Ondrusek created CAMEL-20863:
-------------------------------------

             Summary: camel-langchain4j-chat: NPE if only producer is used
                 Key: CAMEL-20863
                 URL: https://issues.apache.org/jira/browse/CAMEL-20863
             Project: Camel
          Issue Type: Bug
          Components: camel-ai
    Affects Versions: 4.7.0
            Reporter: Jiri Ondrusek
            Assignee: Jiri Ondrusek


If endpoint uses only a producer (example from camel-quarkus [integration 
tests|https://github.com/apache/camel-quarkus/blob/main/integration-tests/langchain4j-chat/src/main/java/org/apache/camel/quarkus/component/langchain/chat/it/OllamaRoute.java])
Producer for multiple messages requires  
_CamelToolExecutorCache.getInstance().getTools()_  to return something (!= 
null) see 
[code|https://github.com/apache/camel/blob/main/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatProducer.java#L142C53-L142C101]
I checked that only place which is adding something to the cache is a   
[consumer|https://github.com/apache/camel/blob/main/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpoint.java#L104],
 which does not seem to be correct.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to