Class FinishReason (1.63.0)

FinishReason(value)

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

Enums

Name Description
FINISH_REASON_UNSPECIFIED The finish reason is unspecified.
STOP Token generation reached a natural stopping point or a configured stop sequence.
MAX_TOKENS Token generation reached the configured maximum output tokens.
SAFETY Token generation stopped because the content potentially contains safety violations. NOTE: When streaming, content is empty if content filters blocks the output.
RECITATION Token generation stopped because the content potentially contains copyright violations.
OTHER All other reasons that stopped the token generation.
BLOCKLIST Token generation stopped because the content contains forbidden terms.
PROHIBITED_CONTENT Token generation stopped for potentially containing prohibited content.
SPII Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).
MALFORMED_FUNCTION_CALL The function call generated by the model is invalid.