Safety Setting
@Serializable
A safety setting that affects the safety-blocking behavior. A SafetySetting consists of a harm category and a threshold for that category.
Constructors
Link copied to clipboard
constructor(category: HarmCategory? = null, method: HarmBlockMethod? = null, threshold: HarmBlockThreshold? = null)
Properties
Link copied to clipboard
Required. The harm category to be blocked.
Link copied to clipboard
Optional. The method for blocking content. If not specified, the default behavior is to use the probability score. This field is not supported in Gemini API.
Link copied to clipboard
Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.