SafetySetting

class SafetySetting


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

Summary

Public constructors

SafetySetting(
    harmCategory: HarmCategory,
    threshold: HarmBlockThreshold,
    method: HarmBlockMethod?
)

Public constructors

SafetySetting

SafetySetting(
    harmCategory: HarmCategory,
    threshold: HarmBlockThreshold,
    method: HarmBlockMethod? = null
)
Parameters
harmCategory: HarmCategory

The relevant HarmCategory.

threshold: HarmBlockThreshold

The threshold form harm allowable.

method: HarmBlockMethod? = null

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