Enum Class TaskType

java.lang.Object
java.lang.Enum<TaskType>
org.elasticsearch.inference.TaskType
All Implemented Interfaces:
Serializable, Comparable<TaskType>, Constable, Writeable

public enum TaskType extends Enum<TaskType> implements Writeable
  • Enum Constant Details

    • TEXT_EMBEDDING

      public static final TaskType TEXT_EMBEDDING
    • SPARSE_EMBEDDING

      public static final TaskType SPARSE_EMBEDDING
    • RERANK

      public static final TaskType RERANK
    • COMPLETION

      public static final TaskType COMPLETION
    • ANY

      public static final TaskType ANY
    • CHAT_COMPLETION

      public static final TaskType CHAT_COMPLETION
  • Field Details

  • Method Details

    • values

      public static TaskType[] 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 TaskType 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
    • fromString

      public static TaskType fromString(String name)
    • fromStringOrStatusException

      public static TaskType fromStringOrStatusException(String name)
    • isAnyOrSame

      public boolean isAnyOrSame(TaskType other)
      Return true if the other is the ANY type or the same as this.
      Parameters:
      other - The other
      Returns:
      True if same or any.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<TaskType>
    • fromStream

      public static TaskType fromStream(StreamInput in) throws IOException
      Throws:
      IOException
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • unsupportedTaskTypeErrorMsg

      public static String unsupportedTaskTypeErrorMsg(TaskType taskType, String serviceName)
    • copyOf

      public static EnumSet<TaskType> copyOf(EnumSet<TaskType> taskTypes)
      Copies a EnumSet<TaskType> if non-empty, otherwise returns an empty EnumSet<TaskType>. This is essentially the same as EnumSet.copyOf(EnumSet), except it does not throw for an empty set.
      Parameters:
      taskTypes - task types to copy
      Returns:
      a copy of the passed in EnumSet<TaskType>