MessageEvent

constructor(conversationId: String, status: MessageStatus, fromUserId: String? = null, toUserId: String? = null, title: String? = null, message: Message? = null, content: String? = null, role: MessageRole? = null, error: Throwable? = null, timestamp: Instant = Instant.now())

Parameters

conversationId

the conversation the message belongs to

status

the current status of the message

fromUserId

the ID of the user who sent this message (author)

toUserId

the ID of the user who should receive this message (for routing, e.g., WebSocket)

title

the session/conversation title (for UI display)

message

the message (always present for ADDED, present for PERSISTED)

content

the message content (useful for PERSISTENCE_FAILED when message ref may be stale)

role

the message role

error

the exception if persistence failed (present for PERSISTENCE_FAILED)

timestamp

when the event occurred