Interface AIMessage

All Superinterfaces:
Serializable

public interface AIMessage extends Serializable
Represents a message in an AI conversation.
Author:
Vaadin Ltd
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends text to the existing message content.
    Gets the message text.
    Gets the timestamp of the message.
    Gets the name of the message sender.
    void
    Sets the message text.
    void
    Sets the timestamp of the message.
  • Method Details

    • getText

      String getText()
      Gets the message text.
      Returns:
      the message text
    • setText

      void setText(String text)
      Sets the message text.
      Parameters:
      text - the message text to set
    • getTime

      Instant getTime()
      Gets the timestamp of the message.
      Returns:
      the timestamp when the message was created
    • setTime

      void setTime(Instant time)
      Sets the timestamp of the message.
      Parameters:
      time - the timestamp to set
    • getUserName

      String getUserName()
      Gets the name of the message sender.
      Returns:
      the sender name
    • appendText

      void appendText(String token)
      Appends text to the existing message content.

      This method is used for streaming AI responses where tokens are appended incrementally as they arrive.

      Parameters:
      token - the text to append