davsclaus opened a new pull request, #28143: URL: https://github.com/apache/camel/pull/28143
[CAMEL-25863](https://issues.apache.org/jira/browse/CAMEL-25863): the langchain4j-chat page did not say what happens to the body. The component sends it to the model as the user message, and the answer of the model, a `String`, replaces it. A route that classifies data and goes on with that data lost it. Found in a benchmark of Oct 19-20 2026, in an example that classifies support tickets with a local model. In 10 of 12 runs the body became the model's answer ("Dear Customer, ..."), and the route then failed on `${body[ticketId]}`. No run used `variableSend`/`variableReceive` of the `to`. - A new section, "The body is the message, and the answer replaces it", right after "Configuring the model by provider". It has an example in Java, XML and YAML: the prompt is built in a variable with simple, sent with `variableSend`, and the answer comes back in a variable with `variableReceive`, so the body (here a review) stays as it was. Its YAML is the second sample of the page, which `camel_catalog_sample` returns. - "Send a prompt with variables" names the header of the template, `CamelLangChain4jChatPromptTemplate`. A note says that `{{name}}` is a property placeholder in YAML, XML and properties files, which Camel resolves before the route runs. In the benchmark, 5 runs copied the Java template form into YAML and got "Property with key [...] not found". - The error for a missing template names the header: "The prompt template is a required header: CamelLangChain4jChatPromptTemplate". Before, it said "The promptTemplate is a required header". - The catalog copy of the page is the same as the page. ## Tests - The YAML example as written, run with `camel run` and the model configured by provider (Ollama, granite4:3b), fed two reviews: "Review R-1 is Positive" and "Review R-2 is Negative". The body kept the review, and the answer was in the variable. - The component builds (`mvn install -DskipTests`); the generated parts of the page did not change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m -- 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]
