Table of Contents

Struct HarmBlockThreshold

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

The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.

[JsonConverter(typeof(HarmBlockThresholdConverter))]
public readonly record struct HarmBlockThreshold : IEquatable<HarmBlockThreshold>
Implements
Inherited Members

Properties

AllValues

public static IReadOnlyList<HarmBlockThreshold> AllValues { get; }

Property Value

IReadOnlyList<HarmBlockThreshold>

BlockLowAndAbove

Block content with a low harm probability or higher.

public static HarmBlockThreshold BlockLowAndAbove { get; }

Property Value

HarmBlockThreshold

BlockMediumAndAbove

Block content with a medium harm probability or higher.

public static HarmBlockThreshold BlockMediumAndAbove { get; }

Property Value

HarmBlockThreshold

BlockNone

Do not block any content, regardless of its harm probability.

public static HarmBlockThreshold BlockNone { get; }

Property Value

HarmBlockThreshold

BlockOnlyHigh

Block content with a high harm probability.

public static HarmBlockThreshold BlockOnlyHigh { get; }

Property Value

HarmBlockThreshold

HarmBlockThresholdUnspecified

The harm block threshold is unspecified.

public static HarmBlockThreshold HarmBlockThresholdUnspecified { get; }

Property Value

HarmBlockThreshold

Off

Turn off the safety filter entirely.

public static HarmBlockThreshold Off { get; }

Property Value

HarmBlockThreshold

Value

public string Value { get; }

Property Value

string

Methods

Equals(HarmBlockThreshold)

public bool Equals(HarmBlockThreshold other)

Parameters

other HarmBlockThreshold

Returns

bool

FromString(string)

public static HarmBlockThreshold FromString(string value)

Parameters

value string

Returns

HarmBlockThreshold

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

implicit operator HarmBlockThreshold(string)

public static implicit operator HarmBlockThreshold(string value)

Parameters

value string

Returns

HarmBlockThreshold