FinishReason

class FinishReason


Represents the reason why the model stopped generating content.

Summary

Public companion properties

FinishReason

Token generation stopped because the content contains forbidden terms.

FinishReason

The function call generated by the model is invalid.

FinishReason

Model hit the token limit.

FinishReason

Model stopped for another reason.

FinishReason

Token generation stopped for potentially containing prohibited content.

FinishReason

The token generation was stopped because the response was flagged for unauthorized citations.

FinishReason

SafetySetting prevented the model from outputting content.

FinishReason

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

FinishReason

Model finished successfully and stopped.

FinishReason

A new and not yet supported value.

Public properties

String

The name of the finish reason.

Int

The ordinal value of the finish reason.

Public companion properties

BLOCKLIST

val BLOCKLIST: FinishReason

Token generation stopped because the content contains forbidden terms.

MALFORMED_FUNCTION_CALL

val MALFORMED_FUNCTION_CALL: FinishReason

The function call generated by the model is invalid.

MAX_TOKENS

val MAX_TOKENS: FinishReason

Model hit the token limit.

OTHER

val OTHER: FinishReason

Model stopped for another reason.

PROHIBITED_CONTENT

val PROHIBITED_CONTENT: FinishReason

Token generation stopped for potentially containing prohibited content.

RECITATION

val RECITATION: FinishReason

The token generation was stopped because the response was flagged for unauthorized citations.

SAFETY

val SAFETY: FinishReason

SafetySetting prevented the model from outputting content.

SPII

val SPII: FinishReason

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

STOP

val STOP: FinishReason

Model finished successfully and stopped.

UNKNOWN

val UNKNOWN: FinishReason

A new and not yet supported value.

Public properties

name

val name: String

The name of the finish reason.

ordinal

val ordinal: Int

The ordinal value of the finish reason.