feat(agui): introduce typed MessageContent and InputContent model for multimodal AG-UI messages (issue#551) - #2518
Open
xzxiaoshan wants to merge 2 commits into
Conversation
… multimodal AG-UI messages
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
5 tasks
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
完成 issue #551
Summary
将 AG-UI 协议的
AguiMessage.content从String升级为类型安全的 sealed 联合类型MessageContent,支持纯文本和多模态内容块(text/image/audio/video/document),对齐 AG-UI 协议规范。Background
此前
AguiMessage.content仅支持String,无法承载多模态输入。本 PR 按照类型安全的设计原则,引入 AG-UI 协议层的类型化模型,替代Object/List<Map<String, Object>>等弱类型方案。架构总览
设计要点
1. AguiMessage.content —— 类型安全的联合
string | InputContent[]联合类型Text/Blocks(或hasBlocks()),不引入"多模态"2. InputContent —— 类型化的协议模型
Map<String, Object>,提供编译期类型安全type字段分派(标准@JSONType(seeAlso=...))3. Converter —— 编译期穷尽的类型映射
引用的 AG-UI 格式定义
https://docs.ag-ui.com/concepts/messages