FirebaseVertexAI Framework Reference

HarmProbability

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
public struct HarmProbability : DecodableProtoEnum, Hashable, Sendable

The probability that a given model output falls under a harmful content category.

Note

This does not indicate the severity of harm for a piece of content.

  • The probability is zero or close to zero.

    For benign content, the probability across all categories will be this value.

    Declaration

    Swift

    public static let negligible: SafetyRating.HarmProbability
  • low

    The probability is small but non-zero.

    Declaration

    Swift

    public static let low: SafetyRating.HarmProbability
  • The probability is moderate.

    Declaration

    Swift

    public static let medium: SafetyRating.HarmProbability
  • The probability is high.

    The content described is very likely harmful.

    Declaration

    Swift

    public static let high: SafetyRating.HarmProbability
  • Returns the raw string representation of the HarmProbability value.

    Note

    This value directly corresponds to the values in the REST API.

    Declaration

    Swift

    public let rawValue: String