Table of Contents

Struct HarmCategory

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

The harm category to be blocked.

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

Properties

AllValues

public static IReadOnlyList<HarmCategory> AllValues { get; }

Property Value

IReadOnlyList<HarmCategory>

HarmCategoryCivicIntegrity

Deprecated: Election filter is not longer supported. The harm category is civic integrity.

public static HarmCategory HarmCategoryCivicIntegrity { get; }

Property Value

HarmCategory

HarmCategoryDangerousContent

Content that promotes, facilitates, or enables dangerous activities.

public static HarmCategory HarmCategoryDangerousContent { get; }

Property Value

HarmCategory

HarmCategoryHarassment

Abusive, threatening, or content intended to bully, torment, or ridicule.

public static HarmCategory HarmCategoryHarassment { get; }

Property Value

HarmCategory

HarmCategoryHateSpeech

Content that promotes violence or incites hatred against individuals or groups based on certain attributes.

public static HarmCategory HarmCategoryHateSpeech { get; }

Property Value

HarmCategory

HarmCategoryImageDangerousContent

Images that contain dangerous content. This enum value is not supported in Gemini API.

public static HarmCategory HarmCategoryImageDangerousContent { get; }

Property Value

HarmCategory

HarmCategoryImageHarassment

Images that contain harassment. This enum value is not supported in Gemini API.

public static HarmCategory HarmCategoryImageHarassment { get; }

Property Value

HarmCategory

HarmCategoryImageHate

Images that contain hate speech. This enum value is not supported in Gemini API.

public static HarmCategory HarmCategoryImageHate { get; }

Property Value

HarmCategory

HarmCategoryImageSexuallyExplicit

Images that contain sexually explicit content. This enum value is not supported in Gemini API.

public static HarmCategory HarmCategoryImageSexuallyExplicit { get; }

Property Value

HarmCategory

HarmCategoryJailbreak

Prompts designed to bypass safety filters. This enum value is not supported in Gemini API.

public static HarmCategory HarmCategoryJailbreak { get; }

Property Value

HarmCategory

HarmCategorySexuallyExplicit

Content that contains sexually explicit material.

public static HarmCategory HarmCategorySexuallyExplicit { get; }

Property Value

HarmCategory

HarmCategoryUnspecified

Default value. This value is unused.

public static HarmCategory HarmCategoryUnspecified { get; }

Property Value

HarmCategory

Value

public string Value { get; }

Property Value

string

Methods

Equals(HarmCategory)

public bool Equals(HarmCategory other)

Parameters

other HarmCategory

Returns

bool

FromString(string)

public static HarmCategory FromString(string value)

Parameters

value string

Returns

HarmCategory

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

implicit operator HarmCategory(string)

public static implicit operator HarmCategory(string value)

Parameters

value string

Returns

HarmCategory