AIAssistantMessage class

Represents an AI Assistant message within the chat.

This class extends BaseMessage and adds extra properties specifically for AI assistant messages, such as runId, threadId, text, and tags.

Inheritance

Constructors

AIAssistantMessage({int? runId, String? threadId, String? text, List<String>? tags, int id = 0, String? muid, User? sender, AppEntity? receiver, required String receiverUid, required String type, required String receiverType, String category = CometChatMessageCategory.categoryAgentic, DateTime? sentAt, DateTime? deliveredAt, DateTime? readAt, Map<String, dynamic>? metadata, DateTime? readByMeAt, DateTime? deliveredToMeAt, DateTime? deletedAt, DateTime? editedAt, String? deletedBy, String? editedBy, DateTime? updatedAt, String? conversationId, int parentMessageId = 0, int replyCount = 0, int unreadRepliesCount = 0, List<User>? mentionedUsers, bool hasMentionedMe = false, List<ReactionCount>? reactions, BaseMessage? quotedMessage, int quotedMessageId = 0, Map<String, dynamic>? rawMessage})
Constructs a new AIAssistantMessage.
AIAssistantMessage.fromMap(dynamic map, {AppEntity? receiver})
Creates an AIAssistantMessage instance from a JSON map.
factory

Properties

category ↔ String
The category of message (message, action, call, custom, etc.). Android: String category (reference type, can be null)
getter/setter pairinherited
conversationId ↔ String?
The conversation ID this message belongs to. Android: String conversationId (reference type, can be null)
getter/setter pairinherited
deletedAt ↔ DateTime?
Timestamp when the message was deleted. Android: long deletedAt (primitive, 0 = not set)
getter/setter pairinherited
deletedBy ↔ String?
UID of the user who deleted the message. Android: String deletedBy (reference type, can be null)
getter/setter pairinherited
deliveredAt ↔ DateTime?
Timestamp when the message was delivered. Android: long deliveredAt (primitive, 0 = not set)
getter/setter pairinherited
deliveredToMeAt ↔ DateTime?
Timestamp when the message was delivered to the logged-in user. Android: long deliveredToMeAt (primitive, 0 = not set)
getter/setter pairinherited
editedAt ↔ DateTime?
Timestamp when the message was edited. Android: long editedAt (primitive, 0 = not set)
getter/setter pairinherited
editedBy ↔ String?
UID of the user who edited the message. Android: String editedBy (reference type, can be null)
getter/setter pairinherited
failureReason → MessageFailureReason?
Offline messaging: the MessageFailureReason of a failed send (BEH-SEND-35). Non-null only while status is CometChatMessageStatus.failed; null for every other status. Its value equals the reason the failed callback reported, is cleared when a retry returns the message to PENDING and when it is sent, and is never sent to the server.
no setterinherited
hashCode → int
The hash code for this object.
no setteroverride
hasMentionedMe ↔ bool
Whether the logged-in user is mentioned in this message. Android: boolean hasMentionedMe (primitive, defaults to false) Note: In Android, this is computed by checking if logged-in user UID is in the mentions map. Flutter computes this the same way in the mapper.
getter/setter pairinherited
id ↔ int
Unique identifier for the message. Android: long id (primitive, defaults to 0)
getter/setter pairinherited
localMessageId ↔ String?
Offline messaging: the SDK-generated optimistic handle for a queued send. Null unless the message was sent while offline messaging is enabled.
getter/setter pairinherited
mentionedUsers ↔ List<User>
List of users mentioned in this message. Android: List<User> mentionedUser (initialized to empty ArrayList)
getter/setter pairinherited
metadata ↔ Map<String, dynamic>?
Custom metadata attached to the message. Android: JSONObject metadata (reference type, can be null)
getter/setter pairinherited
muid ↔ String
Developer-set unique identifier. Android: String muid (reference type, can be null)
getter/setter pairinherited
parentMessageId ↔ int
Parent message ID for threaded messages. Android: long parentMessageId (primitive, defaults to 0)
getter/setter pairinherited
pinnedAt ↔ DateTime?
When this message was pinned to its conversation (pin & save). null = not pinned. Present-only-when-set on the wire — absence means "not pinned", never an error.
getter/setter pairinherited
pinnedBy ↔ String?
UID of the member who pinned this message, or the app_system sentinel when the pin was placed by an admin surface (API key / dashboard). null whenever pinnedAt is null.
getter/setter pairinherited
quotedMessage ↔ BaseMessage?
The quoted message (for reply messages). Android: BaseMessage quotedMessage (reference type, can be null)
getter/setter pairinherited
quotedMessageId ↔ int
The ID of the quoted message. Android: long quotedMessageId (primitive, defaults to 0)
getter/setter pairinherited
rawMessage ↔ Map<String, dynamic>?
The raw JSON message for passthrough of unmapped fields. Android: JSONObject rawMessage (reference type, can be null)
getter/setter pairinherited
reactions ↔ List<ReactionCount>
List of reactions on this message. Android: List<ReactionCount> reactions (initialized to empty ArrayList)
getter/setter pairinherited
readAt ↔ DateTime?
Timestamp when the message was read. Android: long readAt (primitive, 0 = not set)
getter/setter pairinherited
readByMeAt ↔ DateTime?
Timestamp when the message was read by the logged-in user. Android: long readByMeAt (primitive, 0 = not set)
getter/setter pairinherited
receiver ↔ AppEntity?
The receiver of the message (User or Group). Android: AppEntity receiver (reference type, can be null)
getter/setter pairinherited
receiverType ↔ String
The type of receiver (user or group). Android: String receiverType (required in constructor)
getter/setter pairinherited
receiverUid ↔ String
The UID of the receiver. Android: String receiverUid (required in constructor)
getter/setter pairinherited
replyCount ↔ int
Number of replies to this message. Android: int replyCount (primitive, defaults to 0)
getter/setter pairinherited
runId ↔ int?
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
savedAt ↔ DateTime?
When the logged-in user saved (bookmarked) this message. Per-viewer: two users see different values for the same message. null = not saved by me.
getter/setter pairinherited
sender ↔ User?
The sender of the message. Android: User sender (reference type, can be null)
getter/setter pairinherited
sendState ↔ String?
Offline messaging: the outbox send-state for a locally-composed message (PENDING / SENDING / SENT / FAILED), or null for a plain server message. Excluded from toJson/wire; the backing for the derived status.
getter/setter pairinherited
sentAt ↔ DateTime?
Timestamp when the message was sent. Android: long sentAt (primitive, 0 = not set)
getter/setter pairinherited
source ↔ String?
Offline messaging: provenance of this delivery. 'SYNC' when the message was (re)delivered by the reconnect catch-up sweep (E3) — lets a UI suppress notification spam for a batched catch-up. Null for live/realtime delivery. Excluded from toJson/wire.
getter/setter pairinherited
status → CometChatMessageStatus
Derived lifecycle CometChatMessageStatus (foundation §5.3 — "derived, not stored"). Un-acked outbox rows report PENDING / SENDING / FAILED from sendState; otherwise the status is derived from the server receipt timestamps: READ if readAt is set, else DELIVERED if deliveredAt is set, else SENT.
no setterinherited
tags ↔ List<String>?
getter/setter pair
text ↔ String?
getter/setter pair
threadId ↔ String?
getter/setter pair
threadSubscribed ↔ bool
Whether the logged-in user is subscribed to this message's thread (thread subscription — reply-notification follow state).
getter/setter pairinherited
type ↔ String
The type of message (text, image, video, etc.). Android: String type (required in constructor)
getter/setter pairinherited
unreadRepliesCount ↔ int
Number of unread replies to this message. Android: int unreadRepliesCount (primitive, defaults to 0)
getter/setter pairinherited
updatedAt ↔ DateTime?
Timestamp when the message was last updated. Android: long updatedAt (primitive, 0 = not set)
getter/setter pairinherited

Methods

getElements() → List<AIAssistantElement>?
Returns the ordered list of content block elements from data.elements.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setElements(List<AIAssistantElement>? elements) → void
Sets the ordered list of content block elements.
toJson() → Map<String, dynamic>
Converts this AIAssistantMessage into a map (JSON serializable).
override
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override