ContentBlock class sealed

Content blocks represent displayable information in the Agent Client Protocol.

They provide a structured way to handle various types of user-facing content—whether it's text from language models, images for analysis, or embedded resources for context.

Content blocks appear in:

  • User prompts sent via session/prompt
  • Language model output reported through session/update notifications as
Implemented types
Implementers

Constructors

ContentBlock.fromJson(Object? json)
Decodes the tagged union.
factory

Properties

discriminator String
The exact discriminator string.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toAcpJson() AcpJsonValue
Converts this protocol value to its immutable JSON representation.
inherited
toJson() Map<String, Object?>
Encodes the tagged union.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited