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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-19 UTC."],[[["The safety specification can be enabled to filter responses, and when enabled without specific settings, it applies a `BLOCK_LOW_AND_ABOVE` threshold to all categories."],["When the safety specification is enabled, `safetySettings` can be used to apply custom settings, which consist of a `category` and a `threshold`, to specific areas."],["The `HarmBlockThreshold` provides different levels of blocking, ranging from `BLOCK_LOW_AND_ABOVE` to `BLOCK_ONLY_HIGH`, and includes options to turn off filtering with `OFF`."],["The `SafetySetting` includes two required parameters, `category` which defines the harm type, and `threshold`, which is an enum specifying how aggressively to block content from the `HarmBlockThreshold`."],["The `safetySpec` `enable` field is a boolean, false by default, and when set to true, determines whether safety settings and threshold are applied."]]],[]]