Skip to content

Commit 5fb5a5b

Browse files
committed
[Vertex AI] Remove unspecified enum cases from response types (#13699)
1 parent aab0282 commit 5fb5a5b

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

FirebaseVertexAI/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
removed. (#13686)
55
- [changed] **Breaking Change**: The `BlockThreshold` enum in `SafetySetting`
66
has been renamed to `HarmBlockThreshold`. (#13696)
7+
- [changed] **Breaking Change**: The `unspecified` case has been removed from
8+
the `FinishReason`, `PromptFeedback` and `HarmProbability` enums; this
9+
scenario is now handled by the existing `unknown` case. (#13699)
710

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

FirebaseVertexAI/Sample/ChatSample/Views/ErrorDetailsView.swift

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ extension SafetyRating.HarmProbability: CustomStringConvertible {
3636
case .medium: "Medium"
3737
case .negligible: "Negligible"
3838
case .unknown: "Unknown"
39-
case .unspecified: "Unspecified"
4039
}
4140
}
4241
}

FirebaseVertexAI/Sources/GenerateContentResponse.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,9 @@ public struct Citation: Sendable {
138138
/// A value enumerating possible reasons for a model to terminate a content generation request.
139139
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
140140
public enum FinishReason: String, Sendable {
141+
/// The finish reason is unknown.
141142
case unknown = "FINISH_REASON_UNKNOWN"
142143

143-
case unspecified = "FINISH_REASON_UNSPECIFIED"
144-
145144
/// Natural stop point of the model or provided stop sequence.
146145
case stop = "STOP"
147146

@@ -168,9 +167,6 @@ public struct PromptFeedback: Sendable {
168167
/// The block reason is unknown.
169168
case unknown = "UNKNOWN"
170169

171-
/// The block reason was not specified in the server response.
172-
case unspecified = "BLOCK_REASON_UNSPECIFIED"
173-
174170
/// The prompt was blocked because it was deemed unsafe.
175171
case safety = "SAFETY"
176172

FirebaseVertexAI/Sources/Safety.swift

-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ public struct SafetyRating: Equatable, Hashable, Sendable {
4444
/// Unknown. A new server value that isn't recognized by the SDK.
4545
case unknown = "UNKNOWN"
4646

47-
/// The probability was not specified in the server response.
48-
case unspecified = "HARM_PROBABILITY_UNSPECIFIED"
49-
5047
/// The probability is zero or close to zero. For benign content, the probability across all
5148
/// categories will be this value.
5249
case negligible = "NEGLIGIBLE"

0 commit comments

Comments
 (0)