Skip to content

Commit 7dbe236

Browse files
committed
Review fixes
1 parent 8e835c1 commit 7dbe236

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Candidate.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,15 @@ public class FinishReason private constructor(public val name: String, public va
300300
* [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google
301301
* Search".
302302
*
303-
* @property webSearchQueries A list of web search queries that the model performed to gather the
303+
* @property webSearchQueries The list of web search queries that the model performed to gather the
304304
* grounding information. These can be used to allow users to explore the search results themselves.
305305
* @property searchEntryPoint Google search entry point for web searches. This contains an HTML/CSS
306306
* snippet that **must** be embedded in an app to display a Google Search Entry point for follow-up
307307
* web searches related to the model's "Grounded Response". To ensure proper rendering, it's
308308
* recommended to display this content within a `WebView`.
309-
* @property groundingChunks A list of [GroundingChunk] objects. Each chunk represents a piece of
309+
* @property groundingChunks The list of [GroundingChunk] objects. Each chunk represents a piece of
310310
* retrieved content (e.g. from a web page) that the model used to ground its response.
311-
* @property groundingSupports A list of [GroundingSupport] objects. Each object details how
311+
* @property groundingSupports The list of [GroundingSupport] objects. Each object details how
312312
* specific segments of the model's response are supported by the `groundingChunks`.
313313
*/
314314
public class GroundingMetadata(
@@ -343,7 +343,7 @@ public class GroundingMetadata(
343343
}
344344

345345
/**
346-
* A class representing the Google Search entry point.
346+
* Represents a Google Search entry point.
347347
*
348348
* When using this feature, you are required to comply with the
349349
* [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/GoogleSearch.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Google LLC
2+
* Copyright 2025 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,4 +26,8 @@ import kotlinx.serialization.Serializable
2626
* the Grounding with Google Search terms outlined in the
2727
* [Service Specific Terms](https://cloud.google.com/terms/service-terms).
2828
*/
29-
@Serializable public class GoogleSearch {}
29+
public class GoogleSearch {
30+
@Serializable internal class Internal()
31+
32+
internal fun toInternal() = Internal()
33+
}

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Tool.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ internal constructor(
3333
internal fun toInternal() =
3434
Internal(
3535
functionDeclarations?.map { it.toInternal() } ?: emptyList(),
36-
googleSearch = this.googleSearch
36+
googleSearch = this.googleSearch?.toInternal()
3737
)
3838
@Serializable
3939
internal data class Internal(
4040
val functionDeclarations: List<FunctionDeclaration.Internal>? = null,
41-
val googleSearch: GoogleSearch? = null,
41+
val googleSearch: GoogleSearch.Internal? = null,
4242
// This is a json object because it is not possible to make a data class with no parameters.
4343
val codeExecution: JsonObject? = null,
4444
)

firebase-ai/src/test/java/com/google/firebase/ai/DevAPIUnarySnapshotTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ internal class DevAPIUnarySnapshotTests {
9999
withTimeout(testTimeout) { shouldThrow<ServerException> { model.generateContent("prompt") } }
100100
}
101101

102-
// This test case can be removed once https://b.corp.google.com/issues/422779395 (internal) is
102+
// This test case can be removed once b/422779395 is
103103
// fixed.
104104
@Test
105105
fun `google search grounding empty grounding chunks`() =

firebase-ai/src/test/java/com/google/firebase/ai/SerializationTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ internal class SerializationTests {
427427
}
428428
"""
429429
.trimIndent()
430-
val actualJson = descriptorToJson(GoogleSearch.serializer().descriptor)
430+
val actualJson = descriptorToJson(GoogleSearch.Internal.serializer().descriptor)
431431
expectedJsonAsString shouldEqualJson actualJson.toString()
432432
}
433433
}

firebase-ai/src/test/java/com/google/firebase/ai/common/APIControllerTests.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ internal class RequestFormatTests {
274274
val controller =
275275
APIController(
276276
"super_cool_test_key",
277-
"gemini-pro-1.5",
277+
"gemini-pro-2.5",
278278
RequestOptions(),
279279
mockEngine,
280280
TEST_CLIENT_ID,
@@ -290,7 +290,7 @@ internal class RequestFormatTests {
290290
GenerateContentRequest(
291291
model = "unused",
292292
contents = listOf(Content.Internal(parts = listOf(TextPart.Internal("Arbitrary")))),
293-
tools = listOf(Tool.Internal(googleSearch = GoogleSearch())),
293+
tools = listOf(Tool.Internal(googleSearch = GoogleSearch.Internal())),
294294
)
295295
)
296296
.collect { channel.close() }

0 commit comments

Comments
 (0)