FinishReason

public enum FinishReason extends 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 methods

final @NonNull FinishReason

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

final @NonNull FinishReason[]

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

Enum Values

MAX_TOKENS

FinishReason FinishReason.MAX_TOKENS

Model hit the token limit.

OTHER

FinishReason FinishReason.OTHER

Model stopped for another reason.

RECITATION

FinishReason FinishReason.RECITATION

Model began looping.

SAFETY

FinishReason FinishReason.SAFETY

SafetySetting prevented the model from outputting content.

STOP

FinishReason FinishReason.STOP

Model finished successfully and stopped.

UNKNOWN

FinishReason FinishReason.UNKNOWN

A new and not yet supported value.

UNSPECIFIED

FinishReason FinishReason.UNSPECIFIED

Reason is unspecified.

Public methods

valueOf

public final @NonNull FinishReason valueOf(@NonNull String value)

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

public final @NonNull FinishReason[] values()

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.