# FinishReason

enum FinishReason : Enum<FinishReason>

The reason why the generation finished.

## Entries

FINISH_REASON_UNSPECIFIED
Link copied to clipboard
FINISH_REASON_UNSPECIFIED

The finish reason is unspecified.

STOP
Link copied to clipboard
STOP

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

MAX_TOKENS
Link copied to clipboard
MAX_TOKENS

Token generation reached the configured maximum output tokens.

SAFETY
Link copied to clipboard
SAFETY

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

RECITATION
Link copied to clipboard
RECITATION

The token generation stopped because of potential recitation.

OTHER
Link copied to clipboard
OTHER

All other reasons that stopped the token generation.

BLOCKLIST
Link copied to clipboard
BLOCKLIST

Token generation stopped because the content contains forbidden terms.

PROHIBITED_CONTENT
Link copied to clipboard
PROHIBITED_CONTENT

Token generation stopped for potentially containing prohibited content.

SPII
Link copied to clipboard
SPII

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

MALFORMED_FUNCTION_CALL
Link copied to clipboard
MALFORMED_FUNCTION_CALL

The function call generated by the model is invalid.

UNEXPECTED_TOOL_CALL
Link copied to clipboard
UNEXPECTED_TOOL_CALL

A tool returned an unexpected result, or a tool threw an exception.

## Properties

entries
Link copied to clipboard
val entries: EnumEntries<FinishReason>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

name
Link copied to clipboard
val name: String
ordinal
Link copied to clipboard
val ordinal: Int

## Functions

valueOf
Link copied to clipboard
fun valueOf(value: String): FinishReason

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

values
Link copied to clipboard
fun values(): Array<FinishReason>

Returns an array containing the constants of this enum type, in the order they're declared.