SafetySetting: { method?: Method; threshold: Threshold; type: HarmCategory }

A safety setting that affects the safety-blocking behavior.

Type declaration

  • Optionalmethod?: Method

    Optional. The method for blocking content. If not specified, the default

    behavior is to use the probability score.

  • threshold: Threshold

    Required. The threshold for blocking content. If the harm probability

    exceeds this threshold, the content will be blocked.

  • type: HarmCategory

A SafetySetting consists of a harm category and a threshold for that category.