1515import Foundation
1616
1717/// The model's response to a generate content request.
18- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
18+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
1919public struct GenerateContentResponse : Sendable {
2020 /// Token usage metadata for processing the generate content request.
21+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
2122 public struct UsageMetadata : Sendable {
2223 /// The number of tokens in the request prompt.
2324 public let promptTokenCount : Int
@@ -92,7 +93,7 @@ public struct GenerateContentResponse: Sendable {
9293
9394/// A struct representing a possible reply to a content generation prompt. Each content generation
9495/// prompt may produce multiple candidate responses.
95- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
96+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
9697public struct Candidate : Sendable {
9798 /// The response's content.
9899 public let content : ModelContent
@@ -118,14 +119,14 @@ public struct Candidate: Sendable {
118119}
119120
120121/// A collection of source attributions for a piece of content.
121- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
122+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
122123public struct CitationMetadata : Sendable {
123124 /// A list of individual cited sources and the parts of the content to which they apply.
124125 public let citations : [ Citation ]
125126}
126127
127128/// A struct describing a source attribution.
128- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
129+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
129130public struct Citation : Sendable {
130131 /// The inclusive beginning of a sequence in a model response that derives from a cited source.
131132 public let startIndex : Int
@@ -149,7 +150,7 @@ public struct Citation: Sendable {
149150}
150151
151152/// A value enumerating possible reasons for a model to terminate a content generation request.
152- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
153+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
153154public struct FinishReason : DecodableProtoEnum , Hashable , Sendable {
154155 enum Kind : String {
155156 case stop = " STOP "
@@ -204,9 +205,10 @@ public struct FinishReason: DecodableProtoEnum, Hashable, Sendable {
204205}
205206
206207/// A metadata struct containing any feedback the model had on the prompt it was provided.
207- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
208+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
208209public struct PromptFeedback : Sendable {
209210 /// A type describing possible reasons to block a prompt.
211+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
210212 public struct BlockReason : DecodableProtoEnum , Hashable , Sendable {
211213 enum Kind : String {
212214 case safety = " SAFETY "
@@ -257,7 +259,7 @@ public struct PromptFeedback: Sendable {
257259
258260// MARK: - Codable Conformances
259261
260- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
262+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
261263extension GenerateContentResponse : Decodable {
262264 enum CodingKeys : CodingKey {
263265 case candidates
@@ -291,7 +293,7 @@ extension GenerateContentResponse: Decodable {
291293 }
292294}
293295
294- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
296+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
295297extension GenerateContentResponse . UsageMetadata : Decodable {
296298 enum CodingKeys : CodingKey {
297299 case promptTokenCount
@@ -308,7 +310,7 @@ extension GenerateContentResponse.UsageMetadata: Decodable {
308310 }
309311}
310312
311- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
313+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
312314extension Candidate : Decodable {
313315 enum CodingKeys : CodingKey {
314316 case content
@@ -357,10 +359,10 @@ extension Candidate: Decodable {
357359 }
358360}
359361
360- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
362+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
361363extension CitationMetadata : Decodable { }
362364
363- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
365+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
364366extension Citation : Decodable {
365367 enum CodingKeys : CodingKey {
366368 case startIndex
@@ -412,7 +414,7 @@ extension Citation: Decodable {
412414 }
413415}
414416
415- @available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
417+ @available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
416418extension PromptFeedback : Decodable {
417419 enum CodingKeys : CodingKey {
418420 case blockReason
0 commit comments