Claus Ibsen created CAMEL-26206:
-----------------------------------

             Summary: camel-langchain4j-ingest - text mode ingests any body by 
its toString, for example a TextSegment
                 Key: CAMEL-26206
                 URL: https://issues.apache.org/jira/browse/CAMEL-26206
             Project: Camel
          Issue Type: Bug
          Components: camel-langchain4j
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while adding the catalog body types of langchain4j-ingest (CAMEL-24961, 
PR #28401).

h4. 1. Text mode ingests any body via toString without an error

{{LangChain4jIngestProducer.textBody}} (main 2a465aa4814c, line 331) reads the 
body with {{getBody(String.class)}}, which for an object without a real text 
form gives its {{toString()}}. A {{TextSegment}} body is ingested as the text 
{{TextSegment \{ text = ...}}, a POJO or a Map as their {{toString()}}, and 
nothing tells the route. Checked on 4.24.0-SNAPSHOT with deterministic 
embedding models and an {{InMemoryEmbeddingStore}}.

Proposed: take the text of a {{TextSegment}} / {{Document}} body, and fail for 
bodies that are not text, bytes, a stream, a file or a Reader.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to