pub enum FinishReason {
FinishReasonUnspecified,
Stop,
MaxTokens,
Safety,
Recitation,
Language,
Other,
Blocklist,
ProhibitedContent,
Spii,
MalformedFunctionCall,
ImageSafety,
}
Expand description
Defines the reason why the model stopped generating tokens
Variants§
FinishReasonUnspecified
Default value. This value is unused.
Stop
Natural stop point of the model or provided stop sequence
MaxTokens
The maximum number of tokens as specified in the request was reached
Safety
The response candidate content was flagged for safety reasons
Recitation
The response candidate content was flagged for recitation reasons
Language
The response candidate content was flagged for using an unsupported language
Other
Unknown reason
Blocklist
Token generation stopped because the content contains forbidden terms
ProhibitedContent
Token generation stopped for potentially containing prohibited content
Spii
Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII)
MalformedFunctionCall
The function call generated by the model is invalid
ImageSafety
Token generation stopped because generated images contain safety violations