File tree Expand file tree Collapse file tree 3 files changed +3
-14
lines changed
firebase-ai/src/androidTest/kotlin/com/google/firebase/ai Expand file tree Collapse file tree 3 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ class AIModels {
3232 }
3333
3434 fun setup () {
35- val context = InstrumentationRegistry .getInstrumentation().context;
35+ val context = InstrumentationRegistry .getInstrumentation().context
36+ app =
3637 FirebaseApp .initializeApp(
3738 context,
3839 FirebaseOptions .Builder ()
Original file line number Diff line number Diff line change @@ -65,15 +65,4 @@ class GenerateContentTests {
6565 }
6666 }
6767 }
68-
69- @Test
70- fun testGenerateContent_Tools () {
71- for (model in getModels()) {
72- runBlocking {
73- val response = model.generateContent(Content .Builder ().text(" here is a tiny smile" ).build())
74- validator.validateResponse(response)
75- model.startChat()
76- }
77- }
78- }
7968}
Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ import com.google.firebase.ai.type.TextPart
99class TypesValidator {
1010
1111 fun validateResponse (response : GenerateContentResponse ) {
12- if (hasText(response.candidates[0 ].content)) {
13- assert (response.candidates.isNotEmpty())
12+ if (response.candidates.isNotEmpty() && hasText(response.candidates[0 ].content)) {
1413 assert (response.text!! .isNotEmpty())
1514 } else if (response.candidates.isNotEmpty()) {
1615 assert (! hasText(response.candidates[0 ].content))
You can’t perform that action at this time.
0 commit comments