Enum Class FinishReason

java.lang.Object
java.lang.Enum<FinishReason>
dev.langchain4j.model.output.FinishReason
All Implemented Interfaces:
Serializable, Comparable<FinishReason>, Constable

public enum FinishReason extends Enum<FinishReason>
The reason why a model call finished.
  • Enum Constant Details

    • STOP

      public static final FinishReason STOP
      The model call finished because the model decided the request was done.
    • LENGTH

      public static final FinishReason LENGTH
      The call finished because the token length was reached.
    • TOOL_EXECUTION

      public static final FinishReason TOOL_EXECUTION
      The call finished signalling a need for tool execution.
    • CONTENT_FILTER

      public static final FinishReason CONTENT_FILTER
      The call finished signalling a need for content filtering.
    • OTHER

      public static final FinishReason OTHER
      The call finished for some other reason.
  • 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