You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "Croway (via GitHub)" <gi...@apache.org> on 2025/12/09 18:31:10 UTC

[PR] use UserMessage for Multimodality [camel]

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

   This PR introduces two features:
   
   * The `AiAgentBody` now supports the `Content`, for example
   ```
   String base64Image = Base64.getEncoder().encodeToString(imageBytes);
           Image image = Image.builder()
                   .base64Data(base64Image)
                   .mimeType("image/png")
                   .build();
           ImageContent imageContent = ImageContent.from(image);
   
           AiAgentBody<ImageContent> body = new AiAgentBody<ImageContent>()
                   .withUserMessage("What do you see in this image? Describe it briefly.")
                   .withContent(imageContent);
   
           String response = template.requestBody("direct:multimodal-agent", body, String.class);
   
   ...
   
   from("direct:multimodal-agent")
                           .to("langchain4j-agent:multimodal?agent=#multimodalAgent")
                           .to("mock:response");
   ```
   
   * Add a TypeConverter that convert known objects (WrappedFile, byte[], InputStream) to Langchain4j `Content`. This the following is possible
   ```
   from("file:my/path?noop=true&include=.*\\.png")
                           .setHeader(Headers.USER_MESSAGE, constant("What do you see in this image? Describe it briefly."))
                           .to("langchain4j-agent:describe?agent=#fileAgent")
                           .to("mock:image-response");
   ```
   
   Of course this works only with Multimodal LLMs
   
   https://github.com/apache/camel/compare/main...Croway:langchain4j-multimodality?expand=1#diff-b0dc9cfbbe1c90adf071247e6747e0be5a00286be7f7af27d25d0102e1d0fda3R44 - This was introduced to reduce duplicated lines of code
   


-- 
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] use UserMessage for Multimodality [camel]

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

   :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.
   
   * You can label PRs using `build-all`, `build-dependents`, `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


Re: [PR] use UserMessage for Multimodality [camel]

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


-- 
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