UserMessageContent class sealed

Content for a user message.

Supports two representations internally (UserMessageTextContent and UserMessagePartsContent), but always serializes to a list of content parts in JSON. Use fromJson to deserialize from either a plain string or a list of content objects.

Implementers

Constructors

UserMessageContent.fromJson(Object json)
Creates a UserMessageContent from JSON.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String?
Extracts the text from this content.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Object
Converts to JSON.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

fromText(String text) UserMessageContent
Creates a text content.
parts(List<InputContent> parts) UserMessageContent
Creates a parts content.