Struct BlockedReason
Output only. The reason why the prompt was blocked.
[JsonConverter(typeof(BlockedReasonConverter))]
public readonly record struct BlockedReason : IEquatable<BlockedReason>
- Implements
- Inherited Members
Properties
AllValues
public static IReadOnlyList<BlockedReason> AllValues { get; }
Property Value
BlockedReasonUnspecified
The blocked reason is unspecified.
public static BlockedReason BlockedReasonUnspecified { get; }
Property Value
Blocklist
The prompt was blocked because it contains a term from the terminology blocklist.
public static BlockedReason Blocklist { get; }
Property Value
ImageSafety
The prompt was blocked because it contains content that is unsafe for image generation.
public static BlockedReason ImageSafety { get; }
Property Value
Jailbreak
The prompt was blocked as a jailbreak attempt. This enum value is not supported in Gemini API.
public static BlockedReason Jailbreak { get; }
Property Value
ModelArmor
The prompt was blocked by Model Armor. This enum value is not supported in Gemini API.
public static BlockedReason ModelArmor { get; }
Property Value
Other
The prompt was blocked for other reasons. For example, it may be due to the prompt's language, or because it contains other harmful content.
public static BlockedReason Other { get; }
Property Value
ProhibitedContent
The prompt was blocked because it contains prohibited content.
public static BlockedReason ProhibitedContent { get; }
Property Value
Safety
The prompt was blocked for safety reasons.
public static BlockedReason Safety { get; }
Property Value
Value
public string Value { get; }
Property Value
Methods
Equals(BlockedReason)
public bool Equals(BlockedReason other)
Parameters
otherBlockedReason
Returns
FromString(string)
public static BlockedReason FromString(string value)
Parameters
valuestring
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
implicit operator BlockedReason(string)
public static implicit operator BlockedReason(string value)
Parameters
valuestring