HarmBlockThreshold

public final classHarmBlockThreshold


Represents the threshold for aHarmCategory to be allowed bySafetySetting.

Summary

Nested types

public static classHarmBlockThreshold.Companion

Public fields

static final @NonNullHarmBlockThreshold

Content with negligible harm is allowed.

static final @NonNullHarmBlockThreshold

Content with negligible to low harm is allowed.

static final @NonNullHarmBlockThreshold

All content is allowed regardless of harm.

static final @NonNullHarmBlockThreshold

All content is allowed regardless of harm.

static final @NonNullHarmBlockThreshold

Content with negligible to medium harm is allowed.

final int

Public fields

LOW_AND_ABOVE

public static final @NonNullHarmBlockThreshold LOW_AND_ABOVE

Content with negligible harm is allowed.

MEDIUM_AND_ABOVE

public static final @NonNullHarmBlockThreshold MEDIUM_AND_ABOVE

Content with negligible to low harm is allowed.

NONE

public static final @NonNullHarmBlockThreshold NONE

All content is allowed regardless of harm.

OFF

public static final @NonNullHarmBlockThreshold OFF

All content is allowed regardless of harm.

The same asNONE, but metadata when the correspondingHarmCategory occurs willNOT be present in the response.

ONLY_HIGH

public static final @NonNullHarmBlockThreshold ONLY_HIGH

Content with negligible to medium harm is allowed.

ordinal

public final int ordinal

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.