You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "JiriOndrusek (via GitHub)" <gi...@apache.org> on 2026/10/02 13:43:46 UTC

[PR] CAMEL-25027: camel-langchain4j-ingest - Add media modality [camel]

JiriOndrusek opened a new pull request, #27289:
URL: https://github.com/apache/camel/pull/27289

   # Description
   
   Adds `modality=text|media` to camel-langchain4j-ingest. In media mode the body is embedded whole, as one vector, through LangChain4j's multimodal `EmbeddingRequest`: audio, image, video or PDF, chosen by the MIME type from the new `contentType` option or the file extension (camel-util's MIME table). The vector is stored with a placeholder segment carrying the usual identity metadata.
   
   The endpoint refuses to start with a text-only model, a listener-wrapped model, or a fixed `contentType` the model does not declare. A per-document medium the model lacks fails before the body is read. Size options count bytes; splitter options do not apply.
   
   One `media` value instead of one per medium: it lets one endpoint feed a mixed folder into one store through a CLIP-like model, which is today's realistic use, since images are embedded by several providers while audio by none. The LangChain4j API used is marked experimental; the surface is small and covered by tests.
   
   Follow-ups: media on `camel-langchain4j-embeddings` for the query side, and moving the MIME-to-content logic to camel-langchain4j-core at that point.
   
   JIRA: https://issues.apache.org/jira/browse/CAMEL-25027
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful subject line and body.
   
   - [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used.
   
   Claude Code on behalf of @JiriOndrusek 


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25027: camel-langchain4j-ingest - Add media modality [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27289:
URL: https://github.com/apache/camel/pull/27289#issuecomment-5954415300

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `catalog/camel-catalog`
   - `components/camel-ai/camel-langchain4j-ingest`
   - `dsl/camel-componentdsl`
   - `dsl/camel-endpointdsl`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 9 of 698 tested, 24 compile-only — current: 9 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **9 affected modules** (current approach: 9).
   
   **Skip-tests mode would test 9 modules** (4 direct + 8 downstream), **skip tests for 24** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (9)</summary>
   
   - `camel-jbang-mcp` ← downstream of org.apache.camel:camel-catalog
   - `camel-jbang-plugin-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-route-parser` ← downstream of org.apache.camel:camel-route-parser
   - `camel-jbang-plugin-tui` ← downstream of org.apache.camel:camel-catalog
   - `camel-jbang-plugin-validate` ← downstream of org.apache.camel:camel-yaml-dsl-validator
   - `camel-langchain4j-ingest` ← components/camel-ai/camel-langchain4j-ingest/src/generated/java/org/apache/camel/component/langchain4j/ingest/LangChain4jIngestComponentConfigurer.java, components/camel-ai/camel-langchain4j-ingest/src/generated/java/org/apache/camel/component/langchain4j/ingest/LangChain4jIngestConfigurationConfigurer.java, components/camel-ai/camel-langchain4j-ingest/src/generated/java/org/apache/camel/component/langchain4j/ingest/LangChain4jIngestEndpointConfigurer.java, components/camel-ai/camel-langchain4j-ingest/src/generated/java/org/apache/camel/component/langchain4j/ingest/LangChain4jIngestEndpointUriFactory.java, components/camel-ai/camel-langchain4j-ingest/src/generated/resources/META-INF/org/apache/camel/component/langchain4j/ingest/langchain4j-ingest.json, components/camel-ai/camel-langchain4j-ingest/src/main/docs/langchain4j-ingest-component.adoc, components/camel-ai/camel-langchain4j-ingest/src/main/java/org/apache/camel/component/langchain4j/ingest/
 IngestModality.java, components/camel-ai/camel-langchain4j-ingest/src/main/java/org/apache/camel/component/langchain4j/ingest/IngestService.java, components/camel-ai/camel-langchain4j-ingest/src/main/java/org/apache/camel/component/langchain4j/ingest/LangChain4jIngestConfiguration.java, components/camel-ai/camel-langchain4j-ingest/src/main/java/org/apache/camel/component/langchain4j/ingest/LangChain4jIngestProducer.java, components/camel-ai/camel-langchain4j-ingest/src/main/java/org/apache/camel/component/langchain4j/ingest/MediaIngestService.java, components/camel-ai/camel-langchain4j-ingest/src/main/java/org/apache/camel/component/langchain4j/ingest/MediaTypes.java, components/camel-ai/camel-langchain4j-ingest/src/test/java/org/apache/camel/component/langchain4j/ingest/DeterministicEmbeddingModel.java, components/camel-ai/camel-langchain4j-ingest/src/test/java/org/apache/camel/component/langchain4j/ingest/DeterministicMediaEmbeddingModel.java, components/camel-ai/camel-langchain4j
 -ingest/src/test/java/org/apache/camel/component/langchain4j/ingest/LangChain4jIngestMediaFolderTest.java, components/camel-ai/camel-langchain4j-ingest/src/test/java/org/apache/camel/component/langchain4j/ingest/LangChain4jIngestMediaTest.java, components/camel-ai/camel-langchain4j-ingest/src/test/java/org/apache/camel/component/langchain4j/ingest/LangChain4jIngestValidationTest.java
   - `camel-launcher-container` ← downstream of org.apache.camel:camel-launcher
   - `camel-yaml-dsl-validator` ← downstream of org.apache.camel:camel-catalog
   - `camel-yaml-dsl-validator-maven-plugin` ← downstream of org.apache.camel:camel-yaml-dsl-validator
   
   </details>
   
   <details><summary>Modules with tests skipped (24)</summary>
   
   - `apache-camel`
   - `camel-allcomponents`
   - `camel-catalog-console`
   - `camel-catalog-maven`
   - `camel-catalog-suggest`
   - `camel-endpointdsl-support`
   - `camel-itest`
   - `camel-jbang-core`
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-kamelet-main`
   - `camel-launcher`
   - `camel-report-maven-plugin`
   - `camel-route-parser`
   - `camel-yaml-dsl`
   - `camel-yaml-dsl-deserializers`
   - `camel-yaml-dsl-maven-plugin`
   - `coverage`
   - `docs`
   - `dummy-component`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   <details><summary>All tested modules (36 modules, 6m 20s total)</summary>
   
   **Total reactor time:** 6m 20s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 50.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: TUI | 45.4s | SUCCESS |
   | Camel :: JBang :: MCP | 43.1s | SUCCESS |
   | Camel :: AI :: LangChain4j :: Ingest | 34.0s | SUCCESS |
   | Camel :: Catalog :: Camel Catalog | 25.3s | SUCCESS |
   | Camel :: YAML DSL :: Validator | 21.6s | SUCCESS |
   | Camel :: YAML DSL | 20.9s | SUCCESS |
   | Camel :: Component DSL | 20.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 19.6s | SUCCESS |
   | Camel :: Docs | 16.0s | SUCCESS |
   | Camel :: Kamelet Main | 10.0s | SUCCESS |
   | Camel :: YAML DSL :: Deserializers | 9.0s | SUCCESS |
   | Camel :: Catalog :: Camel Route Parser | 7.8s | SUCCESS |
   | Camel :: Catalog :: Camel Report Maven Plugin | 7.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 7.7s | SUCCESS |
   | Camel :: YAML DSL :: Validator Maven Plugin | 7.3s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 6.1s | SUCCESS |
   | Camel :: All Components Sync point | 5.2s | SUCCESS |
   | Camel :: Catalog :: Maven | 3.6s | SUCCESS |
   | Camel :: YAML DSL :: Maven Plugins | 3.5s | SUCCESS |
   | Camel :: Catalog :: Suggest (deprecated) | 2.5s | SUCCESS |
   | Camel :: Assembly | 1.9s | SUCCESS |
   | Camel :: Coverage | 1.3s | SUCCESS |
   | Camel :: Catalog :: Dummy Component | 1.3s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.2s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.2s | SUCCESS |
   | Camel :: Catalog :: Console | 1.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.0s | SUCCESS |
   | Camel :: Endpoint DSL :: Support | 0.8s | SUCCESS |
   | Camel :: Launcher :: Container | 0.8s | SUCCESS |
   | Camel :: JBang :: Main | 0.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 0.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: Route Parser | 0.5s | SUCCESS |
   | Camel :: Endpoint DSL | n/a |  |
   | Camel :: Integration Tests | n/a |  |
   | Camel :: JBang :: Core | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (50.7s)
   - `Camel :: JBang :: Plugin :: TUI` (45.4s)
   - `Camel :: JBang :: MCP` (43.1s)
   - `Camel :: AI :: LangChain4j :: Ingest` (34.0s)
   - `Camel :: Catalog :: Camel Catalog` (25.3s)
   - `Camel :: YAML DSL :: Validator` (21.6s)
   - `Camel :: YAML DSL` (20.9s)
   - `Camel :: Component DSL` (20.8s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (19.6s)
   - `Camel :: Docs` (16.0s)
   - `Camel :: Kamelet Main` (10.0s)
   - `Camel :: YAML DSL :: Deserializers` (9.0s)
   - `Camel :: Catalog :: Camel Route Parser` (7.8s)
   - `Camel :: Catalog :: Camel Report Maven Plugin` (7.7s)
   - `Camel :: JBang :: Plugin :: Testing` (7.7s)
   - `Camel :: YAML DSL :: Validator Maven Plugin` (7.3s)
   - `Camel :: JBang :: Plugin :: Validate` (6.1s)
   - `Camel :: All Components Sync point` (5.2s)
   - `Camel :: Catalog :: Maven` (3.6s)
   - `Camel :: YAML DSL :: Maven Plugins` (3.5s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/37014934709)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25027: camel-langchain4j-ingest - Add media modality [camel]

Posted by "jiriOndrusek-agent (via GitHub)" <gi...@apache.org>.
jiriOndrusek-agent commented on PR #27289:
URL: https://github.com/apache/camel/pull/27289#issuecomment-5990008796

   Thanks for the review @davsclaus. Addressed in 8740a78dd819, kept as a separate commit.
   
   **Fixed**
   - `documentFilter` description now says the predicate sees the body as the consumer delivered it, not yet read as text or bytes.
   - `maxDocumentSize` description now reads "characters of the text about to be split, or bytes of a media body with modality=media"; both setter javadocs updated. JSON, catalog and DSL regenerated.
   
   **Suggestions taken**
   - Size check before the read: with `modality=media` the length a file consumer announces in `CamelFileLength` is checked against `maxDocumentSize` before the file is read; any other body is checked once in memory. Covered by a test with an unreadable body.
   - The placeholder segment now carries the MIME type under `camel_ingest_content_type` (media segments only), so a retriever on a shared store can tell a media hit from text.
   - Listener class-name check: follow-up [CAMEL-25332](https://issues.apache.org/jira/browse/CAMEL-25332), referenced from the TODO next to the check.
   
   **Questions**
   - Automatic listeners: neither quarkus-langchain4j nor langchain4j-spring references `EmbeddingModelListener` today; their listener wiring is for chat models. Added a sentence to the doc; the opt-out is a model configured without listeners.
   - `image/svg+xml`: intended. The MIME family decides the medium and the provider decides which formats within it, so Camel keeps no per-provider format list. Documented in the media section.
   
   _Written with Claude Code on behalf of Jiří Ondrušek._
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25027: camel-langchain4j-ingest - Add media modality [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #27289:
URL: https://github.com/apache/camel/pull/27289


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25027: camel-langchain4j-ingest - Add media modality [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27289:
URL: https://github.com/apache/camel/pull/27289#issuecomment-5953758206

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org