Table of Contents

Struct HarmBlockMethod

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

The method for blocking content. If not specified, the default behavior is to use the probability score. This enum is not supported in Gemini API.

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

Properties

AllValues

public static IReadOnlyList<HarmBlockMethod> AllValues { get; }

Property Value

IReadOnlyList<HarmBlockMethod>

HarmBlockMethodUnspecified

The harm block method is unspecified.

public static HarmBlockMethod HarmBlockMethodUnspecified { get; }

Property Value

HarmBlockMethod

Probability

The harm block method uses the probability score.

public static HarmBlockMethod Probability { get; }

Property Value

HarmBlockMethod

Severity

The harm block method uses both probability and severity scores.

public static HarmBlockMethod Severity { get; }

Property Value

HarmBlockMethod

Value

public string Value { get; }

Property Value

string

Methods

Equals(HarmBlockMethod)

public bool Equals(HarmBlockMethod other)

Parameters

other HarmBlockMethod

Returns

bool

FromString(string)

public static HarmBlockMethod FromString(string value)

Parameters

value string

Returns

HarmBlockMethod

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

implicit operator HarmBlockMethod(string)

public static implicit operator HarmBlockMethod(string value)

Parameters

value string

Returns

HarmBlockMethod