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

Image generation stopped because of other miscellaneous issue.

FinishReason

Image generation stopped because generated images have other prohibited content.

FinishReason

Image generation stopped due to recitation.

FinishReason

Token generation stopped because generated images contain safety violations.

FinishReason

The response candidate content was flagged for using an unsupported language.

FinishReason

The function call generated by the model is invalid.

FinishReason

Finished due to malformed response.

FinishReason

Model hit the token limit.

FinishReason

Request has at least one thought signature missing.

FinishReason

The model was expected to generate an image, but none was generated.

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

Model called too many tools consecutively, thus the system exited execution.

FinishReason

Model generated a tool call but no tools were enabled in the request.

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.

IMAGE_OTHER

val IMAGE_OTHERFinishReason

Image generation stopped because of other miscellaneous issue.

IMAGE_PROHIBITED_CONTENT

val IMAGE_PROHIBITED_CONTENTFinishReason

Image generation stopped because generated images have other prohibited content.

IMAGE_RECITATION

val IMAGE_RECITATIONFinishReason

Image generation stopped due to recitation.

IMAGE_SAFETY

val IMAGE_SAFETYFinishReason

Token generation stopped because generated images contain safety violations.

LANGUAGE

val LANGUAGEFinishReason

The response candidate content was flagged for using an unsupported language.

MALFORMED_FUNCTION_CALL

val MALFORMED_FUNCTION_CALLFinishReason

The function call generated by the model is invalid.

MALFORMED_RESPONSE

val MALFORMED_RESPONSEFinishReason

Finished due to malformed response.

MAX_TOKENS

val MAX_TOKENSFinishReason

Model hit the token limit.

MISSING_THOUGHT_SIGNATURE

val MISSING_THOUGHT_SIGNATUREFinishReason

Request has at least one thought signature missing.

NO_IMAGE

val NO_IMAGEFinishReason

The model was expected to generate an image, but none was generated.

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.

TOO_MANY_TOOL_CALLS

val TOO_MANY_TOOL_CALLSFinishReason

Model called too many tools consecutively, thus the system exited execution.

UNEXPECTED_TOOL_CALL

val UNEXPECTED_TOOL_CALLFinishReason

Model generated a tool call but no tools were enabled in the request.

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.