Struct FinishReason
Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.
[JsonConverter(typeof(FinishReasonConverter))]
public readonly record struct FinishReason : IEquatable<FinishReason>
- Implements
- Inherited Members
Properties
AllValues
public static IReadOnlyList<FinishReason> AllValues { get; }
Property Value
Blocklist
Token generation stopped because the content contains forbidden terms.
public static FinishReason Blocklist { get; }
Property Value
FinishReasonUnspecified
The finish reason is unspecified.
public static FinishReason FinishReasonUnspecified { get; }
Property Value
ImageOther
Image generation stopped for a reason not otherwise specified.
public static FinishReason ImageOther { get; }
Property Value
ImageProhibitedContent
Image generation stopped because the generated images have prohibited content.
public static FinishReason ImageProhibitedContent { get; }
Property Value
ImageRecitation
Image generation stopped because the generated image may be a recitation from a source.
public static FinishReason ImageRecitation { get; }
Property Value
ImageSafety
Token generation stopped because generated images have safety violations.
public static FinishReason ImageSafety { get; }
Property Value
Language
The token generation stopped because of using an unsupported language.
public static FinishReason Language { get; }
Property Value
MalformedFunctionCall
The function call generated by the model is invalid.
public static FinishReason MalformedFunctionCall { get; }
Property Value
MaxTokens
Token generation reached the configured maximum output tokens.
public static FinishReason MaxTokens { get; }
Property Value
NoImage
The model was expected to generate an image, but none was generated.
public static FinishReason NoImage { get; }
Property Value
Other
All other reasons that stopped the token generation.
public static FinishReason Other { get; }
Property Value
ProhibitedContent
Token generation stopped for potentially containing prohibited content.
public static FinishReason ProhibitedContent { get; }
Property Value
Recitation
The token generation stopped because of potential recitation.
public static FinishReason Recitation { get; }
Property Value
Safety
Token generation stopped because the content potentially contains safety violations. NOTE: When streaming, [content][] is empty if content filters blocks the output.
public static FinishReason Safety { get; }
Property Value
Spii
Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).
public static FinishReason Spii { get; }
Property Value
Stop
Token generation reached a natural stopping point or a configured stop sequence.
public static FinishReason Stop { get; }
Property Value
UnexpectedToolCall
The tool call generated by the model is invalid.
public static FinishReason UnexpectedToolCall { get; }
Property Value
Value
public string Value { get; }
Property Value
Methods
Equals(FinishReason)
public bool Equals(FinishReason other)
Parameters
otherFinishReason
Returns
FromString(string)
public static FinishReason FromString(string value)
Parameters
valuestring
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
implicit operator FinishReason(string)
public static implicit operator FinishReason(string value)
Parameters
valuestring