Claus Ibsen created CAMEL-27861:
-----------------------------------
Summary: camel-langchain4j-embeddings: no start check for an
embedding model, token count headers can be null
Key: CAMEL-27861
URL: https://issues.apache.org/jira/browse/CAMEL-27861
Project: Camel
Issue Type: Bug
Components: camel-langchain4j-embeddings
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-langchain4j-embeddings
for CAMEL-23832 (pull request https://github.com/apache/camel/pull/31145).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. No start check for an embedding model
Without embeddingModel and without provider/customProvider the route starts and
every message fails with a NullPointerException at model.embed(...).
Proposed change: check in doStart, as LangChain4jChatProducer does.
h4. 2. Token count headers can be null
populateHeaders / populateBatchHeaders set each count header also when that
count is null (Ollama has no output count, OpenAI embeddings no completion
tokens).
Proposed change: set each header only when non-null.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)