You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jiri Ondrusek (Jira)" <ji...@apache.org> on 2024/06/11 11:54:00 UTC

[jira] [Created] (CAMEL-20863) camel-langchain4j-chat: NPE if only producer is used

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)