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 \u003ccode\u003eSafetySpec\u003c/code\u003e allows users to enable safety filtering on answer responses, with a default setting of \u003ccode\u003efalse\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eWhen enabled, \u003ccode\u003eSafetySpec\u003c/code\u003e can apply a \u003ccode\u003eBLOCK_LOW_AND_ABOVE\u003c/code\u003e threshold to all categories or apply specific \u003ccode\u003eSafetySettings\u003c/code\u003e as desired.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSafetySetting\u003c/code\u003e requires both a \u003ccode\u003ecategory\u003c/code\u003e (harm type) and a \u003ccode\u003ethreshold\u003c/code\u003e (block level) to be defined for filtering.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eHarmBlockThreshold\u003c/code\u003e offers various levels of blocking, including \u003ccode\u003eBLOCK_LOW_AND_ABOVE\u003c/code\u003e, \u003ccode\u003eBLOCK_MEDIUM_AND_ABOVE\u003c/code\u003e, \u003ccode\u003eBLOCK_ONLY_HIGH\u003c/code\u003e, \u003ccode\u003eBLOCK_NONE\u003c/code\u003e, \u003ccode\u003eOFF\u003c/code\u003e, and \u003ccode\u003eHARM_BLOCK_THRESHOLD_UNSPECIFIED\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]