2.0.0 (latest) 1.159.0 1.158.0 1.157.0 1.156.0 1.155.0 1.154.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. |
| `MODEL_ARMOR` | The model response was blocked by Model Armor. |