Enumeration FinishReason

Output only. The reason why the model stopped generating tokens.

If empty, the model has not stopped generating the tokens.

Enumeration Members

BLOCKLIST: "BLOCKLIST"

Token generation stopped because the content contains forbidden terms.

FINISH_REASON_UNSPECIFIED: "FINISH_REASON_UNSPECIFIED"

The finish reason is unspecified.

IMAGE_SAFETY: "IMAGE_SAFETY"

Token generation stopped because generated images have safety violations.

LANGUAGE: "LANGUAGE"

The token generation stopped because of using an unsupported language.

MALFORMED_FUNCTION_CALL: "MALFORMED_FUNCTION_CALL"

The function call generated by the model is invalid.

MAX_TOKENS: "MAX_TOKENS"

Token generation reached the configured maximum output tokens.

OTHER: "OTHER"

All other reasons that stopped the token generation.

PROHIBITED_CONTENT: "PROHIBITED_CONTENT"

Token generation stopped for potentially containing prohibited content.

RECITATION: "RECITATION"

The token generation stopped because of potential recitation.

SAFETY: "SAFETY"

Token generation stopped because the content potentially contains safety violations. NOTE: When streaming, [content][] is empty if content filters blocks the output.

SPII: "SPII"

Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).

STOP: "STOP"

Token generation reached a natural stopping point or a configured stop sequence.

UNEXPECTED_TOOL_CALL: "UNEXPECTED_TOOL_CALL"

The tool call generated by the model is invalid.