Enum Class FinishReason
- All Implemented Interfaces:
Serializable, Comparable<FinishReason>, Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe content was blocked by a specific blocklist.The finish reason was not provided by the model or is unspecified.Anahata-specific catch-all for reasons not recognized in this version.The generated image was blocked for other reasons.The generated image contains prohibited content.The generated image contains copyrighted material.The generated image failed safety checks.The content was flagged due to language constraints.The model produced a malformed function call.The maximum number of tokens as specified in the request was reached.No image was generated.The reason is unknown or not specified by the provider.The content contains prohibited material.The content was flagged for recitation reasons (e.g., copyrighted material).The content was flagged for safety reasons.The content contains Sensitive Personally Identifiable Information (SPII).Natural stop point of the model or provided stop sequence.The model made an unexpected tool call. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FinishReasonReturns the enum constant of this class with the specified name.static FinishReason[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FINISH_REASON_UNSPECIFIED
The finish reason was not provided by the model or is unspecified. -
STOP
Natural stop point of the model or provided stop sequence. -
MAX_TOKENS
The maximum number of tokens as specified in the request was reached. -
SAFETY
The content was flagged for safety reasons. -
RECITATION
The content was flagged for recitation reasons (e.g., copyrighted material). -
LANGUAGE
The content was flagged due to language constraints. -
OTHER
The reason is unknown or not specified by the provider. -
BLOCKLIST
The content was blocked by a specific blocklist. -
PROHIBITED_CONTENT
The content contains prohibited material. -
SPII
The content contains Sensitive Personally Identifiable Information (SPII). -
MALFORMED_FUNCTION_CALL
The model produced a malformed function call. -
IMAGE_SAFETY
The generated image failed safety checks. -
UNEXPECTED_TOOL_CALL
The model made an unexpected tool call. -
IMAGE_PROHIBITED_CONTENT
The generated image contains prohibited content. -
NO_IMAGE
No image was generated. -
IMAGE_RECITATION
The generated image contains copyrighted material. -
IMAGE_OTHER
The generated image was blocked for other reasons. -
GOD_FUCKING_KNOWS
Anahata-specific catch-all for reasons not recognized in this version.
-
-
Constructor Details
-
FinishReason
private FinishReason()
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-

