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-06-27 UTC."],[[["\u003cp\u003eThe safety specification can be enabled to filter responses, and when enabled without specific settings, it applies a \u003ccode\u003eBLOCK_LOW_AND_ABOVE\u003c/code\u003e threshold to all categories.\u003c/p\u003e\n"],["\u003cp\u003eWhen the safety specification is enabled, \u003ccode\u003esafetySettings\u003c/code\u003e can be used to apply custom settings, which consist of a \u003ccode\u003ecategory\u003c/code\u003e and a \u003ccode\u003ethreshold\u003c/code\u003e, to specific areas.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eHarmBlockThreshold\u003c/code\u003e provides different levels of blocking, ranging from \u003ccode\u003eBLOCK_LOW_AND_ABOVE\u003c/code\u003e to \u003ccode\u003eBLOCK_ONLY_HIGH\u003c/code\u003e, and includes options to turn off filtering with \u003ccode\u003eOFF\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSafetySetting\u003c/code\u003e includes two required parameters, \u003ccode\u003ecategory\u003c/code\u003e which defines the harm type, and \u003ccode\u003ethreshold\u003c/code\u003e, which is an enum specifying how aggressively to block content from the \u003ccode\u003eHarmBlockThreshold\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esafetySpec\u003c/code\u003e \u003ccode\u003eenable\u003c/code\u003e field is a boolean, false by default, and when set to true, determines whether safety settings and threshold are applied.\u003c/p\u003e\n"]]],[],null,[]]