public static enum Candidate.FinishReason extends Enum<Candidate.FinishReason> implements com.google.protobuf.ProtocolMessageEnum
The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.Protobuf enum
google.cloud.aiplatform.v1beta1.Candidate.FinishReason| Enum Constant and Description |
|---|
BLOCKLIST
Token generation stopped because the content contains forbidden terms.
|
FINISH_REASON_UNSPECIFIED
The finish reason is unspecified.
|
MALFORMED_FUNCTION_CALL
The function call generated by the model is invalid.
|
MAX_TOKENS
Token generation reached the configured maximum output tokens.
|
OTHER
All other reasons that stopped the token generation.
|
PROHIBITED_CONTENT
Token generation stopped for potentially containing prohibited content.
|
RECITATION
Token generation stopped because the content potentially contains
copyright violations.
|
SAFETY
Token generation stopped because the content potentially contains safety
violations.
|
SPII
Token generation stopped because the content potentially contains
Sensitive Personally Identifiable Information (SPII).
|
STOP
Token generation reached a natural stopping point or a configured stop
sequence.
|
UNRECOGNIZED |
| Modifier and Type | Field and Description |
|---|---|
static int |
BLOCKLIST_VALUE
Token generation stopped because the content contains forbidden terms.
|
static int |
FINISH_REASON_UNSPECIFIED_VALUE
The finish reason is unspecified.
|
static int |
MALFORMED_FUNCTION_CALL_VALUE
The function call generated by the model is invalid.
|
static int |
MAX_TOKENS_VALUE
Token generation reached the configured maximum output tokens.
|
static int |
OTHER_VALUE
All other reasons that stopped the token generation.
|
static int |
PROHIBITED_CONTENT_VALUE
Token generation stopped for potentially containing prohibited content.
|
static int |
RECITATION_VALUE
Token generation stopped because the content potentially contains
copyright violations.
|
static int |
SAFETY_VALUE
Token generation stopped because the content potentially contains safety
violations.
|
static int |
SPII_VALUE
Token generation stopped because the content potentially contains
Sensitive Personally Identifiable Information (SPII).
|
static int |
STOP_VALUE
Token generation reached a natural stopping point or a configured stop
sequence.
|
| Modifier and Type | Method and Description |
|---|---|
static Candidate.FinishReason |
forNumber(int value) |
static com.google.protobuf.Descriptors.EnumDescriptor |
getDescriptor() |
com.google.protobuf.Descriptors.EnumDescriptor |
getDescriptorForType() |
int |
getNumber() |
com.google.protobuf.Descriptors.EnumValueDescriptor |
getValueDescriptor() |
static com.google.protobuf.Internal.EnumLiteMap<Candidate.FinishReason> |
internalGetValueMap() |
static Candidate.FinishReason |
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) |
static Candidate.FinishReason |
valueOf(int value)
Deprecated.
Use
forNumber(int) instead. |
static Candidate.FinishReason |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Candidate.FinishReason[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Candidate.FinishReason FINISH_REASON_UNSPECIFIED
The finish reason is unspecified.
FINISH_REASON_UNSPECIFIED = 0;public static final Candidate.FinishReason STOP
Token generation reached a natural stopping point or a configured stop sequence.
STOP = 1;public static final Candidate.FinishReason MAX_TOKENS
Token generation reached the configured maximum output tokens.
MAX_TOKENS = 2;public static final Candidate.FinishReason SAFETY
Token generation stopped because the content potentially contains safety violations. NOTE: When streaming, [content][google.cloud.aiplatform.v1beta1.Candidate.content] is empty if content filters blocks the output.
SAFETY = 3;public static final Candidate.FinishReason RECITATION
Token generation stopped because the content potentially contains copyright violations.
RECITATION = 4;public static final Candidate.FinishReason OTHER
All other reasons that stopped the token generation.
OTHER = 5;public static final Candidate.FinishReason BLOCKLIST
Token generation stopped because the content contains forbidden terms.
BLOCKLIST = 6;public static final Candidate.FinishReason PROHIBITED_CONTENT
Token generation stopped for potentially containing prohibited content.
PROHIBITED_CONTENT = 7;public static final Candidate.FinishReason SPII
Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).
SPII = 8;public static final Candidate.FinishReason MALFORMED_FUNCTION_CALL
The function call generated by the model is invalid.
MALFORMED_FUNCTION_CALL = 9;public static final Candidate.FinishReason UNRECOGNIZED
public static final int FINISH_REASON_UNSPECIFIED_VALUE
The finish reason is unspecified.
FINISH_REASON_UNSPECIFIED = 0;public static final int STOP_VALUE
Token generation reached a natural stopping point or a configured stop sequence.
STOP = 1;public static final int MAX_TOKENS_VALUE
Token generation reached the configured maximum output tokens.
MAX_TOKENS = 2;public static final int SAFETY_VALUE
Token generation stopped because the content potentially contains safety violations. NOTE: When streaming, [content][google.cloud.aiplatform.v1beta1.Candidate.content] is empty if content filters blocks the output.
SAFETY = 3;public static final int RECITATION_VALUE
Token generation stopped because the content potentially contains copyright violations.
RECITATION = 4;public static final int OTHER_VALUE
All other reasons that stopped the token generation.
OTHER = 5;public static final int BLOCKLIST_VALUE
Token generation stopped because the content contains forbidden terms.
BLOCKLIST = 6;public static final int PROHIBITED_CONTENT_VALUE
Token generation stopped for potentially containing prohibited content.
PROHIBITED_CONTENT = 7;public static final int SPII_VALUE
Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).
SPII = 8;public static final int MALFORMED_FUNCTION_CALL_VALUE
The function call generated by the model is invalid.
MALFORMED_FUNCTION_CALL = 9;public static Candidate.FinishReason[] values()
for (Candidate.FinishReason c : Candidate.FinishReason.values()) System.out.println(c);
public static Candidate.FinishReason valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic final int getNumber()
getNumber in interface com.google.protobuf.Internal.EnumLitegetNumber in interface com.google.protobuf.ProtocolMessageEnum@Deprecated public static Candidate.FinishReason valueOf(int value)
forNumber(int) instead.value - The numeric wire value of the corresponding enum entry.public static Candidate.FinishReason forNumber(int value)
value - The numeric wire value of the corresponding enum entry.public static com.google.protobuf.Internal.EnumLiteMap<Candidate.FinishReason> internalGetValueMap()
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
getValueDescriptor in interface com.google.protobuf.ProtocolMessageEnumpublic final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.ProtocolMessageEnumpublic static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
public static Candidate.FinishReason valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
Copyright © 2025 Google LLC. All rights reserved.