Enum Class FinishReason

java.lang.Object
java.lang.Enum<FinishReason>
nl.dannyj.mistral.models.completion.FinishReason
All Implemented Interfaces:
Serializable, Comparable<FinishReason>, Constable

public enum FinishReason extends Enum<FinishReason>
Represents the reason why a chat completion generation finished.
  • Enum Constant Details

    • STOP

      public static final FinishReason STOP
      The model hit a natural stop point or a provided stop sequence.
    • LENGTH

      public static final FinishReason LENGTH
      The maximum number of tokens specified in the request was reached.
    • MODEL_LENGTH

      public static final FinishReason MODEL_LENGTH
      The context length of the model was exceeded.
    • ERROR

      public static final FinishReason ERROR
      The generation stopped due to an error.
    • TOOL_CALLS

      public static final FinishReason TOOL_CALLS
      The model decided to call one or more tools.
  • Method Details

    • values

      public static FinishReason[] 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 FinishReason 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
    • getReason

      public String getReason()
      Gets the string representation of the finish reason.
      Returns:
      The finish reason as a string.