Package com.google.genai.types
Enum FinishReason.Known
- All Implemented Interfaces:
Serializable,Comparable<FinishReason.Known>
- Enclosing class:
- FinishReason
Enum representing the known values for FinishReason.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe model stopped generating because the content contains a term from a configured blocklist.Token generation was stopped because the response reached the per-request token limit, but generation is not yet complete.Request was filtered by an escalation rule.The finish reason is unspecified.The image generation stopped for a reason not otherwise specified.The generated image may contain prohibited content.The generated image may be a recitation from a source.The generated image potentially violates safety policies.The response candidate content was flagged for using an unsupported language.The model generated a function call that is syntactically invalid and can't be parsed.Finishes due to malformed response.The model generated the maximum number of tokens allowed by the `max_output_tokens` parameter.Request has at least one thought signature missing.The model response was blocked by Model Armor.The model was expected to generate an image, but didn't.The model stopped generating for a reason not otherwise specified.The model stopped generating because the content may be prohibited.Indicates that token generation stopped because the user account is limited or disabled due to Prohibited Use Policy (PUP) violations.The model stopped generating because the content may be a recitation from a source.The model stopped generating because the content potentially violates safety policies.The model stopped generating because the content may contain sensitive personally identifiable information (SPII).The model reached a natural stopping point or a configured stop sequence.The model made too many tool calls in a single request, so the server-side tool loop stopped before the model returned a final answer.The model generated a function call that is semantically invalid. -
Method Summary
Modifier and TypeMethodDescriptionstatic FinishReason.KnownReturns the enum constant of this type with the specified name.static FinishReason.Known[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
FINISH_REASON_UNSPECIFIED
The finish reason is unspecified. -
STOP
The model reached a natural stopping point or a configured stop sequence. -
MAX_TOKENS
The model generated the maximum number of tokens allowed by the `max_output_tokens` parameter. -
SAFETY
The model stopped generating because the content potentially violates safety policies. NOTE: When streaming, the `content` field is empty if content filters block the output. -
RECITATION
The model stopped generating because the content may be a recitation from a source. -
LANGUAGE
The response candidate content was flagged for using an unsupported language. This enum value is not supported in Vertex AI. -
OTHER
The model stopped generating for a reason not otherwise specified. -
BLOCKLIST
The model stopped generating because the content contains a term from a configured blocklist. -
PROHIBITED_CONTENT
The model stopped generating because the content may be prohibited. -
SPII
The model stopped generating because the content may contain sensitive personally identifiable information (SPII). -
MALFORMED_FUNCTION_CALL
The model generated a function call that is syntactically invalid and can't be parsed. -
IMAGE_SAFETY
The generated image potentially violates safety policies. -
IMAGE_PROHIBITED_CONTENT
The generated image may contain prohibited content. -
IMAGE_OTHER
The image generation stopped for a reason not otherwise specified. -
NO_IMAGE
The model was expected to generate an image, but didn't. -
IMAGE_RECITATION
The generated image may be a recitation from a source. -
UNEXPECTED_TOOL_CALL
The model generated a function call that is semantically invalid. This can happen, for example, if function calling is not enabled or the generated function is not in the function declaration. -
TOO_MANY_TOOL_CALLS
The model made too many tool calls in a single request, so the server-side tool loop stopped before the model returned a final answer. -
MISSING_THOUGHT_SIGNATURE
Request has at least one thought signature missing. This enum value is not supported in Vertex AI. -
MALFORMED_RESPONSE
Finishes due to malformed response. -
ESCALATION
Request was filtered by an escalation rule. This enum value is not supported in Vertex AI. -
PUP_LIMITED_DISABLED
Indicates that token generation stopped because the user account is limited or disabled due to Prohibited Use Policy (PUP) violations. This enum value is not supported in Vertex AI. -
CONTINUATION
Token generation was stopped because the response reached the per-request token limit, but generation is not yet complete. The model response can be continued via a subsequent request using the returned `continuation_token`. -
MODEL_ARMOR
The model response was blocked by Model Armor. This enum value is not supported in Gemini API.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-