ModelMessage class

A single user-facing chat message. Mirrors ModelMessage.ts.

content is either a plain String or a List of content-part maps ([{"type":"text","text":"..."}, ...]); it is kept as Object so both shapes pass through verbatim.

Annotations
  • @JsonSerializable.new()

Constructors

ModelMessage({required String role, required Object content})
ModelMessage.fromJson(Map<String, dynamic> json)
factory

Properties

content Object
final
contentParts List<Map<String, dynamic>>
Convenience view of content as a list of content-part maps.
no setter
hashCode int
The hash code for this object.
no setterinherited
role String
final
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
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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