GroundingMetadata

classGroundingMetadata


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 Vertex AI Gemini API (seeService Terms section within the Service Specific Terms).

Summary

Public constructors

GroundingMetadata(
    webSearchQueries: List<String>,
    searchEntryPoint: SearchEntryPoint?,
    retrievalQueries: List<String>,
    groundingAttribution: List<GroundingAttribution>,
    groundingChunks: List<GroundingChunk>,
    groundingSupports: List<GroundingSupport>
)

Public properties

List<GroundingAttribution>

This property is deprecated. Use groundingChunks instead

List<GroundingChunk>

The list ofGroundingChunk classes.

List<GroundingSupport>

The list ofGroundingSupport 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 constructors

GroundingMetadata

GroundingMetadata(
    webSearchQueries: List<String>,
    searchEntryPoint: SearchEntryPoint?,
    retrievalQueries: List<String>,
    groundingAttribution: List<GroundingAttribution>,
    groundingChunks: List<GroundingChunk>,
    groundingSupports: List<GroundingSupport>
)

Public properties

groundingChunks

val groundingChunksList<GroundingChunk>

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

groundingSupports

val groundingSupportsList<GroundingSupport>

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

retrievalQueries

val retrievalQueriesList<String>

searchEntryPoint

val searchEntryPointSearchEntryPoint?

Google Search entry point for web searches. This contains an HTML/CSS snippet thatmust 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 webSearchQueriesList<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.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-09 UTC.