15
15
import Foundation
16
16
17
17
/// The model's response to a generate content request.
18
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
18
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
19
19
public struct GenerateContentResponse {
20
20
/// Token usage metadata for processing the generate content request.
21
21
public struct UsageMetadata {
@@ -84,7 +84,7 @@ public struct GenerateContentResponse {
84
84
85
85
/// A struct representing a possible reply to a content generation prompt. Each content generation
86
86
/// prompt may produce multiple candidate responses.
87
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
87
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
88
88
public struct CandidateResponse {
89
89
/// The response's content.
90
90
public let content : ModelContent
@@ -110,14 +110,14 @@ public struct CandidateResponse {
110
110
}
111
111
112
112
/// A collection of source attributions for a piece of content.
113
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
113
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
114
114
public struct CitationMetadata {
115
115
/// A list of individual cited sources and the parts of the content to which they apply.
116
116
public let citationSources : [ Citation ]
117
117
}
118
118
119
119
/// A struct describing a source attribution.
120
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
120
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
121
121
public struct Citation {
122
122
/// The inclusive beginning of a sequence in a model response that derives from a cited source.
123
123
public let startIndex : Int
@@ -133,7 +133,7 @@ public struct Citation {
133
133
}
134
134
135
135
/// A value enumerating possible reasons for a model to terminate a content generation request.
136
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
136
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
137
137
public enum FinishReason : String {
138
138
case unknown = " FINISH_REASON_UNKNOWN "
139
139
@@ -158,7 +158,7 @@ public enum FinishReason: String {
158
158
}
159
159
160
160
/// A metadata struct containing any feedback the model had on the prompt it was provided.
161
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
161
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
162
162
public struct PromptFeedback {
163
163
/// A type describing possible reasons to block a prompt.
164
164
public enum BlockReason : String {
@@ -190,7 +190,7 @@ public struct PromptFeedback {
190
190
191
191
// MARK: - Codable Conformances
192
192
193
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
193
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
194
194
extension GenerateContentResponse : Decodable {
195
195
enum CodingKeys : CodingKey {
196
196
case candidates
@@ -224,7 +224,7 @@ extension GenerateContentResponse: Decodable {
224
224
}
225
225
}
226
226
227
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
227
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
228
228
extension GenerateContentResponse . UsageMetadata : Decodable {
229
229
enum CodingKeys : CodingKey {
230
230
case promptTokenCount
@@ -241,7 +241,7 @@ extension GenerateContentResponse.UsageMetadata: Decodable {
241
241
}
242
242
}
243
243
244
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
244
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
245
245
extension CandidateResponse : Decodable {
246
246
enum CodingKeys : CodingKey {
247
247
case content
@@ -290,14 +290,14 @@ extension CandidateResponse: Decodable {
290
290
}
291
291
}
292
292
293
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
293
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
294
294
extension CitationMetadata : Decodable {
295
295
enum CodingKeys : String , CodingKey {
296
296
case citationSources = " citations "
297
297
}
298
298
}
299
299
300
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
300
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
301
301
extension Citation : Decodable {
302
302
enum CodingKeys : CodingKey {
303
303
case startIndex
@@ -315,7 +315,7 @@ extension Citation: Decodable {
315
315
}
316
316
}
317
317
318
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
318
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
319
319
extension FinishReason : Decodable {
320
320
public init ( from decoder: Decoder ) throws {
321
321
let value = try decoder. singleValueContainer ( ) . decode ( String . self)
@@ -330,7 +330,7 @@ extension FinishReason: Decodable {
330
330
}
331
331
}
332
332
333
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
333
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
334
334
extension PromptFeedback . BlockReason : Decodable {
335
335
public init ( from decoder: Decoder ) throws {
336
336
let value = try decoder. singleValueContainer ( ) . decode ( String . self)
@@ -345,7 +345,7 @@ extension PromptFeedback.BlockReason: Decodable {
345
345
}
346
346
}
347
347
348
- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
348
+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
349
349
extension PromptFeedback : Decodable {
350
350
enum CodingKeys : CodingKey {
351
351
case blockReason
0 commit comments