FinishReason

enum FinishReason : Enum


The reason for content finishing.

Summary

Enum Values

MAX_TOKENS

Model hit the token limit.

OTHER

Model stopped for another reason.

RECITATION

Model began looping.

SAFETY

SafetySetting prevented the model from outputting content.

STOP

Model finished successfully and stopped.

UNKNOWN

A new and not yet supported value.

UNSPECIFIED

Reason is unspecified.

Public functions

FinishReason
valueOf(value: String)

Returns the enum constant of this type with the specified name.

Array<FinishReason>

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

Enum Values

MAX_TOKENS

val FinishReason.MAX_TOKENSFinishReason

Model hit the token limit.

OTHER

val FinishReason.OTHERFinishReason

Model stopped for another reason.

RECITATION

val FinishReason.RECITATIONFinishReason

Model began looping.

SAFETY

val FinishReason.SAFETYFinishReason

SafetySetting prevented the model from outputting content.

STOP

val FinishReason.STOPFinishReason

Model finished successfully and stopped.

UNKNOWN

val FinishReason.UNKNOWNFinishReason

A new and not yet supported value.

UNSPECIFIED

val FinishReason.UNSPECIFIEDFinishReason

Reason is unspecified.

Public functions

valueOf

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.)

Throws
kotlin.IllegalArgumentException: kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

fun values(): Array<FinishReason>

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

This method may be used to iterate over the constants.