Class FinishReason (1.54.1)

FinishReason(value)

The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.

Enums

NameDescription
FINISH_REASON_UNSPECIFIEDThe finish reason is unspecified.
STOPNatural stop point of the model or provided stop sequence.
MAX_TOKENSThe maximum number of tokens as specified in the request was reached.
SAFETYThe token generation was stopped as the response was flagged for safety reasons. NOTE: When the Candidate.content will be empty if content filters blocked the output.
RECITATIONThe token generation was stopped as the response was flagged for unauthorized citations.
OTHERAll other reasons that stopped the token generation
BLOCKLISTThe token generation was stopped as the response was flagged for the terms which are included from the terminology blocklist.
PROHIBITED_CONTENTThe token generation was stopped as the response was flagged for the prohibited contents.
SPIIThe token generation was stopped as the response was flagged for Sensitive Personally Identifiable Information (SPII) contents.