@@ -59,22 +59,6 @@ public struct SafetyRating: Equatable, Hashable, Sendable {
59
59
}
60
60
}
61
61
62
- /// Safety feedback for an entire request.
63
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
64
- public struct SafetyFeedback {
65
- /// Safety rating evaluated from content.
66
- public let rating : SafetyRating
67
-
68
- /// Safety settings applied to the request.
69
- public let setting : SafetySetting
70
-
71
- /// Internal initializer.
72
- init ( rating: SafetyRating , setting: SafetySetting ) {
73
- self . rating = rating
74
- self . setting = setting
75
- }
76
- }
77
-
78
62
/// A type used to specify a threshold for harmful content, beyond which the model will return a
79
63
/// fallback response instead of generated content.
80
64
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
@@ -143,7 +127,7 @@ public struct SafetySetting {
143
127
// MARK: - Codable Conformances
144
128
145
129
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
146
- extension SafetyRating . HarmProbability : Codable {
130
+ extension SafetyRating . HarmProbability : Decodable {
147
131
public init ( from decoder: Decoder ) throws {
148
132
let value = try decoder. singleValueContainer ( ) . decode ( String . self)
149
133
guard let decodedProbability = SafetyRating . HarmProbability ( rawValue: value) else {
@@ -160,9 +144,6 @@ extension SafetyRating.HarmProbability: Codable {
160
144
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
161
145
extension SafetyRating : Decodable { }
162
146
163
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
164
- extension SafetyFeedback : Decodable { }
165
-
166
147
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
167
148
extension SafetySetting . HarmCategory : Codable {
168
149
public init ( from decoder: Decoder ) throws {
@@ -179,7 +160,7 @@ extension SafetySetting.HarmCategory: Codable {
179
160
}
180
161
181
162
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
182
- extension SafetySetting . BlockThreshold : Codable {
163
+ extension SafetySetting . BlockThreshold : Encodable {
183
164
public init ( from decoder: Decoder ) throws {
184
165
let value = try decoder. singleValueContainer ( ) . decode ( String . self)
185
166
guard let decodedThreshold = SafetySetting . BlockThreshold ( rawValue: value) else {
@@ -194,4 +175,4 @@ extension SafetySetting.BlockThreshold: Codable {
194
175
}
195
176
196
177
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
197
- extension SafetySetting : Codable { }
178
+ extension SafetySetting : Encodable { }
0 commit comments