Package io.agentscope.core.agui.model
Interface MessageContent
- All Known Implementing Classes:
MessageContent.Blocks,MessageContent.Text
Type-safe union representing the
content field of an AG-UI message.
In the AG-UI protocol, message content can be either a plain string or an
array of structured InputContent parts. This sealed interface models
that union without resorting to Object, providing compile-time type
safety and exhaustive pattern matching.
JSON forms:
MessageContent.Text→ JSON string:"Hello"MessageContent.Blocks→ JSON array:[{"type":"text","text":"Hi"},{"type":"image",...}]
Custom Jackson serialization/deserialization handles the non-object JSON
shape (scalar vs. array) via MessageContentDeserializer and
MessageContentSerializer.
- Since:
- 2026-08-01
- Author:
- shanhongyu
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordStructured content blocks, serialized as a JSON array ofInputContent.static final recordPlain text content, serialized as a JSON string.