Table of Contents

Struct BlockedReason

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

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

IReadOnlyList<BlockedReason>

BlockedReasonUnspecified

The blocked reason is unspecified.

public static BlockedReason BlockedReasonUnspecified { get; }

Property Value

BlockedReason

Blocklist

The prompt was blocked because it contains a term from the terminology blocklist.

public static BlockedReason Blocklist { get; }

Property Value

BlockedReason

ImageSafety

The prompt was blocked because it contains content that is unsafe for image generation.

public static BlockedReason ImageSafety { get; }

Property Value

BlockedReason

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

BlockedReason

ModelArmor

The prompt was blocked by Model Armor. This enum value is not supported in Gemini API.

public static BlockedReason ModelArmor { get; }

Property Value

BlockedReason

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

BlockedReason

ProhibitedContent

The prompt was blocked because it contains prohibited content.

public static BlockedReason ProhibitedContent { get; }

Property Value

BlockedReason

Safety

The prompt was blocked for safety reasons.

public static BlockedReason Safety { get; }

Property Value

BlockedReason

Value

public string Value { get; }

Property Value

string

Methods

Equals(BlockedReason)

public bool Equals(BlockedReason other)

Parameters

other BlockedReason

Returns

bool

FromString(string)

public static BlockedReason FromString(string value)

Parameters

value string

Returns

BlockedReason

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

implicit operator BlockedReason(string)

public static implicit operator BlockedReason(string value)

Parameters

value string

Returns

BlockedReason