GroundingMetadata

class GroundingMetadata


Metadata returned to the client when grounding is enabled.

If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: Gemini Developer API or Agent Platform Gemini API (see Service Terms section within the Service Specific Terms).

If using Grounding with Google Maps, you are required to comply with the "Grounding with Google Maps" usage requirements for your chosen API provider: Gemini Developer API or Agent Platform Gemini API (see Service Terms section within the Service Specific Terms).

Summary

Public properties

List<GroundingChunk>

The list of GroundingChunk classes.

List<GroundingSupport>

The list of GroundingSupport objects.

List<String>
SearchEntryPoint?

Google Search entry point for web searches.

List<String>

The list of web search queries that the model performed to gather the grounding information.

Public properties

groundingChunks

val groundingChunks: List<GroundingChunk>

The list of GroundingChunk classes. Each chunk represents a piece of retrieved content that the model used to ground its response.

groundingSupports

val groundingSupports: List<GroundingSupport>

The list of GroundingSupport objects. Each object details how specific segments of the model's response are supported by the groundingChunks.

retrievalQueries

val retrievalQueries: List<String>

searchEntryPoint

val searchEntryPoint: SearchEntryPoint?

Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search Entry point for follow-up web searches related to the model's "Grounded Response".

webSearchQueries

val webSearchQueries: List<String>

The list of web search queries that the model performed to gather the grounding information. These can be used to allow users to explore the search results themselves.