@@ -16,9 +16,9 @@ import Foundation
16
16
17
17
/// The model's response to a generate content request.
18
18
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
19
- public struct GenerateContentResponse {
19
+ public struct GenerateContentResponse : Sendable {
20
20
/// Token usage metadata for processing the generate content request.
21
- public struct UsageMetadata {
21
+ public struct UsageMetadata : Sendable {
22
22
/// The number of tokens in the request prompt.
23
23
public let promptTokenCount : Int
24
24
@@ -85,7 +85,7 @@ public struct GenerateContentResponse {
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
87
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
88
- public struct CandidateResponse {
88
+ public struct CandidateResponse : Sendable {
89
89
/// The response's content.
90
90
public let content : ModelContent
91
91
@@ -111,14 +111,14 @@ public struct CandidateResponse {
111
111
112
112
/// A collection of source attributions for a piece of content.
113
113
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
114
- public struct CitationMetadata {
114
+ public struct CitationMetadata : Sendable {
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
120
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
121
- public struct Citation {
121
+ public struct Citation : Sendable {
122
122
/// The inclusive beginning of a sequence in a model response that derives from a cited source.
123
123
public let startIndex : Int
124
124
@@ -137,7 +137,7 @@ public struct Citation {
137
137
138
138
/// A value enumerating possible reasons for a model to terminate a content generation request.
139
139
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
140
- public enum FinishReason : String {
140
+ public enum FinishReason : String , Sendable {
141
141
case unknown = " FINISH_REASON_UNKNOWN "
142
142
143
143
case unspecified = " FINISH_REASON_UNSPECIFIED "
@@ -162,9 +162,9 @@ public enum FinishReason: String {
162
162
163
163
/// A metadata struct containing any feedback the model had on the prompt it was provided.
164
164
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
165
- public struct PromptFeedback {
165
+ public struct PromptFeedback : Sendable {
166
166
/// A type describing possible reasons to block a prompt.
167
- public enum BlockReason : String {
167
+ public enum BlockReason : String , Sendable {
168
168
/// The block reason is unknown.
169
169
case unknown = " UNKNOWN "
170
170
0 commit comments