File tree 1 file changed +18
-0
lines changed
FirebaseVertexAI/Tests/Unit
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,24 @@ final class VertexAIAPITests: XCTestCase {
167
167
_ = genAI. startChat ( history: [ ModelContent ( parts: " abc " ) ] )
168
168
}
169
169
170
+ // Public API tests for GenerateContentResponse.
171
+ func generateContentResponseAPI( ) {
172
+ let response = GenerateContentResponse ( candidates: [ ] )
173
+
174
+ let _: [ CandidateResponse ] = response. candidates
175
+ let _: PromptFeedback ? = response. promptFeedback
176
+
177
+ // Usage Metadata
178
+ guard let usageMetadata = response. usageMetadata else { fatalError ( ) }
179
+ let _: Int = usageMetadata. promptTokenCount
180
+ let _: Int = usageMetadata. candidatesTokenCount
181
+ let _: Int = usageMetadata. totalTokenCount
182
+
183
+ // Computed Properties
184
+ let _: String ? = response. text
185
+ let _: [ FunctionCall ] = response. functionCalls
186
+ }
187
+
170
188
// Result builder alternative
171
189
172
190
/*
You can’t perform that action at this time.
0 commit comments