Skip to content

feat(agui): Add multimodal input support (image/video/audio) to AguiM… - #1380

Open
NoiAI wants to merge 1 commit into
agentscope-ai:mainfrom
NoiAI:feat/agui-multimodal-v3
Open

feat(agui): Add multimodal input support (image/video/audio) to AguiM…#1380
NoiAI wants to merge 1 commit into
agentscope-ai:mainfrom
NoiAI:feat/agui-multimodal-v3

Conversation

@NoiAI

@NoiAI NoiAI commented May 12, 2026

Copy link
Copy Markdown

…essage and AguiMessageConverter

Adds support for multimodal input (image, video, audio, document) in the AG-UI extension, aligning with the AG-UI Protocol InputContent specification.

  • AguiMessage.content: String -> Object (backward compatible)
  • AguiMessageConverter: InputContent[] -> ContentBlock conversion
  • Supports both url and data (base64) source types

AgentScope-Java Version

[The version of AgentScope-Java you are working on, e.g. 1.0.12, check your pom.xml dependency version or run mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]

Description

[Please describe the background, purpose, changes made, and how to test this PR]

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@NoiAI
NoiAI requested a review from a team May 12, 2026 04:38
@CLAassistant

CLAassistant commented May 12, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@NoiAI
NoiAI force-pushed the feat/agui-multimodal-v3 branch 2 times, most recently from 88419b9 to 2e87d78 Compare May 12, 2026 04:51
@codecov

codecov Bot commented May 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.61538% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...cope/core/agui/converter/AguiMessageConverter.java 83.67% 3 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

…essage and AguiMessageConverter

Adds support for multimodal input (image, video, audio, document) in the AG-UI extension, aligning with the AG-UI Protocol InputContent specification.

- AguiMessage.content: String -> Object (backward compatible)
- AguiMessageConverter: InputContent[] -> ContentBlock conversion
- Supports both url and data (base64) source types
@NoiAI
NoiAI force-pushed the feat/agui-multimodal-v3 branch from 2e87d78 to 5d6cb4b Compare May 12, 2026 06:39
@zhengxudong

Copy link
Copy Markdown

这个功能对我们项目非常重要,我们已经测试过可以正常使用,希望能尽快合并,非常感谢!

@LearningGp

Copy link
Copy Markdown
Member

PTAL @chickenlj

@AgentScopeJavaBot AgentScopeJavaBot added enhancement New feature or request area/ext/integration External protocols & middleware integrations labels May 28, 2026
@junnan2014

Copy link
Copy Markdown

We have a real-world need for this feature (Spring Boot + HarnessAgent + DashScope + AG-UI web client, where users send images/audio recordings from the browser). Currently we have to work around the protocol layer by smuggling attachments through forwardedProps and rebuilding Msg content blocks in an Agent decorator — this PR would remove that workaround entirely.

To help move this forward, I independently verified this PR today (2026-07-28):

  • On the PR branch as-is: mvn test on the agui module passes — 231 tests, 0 failures (including the 81 new multimodal test cases).
    • Cherry-picked 5d6cb4b onto latest main (ed81704): applies with zero conflicts — git rename detection handles the module move to agentscope-extensions-protocol/ transparently.
    • Latest main + this patch: agui module passes 258 tests, 0 failures.
      The approach also aligns well with the AG-UI protocol InputContent spec (https://docs.ag-ui.com/drafts/multimodal-messages), and the downstream conversion path is already in place (ImageBlock/AudioBlock/VideoBlock in core, DashScopeMediaConverter etc. in model extensions) — this protocol-layer gap is the only missing piece for end-to-end multimodal via AG-UI.

@chickenlj @LearningGp Could this get a review? If the original author is no longer available, I'd be happy to help rebase, fill in the PR description checklist, and cover the remaining uncovered lines flagged by codecov.

@oss-maintainer oss-maintainer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. @SuppressWarnings("unchecked") — Multiple unchecked casts from Map<String, Object>. This is acceptable given JSON deserialization constraints, but consider adding a typed DTO (e.g., InputContent) for type safety in a follow-up.

  2. CLA not signed — The CLA assistant flag is still pending. Please sign the CLA at https://cla-assistant.io/agentscope-ai/agentscope-java?pullRequest=1380 before this can be merged.

  3. May need rebase — This PR has been open since May. Please rebase onto current main to ensure no merge conflicts with recent AG-UI changes (e.g., PR #2452 metadata field, PR #2463 toolkit refactoring).

Verdict

Solid implementation of a much-requested feature. The core conversion logic is correct and well-tested. Addressing the document data loss (#1) and rebasing would make this merge-ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ext/integration External protocols & middleware integrations enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants