HarmBlockMethod

public final classHarmBlockMethod


Specifies how the block method computes the score that will be compared against theHarmBlockThreshold inSafetySetting.

Summary

Nested types

public static classHarmBlockMethod.Companion

Public fields

static final @NonNullHarmBlockMethod

The harm block method uses the probability score.

static final @NonNullHarmBlockMethod

The harm block method uses both probability and severity scores.

final int

Public fields

PROBABILITY

public static final @NonNullHarmBlockMethod PROBABILITY

The harm block method uses the probability score. SeeHarmProbability.

SEVERITY

public static final @NonNullHarmBlockMethod SEVERITY

The harm block method uses both probability and severity scores. SeeHarmSeverity andHarmProbability.

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.