Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions FirebaseVertexAI/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
- [changed] **Breaking Change**: The `HarmCategory` enum is no longer nested
inside the `SafetySetting` struct and the `unspecified` case has been
removed. (#13686)
- [changed] **Breaking Change**: The `BlockThreshold` enum in `SafetySetting`
has been renamed to `HarmBlockThreshold`. (#13696)

# 11.3.0
- [added] Added `Decodable` conformance for `FunctionResponse`. (#13606)
Expand Down
8 changes: 4 additions & 4 deletions FirebaseVertexAI/Sources/Safety.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public struct SafetyRating: Equatable, Hashable, Sendable {
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
public struct SafetySetting {
/// Block at and beyond a specified ``SafetyRating/HarmProbability``.
public enum BlockThreshold: String, Sendable {
public enum HarmBlockThreshold: String, Sendable {
// Content with `.negligible` will be allowed.
case blockLowAndAbove = "BLOCK_LOW_AND_ABOVE"

Expand All @@ -90,10 +90,10 @@ public struct SafetySetting {
public let harmCategory: HarmCategory

/// The threshold describing what content should be blocked.
public let threshold: BlockThreshold
public let threshold: HarmBlockThreshold

/// Initializes a new safety setting with the given category and threshold.
public init(harmCategory: HarmCategory, threshold: BlockThreshold) {
public init(harmCategory: HarmCategory, threshold: HarmBlockThreshold) {
self.harmCategory = harmCategory
self.threshold = threshold
}
Expand Down Expand Up @@ -153,7 +153,7 @@ extension HarmCategory: Codable {
}

@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
extension SafetySetting.BlockThreshold: Encodable {}
extension SafetySetting.HarmBlockThreshold: Encodable {}

@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
extension SafetySetting: Encodable {}
Loading