Package io.jmix.aichat.data
Interface AiChatMessage
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
SimpleAiChatMessage
Contract for a single chat message handled by
AiChat. Aligned with
Vaadin's com.vaadin.flow.component.ai.common.ChatMessage, whose role enum
likewise has exactly two values. The role is an AiMessageRole — a Jmix
EnumClass over String — so an application entity declares the
attribute as that type while its column stays a string holding the role's id.-
Method Details
-
getRole
AiMessageRole getRole()The role of the message sender.- Returns:
- the role, never
null
-
getContent
String getContent()The text content of the message.- Returns:
- the text content of the message, never
null
-
getTime
@Nullable Instant getTime()Optional creation timestamp.- Returns:
- the timestamp, or
nullif none
-
getAttachments
The files attached to this message, as references into Jmix file storage. An application backs this with an@ElementCollection List<FileRef>, a child-entity collection, or a computed getter —AiChatonly reads the list.- Returns:
- the attachments, never
null(empty by default)
-