Enum FinishReason.Known

java.lang.Object
java.lang.Enum<FinishReason.Known>
com.google.genai.types.FinishReason.Known
All Implemented Interfaces:
Serializable, Comparable<FinishReason.Known>
Enclosing class:
FinishReason

public static enum FinishReason.Known extends Enum<FinishReason.Known>
Enum representing the known values for FinishReason.
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Token generation stopped because the content contains forbidden terms.
    The finish reason is unspecified.
    Token generation stopped because generated images have safety violations.
    The token generation stopped because of using an unsupported language.
    The function call generated by the model is invalid.
    Token generation reached the configured maximum output tokens.
    All other reasons that stopped the token generation.
    Token generation stopped for potentially containing prohibited content.
    The token generation stopped because of potential recitation.
    Token generation stopped because the content potentially contains safety violations.
    Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).
    Token generation reached a natural stopping point or a configured stop sequence.
    The tool call generated by the model is invalid.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • FINISH_REASON_UNSPECIFIED

      public static final FinishReason.Known FINISH_REASON_UNSPECIFIED
      The finish reason is unspecified.
    • STOP

      public static final FinishReason.Known STOP
      Token generation reached a natural stopping point or a configured stop sequence.
    • MAX_TOKENS

      public static final FinishReason.Known MAX_TOKENS
      Token generation reached the configured maximum output tokens.
    • SAFETY

      public static final FinishReason.Known SAFETY
      Token generation stopped because the content potentially contains safety violations. NOTE: When streaming, [content][] is empty if content filters blocks the output.
    • RECITATION

      public static final FinishReason.Known RECITATION
      The token generation stopped because of potential recitation.
    • LANGUAGE

      public static final FinishReason.Known LANGUAGE
      The token generation stopped because of using an unsupported language.
    • OTHER

      public static final FinishReason.Known OTHER
      All other reasons that stopped the token generation.
    • BLOCKLIST

      public static final FinishReason.Known BLOCKLIST
      Token generation stopped because the content contains forbidden terms.
    • PROHIBITED_CONTENT

      public static final FinishReason.Known PROHIBITED_CONTENT
      Token generation stopped for potentially containing prohibited content.
    • SPII

      public static final FinishReason.Known SPII
      Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).
    • MALFORMED_FUNCTION_CALL

      public static final FinishReason.Known MALFORMED_FUNCTION_CALL
      The function call generated by the model is invalid.
    • IMAGE_SAFETY

      public static final FinishReason.Known IMAGE_SAFETY
      Token generation stopped because generated images have safety violations.
    • UNEXPECTED_TOOL_CALL

      public static final FinishReason.Known UNEXPECTED_TOOL_CALL
      The tool call generated by the model is invalid.
  • Method Details

    • values

      public static FinishReason.Known[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static FinishReason.Known valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null