ChatMessage class
Represents a chat message used by a chat client.
Constructors
-
ChatMessage({required ChatRole role, List<
AIContent> ? contents, String? authorName, DateTime? createdAt, String? messageId, Object? rawRepresentation, AdditionalPropertiesDictionary? additionalProperties}) - Creates a new ChatMessage.
- ChatMessage.fromText(ChatRole role, String text, {String? authorName})
- Creates a ChatMessage with TextContent from a string.
Properties
- additionalProperties ↔ AdditionalPropertiesDictionary?
-
Additional properties.
getter/setter pair
-
The name of the message author.
getter/setter pair
-
contents
→ List<
AIContent> -
The content items of the message.
final
- createdAt ↔ DateTime?
-
When the message was created.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- messageId ↔ String?
-
A unique identifier for the message.
getter/setter pair
- rawRepresentation ↔ Object?
-
The underlying implementation-specific object.
getter/setter pair
- role → ChatRole
-
The role of the message author.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String
-
Gets concatenated text from all TextContent items.
no setter
Methods
-
clone(
) → ChatMessage - Creates a deep copy of this message.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited