1515import Foundation
1616
1717/// The model's response to a generate content request.
18- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
18+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
1919public struct GenerateContentResponse {
2020 /// Token usage metadata for processing the generate content request.
2121 public struct UsageMetadata {
@@ -84,7 +84,7 @@ public struct GenerateContentResponse {
8484
8585/// A struct representing a possible reply to a content generation prompt. Each content generation
8686/// prompt may produce multiple candidate responses.
87- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
87+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
8888public struct CandidateResponse {
8989 /// The response's content.
9090 public let content : ModelContent
@@ -110,14 +110,14 @@ public struct CandidateResponse {
110110}
111111
112112/// A collection of source attributions for a piece of content.
113- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
113+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
114114public struct CitationMetadata {
115115 /// A list of individual cited sources and the parts of the content to which they apply.
116116 public let citationSources : [ Citation ]
117117}
118118
119119/// A struct describing a source attribution.
120- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
120+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
121121public struct Citation {
122122 /// The inclusive beginning of a sequence in a model response that derives from a cited source.
123123 public let startIndex : Int
@@ -133,7 +133,7 @@ public struct Citation {
133133}
134134
135135/// 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 , * )
136+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
137137public enum FinishReason : String {
138138 case unknown = " FINISH_REASON_UNKNOWN "
139139
@@ -158,7 +158,7 @@ public enum FinishReason: String {
158158}
159159
160160/// 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 , * )
161+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
162162public struct PromptFeedback {
163163 /// A type describing possible reasons to block a prompt.
164164 public enum BlockReason : String {
@@ -190,7 +190,7 @@ public struct PromptFeedback {
190190
191191// MARK: - Codable Conformances
192192
193- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
193+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
194194extension GenerateContentResponse : Decodable {
195195 enum CodingKeys : CodingKey {
196196 case candidates
@@ -224,7 +224,7 @@ extension GenerateContentResponse: Decodable {
224224 }
225225}
226226
227- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
227+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
228228extension GenerateContentResponse . UsageMetadata : Decodable {
229229 enum CodingKeys : CodingKey {
230230 case promptTokenCount
@@ -241,7 +241,7 @@ extension GenerateContentResponse.UsageMetadata: Decodable {
241241 }
242242}
243243
244- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
244+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
245245extension CandidateResponse : Decodable {
246246 enum CodingKeys : CodingKey {
247247 case content
@@ -290,14 +290,14 @@ extension CandidateResponse: Decodable {
290290 }
291291}
292292
293- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
293+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
294294extension CitationMetadata : Decodable {
295295 enum CodingKeys : String , CodingKey {
296296 case citationSources = " citations "
297297 }
298298}
299299
300- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
300+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
301301extension Citation : Decodable {
302302 enum CodingKeys : CodingKey {
303303 case startIndex
@@ -315,7 +315,7 @@ extension Citation: Decodable {
315315 }
316316}
317317
318- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
318+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
319319extension FinishReason : Decodable {
320320 public init ( from decoder: Decoder ) throws {
321321 let value = try decoder. singleValueContainer ( ) . decode ( String . self)
@@ -330,7 +330,7 @@ extension FinishReason: Decodable {
330330 }
331331}
332332
333- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
333+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
334334extension PromptFeedback . BlockReason : Decodable {
335335 public init ( from decoder: Decoder ) throws {
336336 let value = try decoder. singleValueContainer ( ) . decode ( String . self)
@@ -345,7 +345,7 @@ extension PromptFeedback.BlockReason: Decodable {
345345 }
346346}
347347
348- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
348+ @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , * )
349349extension PromptFeedback : Decodable {
350350 enum CodingKeys : CodingKey {
351351 case blockReason
0 commit comments