Safety specification. There are two use cases: 1. when only safetySpec.enable is set, the BLOCK_LOW_AND_ABOVE threshold will be applied for all categories. 2. when safetySpec.enable is set and some safetySettings are set, only specified safetySettings are applied.
JSON representation |
---|
{
"enable": boolean,
"safetySettings": [
{
object ( |
Fields | |
---|---|
enable |
Enable the safety filtering on the answer response. It is false by default. |
safety |
Optional. Safety settings. This settings are effective only when the safetySpec.enable is true. |
SafetySetting
Safety settings.
JSON representation |
---|
{ "category": enum ( |
Fields | |
---|---|
category |
Required. Harm category. |
threshold |
Required. The harm block threshold. |
HarmBlockThreshold
probability based thresholds levels for blocking.
Enums | |
---|---|
HARM_BLOCK_THRESHOLD_UNSPECIFIED |
Unspecified harm block threshold. |
BLOCK_LOW_AND_ABOVE |
Block low threshold and above (i.e. block more). |
BLOCK_MEDIUM_AND_ABOVE |
Block medium threshold and above. |
BLOCK_ONLY_HIGH |
Block only high threshold (i.e. block less). |
BLOCK_NONE |
Block none. |
OFF |
Turn off the safety filter. |