Skip to content

Commit aab0282

Browse files
committed
[Vertex AI] Rename BlockThreshold to HarmBlockThreshold (#13696)
1 parent 3cab646 commit aab0282

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

FirebaseVertexAI/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
- [changed] **Breaking Change**: The `HarmCategory` enum is no longer nested
33
inside the `SafetySetting` struct and the `unspecified` case has been
44
removed. (#13686)
5+
- [changed] **Breaking Change**: The `BlockThreshold` enum in `SafetySetting`
6+
has been renamed to `HarmBlockThreshold`. (#13696)
57

68
# 11.3.0
79
- [added] Added `Decodable` conformance for `FunctionResponse`. (#13606)

FirebaseVertexAI/Sources/Safety.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public struct SafetyRating: Equatable, Hashable, Sendable {
6767
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
6868
public struct SafetySetting {
6969
/// Block at and beyond a specified ``SafetyRating/HarmProbability``.
70-
public enum BlockThreshold: String, Sendable {
70+
public enum HarmBlockThreshold: String, Sendable {
7171
// Content with `.negligible` will be allowed.
7272
case blockLowAndAbove = "BLOCK_LOW_AND_ABOVE"
7373

@@ -90,10 +90,10 @@ public struct SafetySetting {
9090
public let harmCategory: HarmCategory
9191

9292
/// The threshold describing what content should be blocked.
93-
public let threshold: BlockThreshold
93+
public let threshold: HarmBlockThreshold
9494

9595
/// Initializes a new safety setting with the given category and threshold.
96-
public init(harmCategory: HarmCategory, threshold: BlockThreshold) {
96+
public init(harmCategory: HarmCategory, threshold: HarmBlockThreshold) {
9797
self.harmCategory = harmCategory
9898
self.threshold = threshold
9999
}
@@ -153,7 +153,7 @@ extension HarmCategory: Codable {
153153
}
154154

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

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

0 commit comments

Comments
 (0)