Enum Class OllamaMessageRole

java.lang.Object
java.lang.Enum<OllamaMessageRole>
me.zacharias.chat.ollama.OllamaMessageRole
All Implemented Interfaces:
Serializable, Comparable<OllamaMessageRole>, Constable

public enum OllamaMessageRole extends Enum<OllamaMessageRole>
Represents the role of a message. This is used by Ollama to determine the role of a message.
  • Enum Constant Details

  • Method Details

    • values

      public static OllamaMessageRole[] 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 OllamaMessageRole 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
    • getRole

      public String getRole()
      Gets the role of the message.
      Returns:
      The role of the message
    • fromRole

      public static OllamaMessageRole fromRole(String role)
      Gets the role of the message from a string.
      Parameters:
      role - The role of the message as a string
      Returns:
      The role of the message