Enum Class MessageRole

java.lang.Object
java.lang.Enum<MessageRole>
io.jmix.aichat.data.MessageRole
All Implemented Interfaces:
Serializable, Comparable<MessageRole>, Constable

public enum MessageRole extends Enum<MessageRole>
The role of a message in an AiMessageList: how the message list renders it. Assistant messages are rendered as Markdown with embedded code blocks, user messages as plain text, and the value is the client's routing discriminator.

Not the same type as AiMessageRole, which is the role on the AiChatMessage data contract and an application entity's attribute type; AiChat projects that role onto this one.

  • Enum Constant Details

    • USER

      public static final MessageRole USER
      A message authored by the end user.
    • ASSISTANT

      public static final MessageRole ASSISTANT
      A message authored by the assistant (the model).
  • Method Details

    • values

      public static MessageRole[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MessageRole valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null