Interface MessageContent

All Known Implementing Classes:
MessageContent.Blocks, MessageContent.Text

public sealed interface MessageContent permits MessageContent.Text, MessageContent.Blocks
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:

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 Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Structured content blocks, serialized as a JSON array of InputContent.
    static final record 
    Plain text content, serialized as a JSON string.