SafetySetting

public final class SafetySetting


A configuration for a HarmBlockThreshold of some HarmCategory allowed and blocked in responses.

Summary

Public constructors

SafetySetting(
    @NonNull HarmCategory harmCategory,
    @NonNull HarmBlockThreshold threshold,
    HarmBlockMethod method
)

Public constructors

SafetySetting

public SafetySetting(
    @NonNull HarmCategory harmCategory,
    @NonNull HarmBlockThreshold threshold,
    HarmBlockMethod method
)
Parameters
@NonNull HarmCategory harmCategory

The relevant HarmCategory.

@NonNull HarmBlockThreshold threshold

The threshold form harm allowable.

HarmBlockMethod method

Specify if the threshold is used for probability or severity score, if not specified it will default to HarmBlockMethod.PROBABILITY.