SafetySetting
@available(iOS 15.0, macOS 11.0, *)
public struct SafetySetting
extension SafetySetting: Codable
A type used to specify a threshold for harmful content, beyond which the model will return a fallback response instead of generated content.
-
A type describing safety attributes, which include harmful categories and topics that can be considered sensitive.
Declaration
-
Block at and beyond a specified
HarmProbability
.Declaration
-
The category this safety setting should be applied to.
Declaration
Swift
public let harmCategory: HarmCategory
-
The threshold describing what content should be blocked.
Declaration
Swift
public let threshold: BlockThreshold
-
Initializes a new safety setting with the given category and threshold.
Declaration
Swift
public init(harmCategory: HarmCategory, threshold: BlockThreshold)