Skip to content

Commit b3320e6

Browse files
committed
Adjustments and format
1 parent ccf0d50 commit b3320e6

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

firebase-ai/src/androidTest/kotlin/com/google/firebase/ai/AIModels.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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()

firebase-ai/src/androidTest/kotlin/com/google/firebase/ai/GenerateContentTests.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff 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
}

firebase-ai/src/androidTest/kotlin/com/google/firebase/ai/TypesValidator.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import com.google.firebase.ai.type.TextPart
99
class 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))

0 commit comments

Comments
 (0)