SafetyRating
@available(iOS 15.0, macOS 11.0, *)
public struct SafetyRating : Equatable, Hashable
extension SafetyRating: Decodable
A type defining potentially harmful media categories and their model-assigned ratings. A value of this type may be assigned to a category for every model-generated response, not just responses that exceed a certain threshold.
-
The category describing the potential harm a piece of content may pose. See
HarmCategory
for a list of possible values.Declaration
Swift
public let category: SafetySetting.HarmCategory
-
The model-generated probability that a given piece of content falls under the harm category described in
HarmCategory
. This does not indicate the severity of harm for a piece of content. SeeHarmProbability
for a list of possible values.Declaration
Swift
public let probability: HarmProbability
-
Initializes a new
SafetyRating
instance with the given category and probability. Use this initializer for SwiftUI previews or tests.Declaration
Swift
public init(category: SafetySetting.HarmCategory, probability: HarmProbability)
-
The probability that a given model output falls under a harmful content category. This does not indicate the severity of harm for a piece of content.
Declaration