Interface AiChatMessage

All Superinterfaces:
Serializable
All Known Implementing Classes:
SimpleAiChatMessage

public interface AiChatMessage extends Serializable
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 Summary

    Modifier and Type
    Method
    Description
    default List<FileRef>
    The files attached to this message, as references into Jmix file storage.
    The text content of the message.
    The role of the message sender.
    @Nullable Instant
    Optional creation timestamp.
  • 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 null if none
    • getAttachments

      default List<FileRef> 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 — AiChat only reads the list.
      Returns:
      the attachments, never null (empty by default)