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 BLOCKLISTFinishReason

Token generation stopped because the content contains forbidden terms.

MALFORMED_FUNCTION_CALL

val MALFORMED_FUNCTION_CALLFinishReason

The function call generated by the model is invalid.

MAX_TOKENS

val MAX_TOKENSFinishReason

Model hit the token limit.

OTHER

val OTHERFinishReason

Model stopped for another reason.

PROHIBITED_CONTENT

val PROHIBITED_CONTENTFinishReason

Token generation stopped for potentially containing prohibited content.

RECITATION

val RECITATIONFinishReason

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

SAFETY

val SAFETYFinishReason

SafetySetting prevented the model from outputting content.

SPII

val SPIIFinishReason

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

STOP

val STOPFinishReason

Model finished successfully and stopped.

UNKNOWN

val UNKNOWNFinishReason

A new and not yet supported value.

Public properties

name

val nameString

The name of the finish reason.

ordinal

val ordinalInt

The ordinal value of the finish reason.