Enum Class FinishReason

java.lang.Object
java.lang.Enum<FinishReason>
uno.anahata.asi.agi.provider.FinishReason
All Implemented Interfaces:
Serializable, Comparable<FinishReason>, Constable

public enum FinishReason extends Enum<FinishReason>
A standardized, model-agnostic enum representing the reason why a model stopped generating content. This enum provides a 1:1 mapping for all known Gemini finish reasons, plus a specialized catch-all for unrecognized or missing reasons.
Author:
anahata-gemini-pro-2.5
  • Enum Constant Details

    • FINISH_REASON_UNSPECIFIED

      public static final FinishReason FINISH_REASON_UNSPECIFIED
      The finish reason was not provided by the model or is unspecified.
    • STOP

      public static final FinishReason STOP
      Natural stop point of the model or provided stop sequence.
    • MAX_TOKENS

      public static final FinishReason MAX_TOKENS
      The maximum number of tokens as specified in the request was reached.
    • SAFETY

      public static final FinishReason SAFETY
      The content was flagged for safety reasons.
    • RECITATION

      public static final FinishReason RECITATION
      The content was flagged for recitation reasons (e.g., copyrighted material).
    • LANGUAGE

      public static final FinishReason LANGUAGE
      The content was flagged due to language constraints.
    • OTHER

      public static final FinishReason OTHER
      The reason is unknown or not specified by the provider.
    • BLOCKLIST

      public static final FinishReason BLOCKLIST
      The content was blocked by a specific blocklist.
    • PROHIBITED_CONTENT

      public static final FinishReason PROHIBITED_CONTENT
      The content contains prohibited material.
    • SPII

      public static final FinishReason SPII
      The content contains Sensitive Personally Identifiable Information (SPII).
    • MALFORMED_FUNCTION_CALL

      public static final FinishReason MALFORMED_FUNCTION_CALL
      The model produced a malformed function call.
    • IMAGE_SAFETY

      public static final FinishReason IMAGE_SAFETY
      The generated image failed safety checks.
    • UNEXPECTED_TOOL_CALL

      public static final FinishReason UNEXPECTED_TOOL_CALL
      The model made an unexpected tool call.
    • IMAGE_PROHIBITED_CONTENT

      public static final FinishReason IMAGE_PROHIBITED_CONTENT
      The generated image contains prohibited content.
    • NO_IMAGE

      public static final FinishReason NO_IMAGE
      No image was generated.
    • IMAGE_RECITATION

      public static final FinishReason IMAGE_RECITATION
      The generated image contains copyrighted material.
    • IMAGE_OTHER

      public static final FinishReason IMAGE_OTHER
      The generated image was blocked for other reasons.
    • GOD_FUCKING_KNOWS

      public static final FinishReason GOD_FUCKING_KNOWS
      Anahata-specific catch-all for reasons not recognized in this version.
  • Constructor Details

    • FinishReason

      private FinishReason()
  • 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