Class SafetySetting
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.
public class SafetySetting
- Inheritance
-
SafetySetting
- Inherited Members
- Extension Methods
Properties
Category
Required. The category for this setting.
[JsonPropertyName("category")]
public HarmCategory Category { get; set; }
Property Value
Method
Optional. Determines if the harm block method uses probability or probability and severity scores.
[JsonPropertyName("method")]
public HarmBlockMethod? Method { get; set; }
Property Value
Threshold
Required. Controls the probability threshold at which harm is blocked.
[JsonPropertyName("threshold")]
public HarmBlockThreshold Threshold { get; set; }