@@ -33,6 +33,7 @@ import kotlinx.serialization.json.JsonNames
3333 * @property safetyRatings A list of [SafetyRating]s describing the generated content.
3434 * @property citationMetadata Metadata about the sources used to generate this content.
3535 * @property finishReason The reason the model stopped generating content, if it exist.
36+ * @property groundingMetadata Metadata returned to the client when grounding is enabled.
3637 */
3738public class Candidate
3839internal constructor (
@@ -297,17 +298,18 @@ public class FinishReason private constructor(public val name: String, public va
297298 * Metadata returned to the client when grounding is enabled.
298299 *
299300 * If using Grounding with Google Search, you are required to comply with the
300- * [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google
301- * Search".
301+ * "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer
302+ * API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API
303+ * (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service
304+ * Specific Terms).
302305 *
303306 * @property webSearchQueries The list of web search queries that the model performed to gather the
304307 * grounding information. These can be used to allow users to explore the search results themselves.
305308 * @property searchEntryPoint Google search entry point for web searches. This contains an HTML/CSS
306309 * snippet that **must** be embedded in an app to display a Google Search Entry point for follow-up
307- * web searches related to the model's "Grounded Response". To ensure proper rendering, it's
308- * recommended to display this content within a `WebView`.
309- * @property groundingChunks The list of [GroundingChunk] objects. Each chunk represents a piece of
310- * retrieved content (e.g. from a web page) that the model used to ground its response.
310+ * web searches related to the model's "Grounded Response".
311+ * @property groundingChunks The list of [GroundingChunk] classes. Each chunk represents a piece of
312+ * retrieved content that the model used to ground its response.
311313 * @property groundingSupports The list of [GroundingSupport] objects. Each object details how
312314 * specific segments of the model's response are supported by the `groundingChunks`.
313315 */
@@ -345,13 +347,8 @@ public class GroundingMetadata(
345347/* *
346348 * Represents a Google Search entry point.
347349 *
348- * When using this API, you are required to comply with the
349- * [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google
350- * Search".
351- *
352- * @property renderedContent An HTML/CSS snippet that can be embedded in your app. The snippet is
353- * designed to avoid undesired interaction with the rest of the page's CSS. To ensure proper
354- * rendering, it's recommended to display this content within a `WebView`.
350+ * @property renderedContent An HTML/CSS snippet that can be embedded in your app.
351+ * To ensure proper rendering, it's recommended to display this content within a `WebView`.
355352 * @property sdkBlob A blob of data for the client SDK to render the search entry point.
356353 */
357354public class SearchEntryPoint (
@@ -378,10 +375,6 @@ public class SearchEntryPoint(
378375 * Represents a chunk of retrieved data that supports a claim in the model's response. This is part
379376 * of the grounding information provided when grounding is enabled.
380377 *
381- * When using this API, you are required to comply with the
382- * [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google
383- * Search".
384- *
385378 * @property web Contains details if the grounding chunk is from a web source.
386379 */
387380public class GroundingChunk (
@@ -398,14 +391,10 @@ public class GroundingChunk(
398391/* *
399392 * A grounding chunk from the web.
400393 *
401- * When using this API, you are required to comply with the
402- * [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google
403- * Search".
404- *
405394 * @property uri The URI of the retrieved web page.
406395 * @property title The title of the retrieved web page.
407- * @property domain The domain of the original URI from which the content was retrieved (e.g.,
408- * `example.com`). This is only populated when using the Vertex AI Gemini API.
396+ * @property domain The domain of the original URI from which the content was retrieved.
397+ * This is only populated when using the Vertex AI Gemini API.
409398 */
410399public class WebGroundingChunk (
411400 public val uri : String? ,
@@ -422,15 +411,13 @@ public class WebGroundingChunk(
422411 * Provides information about how a specific segment of the model's response is supported by the
423412 * retrieved grounding chunks.
424413 *
425- * When using this API, you are required to comply with the
426- * [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google
427- * Search".
428- *
429414 * @property segment Specifies the segment of the model's response content that this grounding
430415 * support pertains to.
431- * @property groundingChunkIndices A list of indices that refer to specific [GroundingChunk] objects
416+ * @property groundingChunkIndices A list of indices that refer to specific [GroundingChunk] classes
432417 * within the [GroundingMetadata.groundingChunks] array. These referenced chunks are the sources
433- * that support the claim made in the associated `segment` of the response.
418+ * that support the claim made in the associated `segment` of the response. For example, an array
419+ * `[1, 3, 4]` means that `groundingChunks[1]`, `groundingChunks[3]`, `groundingChunks[4]` are the
420+ * retrieved content supporting this part of the response.
434421 */
435422public class GroundingSupport (
436423 public val segment : Segment ,
@@ -473,13 +460,15 @@ public class GroundingAttribution(
473460 * Represents a specific segment within a [Content] object, often used to pinpoint the exact
474461 * location of text or data that grounding information refers to.
475462 *
476- * @property startIndex The zero-based start index of the segment within the specified [Part],
477- * measured in UTF-8 bytes. This offset is inclusive.
478- * @property endIndex The zero-based end index of the segment within the specified [Part], measured
479- * in UTF-8 bytes. This offset is exclusive.
480463 * @property partIndex The zero-based index of the [Part] object within the `parts` array of its
481464 * parent [Content] object. This identifies which part of the content the segment belongs to.
482- * @property text The text content of the segment.
465+ * @property startIndex The zero-based start index of the segment within the specified [Part],
466+ * measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the beginning of the part's
467+ * content.
468+ * @property endIndex The zero-based end index of the segment within the specified [Part], measured
469+ * in UTF-8 bytes. This offset is exclusive, meaning the character at this index is not included in
470+ * the segment.
471+ * @property text The text corresponding to the segment from the response.
483472 */
484473public class Segment (
485474 public val startIndex : Int ,
0 commit comments