类 ContentBlock

java.lang.Object
io.agentscope.core.message.ContentBlock
所有已实现的接口:
State
直接已知子类:
AudioBlock, ImageBlock, TextBlock, ThinkingBlock, ToolResultBlock, ToolUseBlock, VideoBlock

public sealed class ContentBlock extends Object implements State permits TextBlock, ImageBlock, AudioBlock, VideoBlock, ThinkingBlock, ToolUseBlock, ToolResultBlock
Base sealed class for all content blocks in messages.

Content blocks represent different types of content that can be included in a message, such as text, images, audio, video, or thinking content. This sealed hierarchy ensures type safety and enables exhaustive pattern matching.

Supported Content Types:

Uses Jackson annotations for polymorphic JSON serialization with the "type" discriminator field. The sealed modifier restricts subclasses to the specified permits list, enabling compile-time exhaustiveness checking in pattern matching.

  • 构造器详细资料

    • ContentBlock

      public ContentBlock()