HarmBlockThreshold

classHarmBlockThreshold


Represents the threshold for aHarmCategory to be allowed bySafetySetting.

Summary

Public companion properties

HarmBlockThreshold

Content with negligible harm is allowed.

HarmBlockThreshold

Content with negligible to low harm is allowed.

HarmBlockThreshold

All content is allowed regardless of harm.

HarmBlockThreshold

All content is allowed regardless of harm.

HarmBlockThreshold

Content with negligible to medium harm is allowed.

Public properties

Int

Public companion properties

LOW_AND_ABOVE

val LOW_AND_ABOVEHarmBlockThreshold

Content with negligible harm is allowed.

MEDIUM_AND_ABOVE

val MEDIUM_AND_ABOVEHarmBlockThreshold

Content with negligible to low harm is allowed.

NONE

val NONEHarmBlockThreshold

All content is allowed regardless of harm.

OFF

val OFFHarmBlockThreshold

All content is allowed regardless of harm.

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

ONLY_HIGH

val ONLY_HIGHHarmBlockThreshold

Content with negligible to medium harm is allowed.

Public properties

ordinal

val ordinalInt

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.