GroundingMetadata

Grounding metadata contains sources, citations, and search entry points used to ground a generated answer or suggestion.

JSON representation
{
  "webSearchQueries": [
    string
  ],
  "searchEntryPoint": {
    object (SearchEntryPoint)
  },
  "groundingChunks": [
    {
      object (GroundingChunk)
    }
  ],
  "groundingSupports": [
    {
      object (GroundingSupport)
    }
  ]
}
Fields
webSearchQueries[]

string

Optional. The web search queries that were used to generate the content.

searchEntryPoint

object (SearchEntryPoint)

Optional. A web search entry point that can be used to display search results.

groundingChunks[]

object (GroundingChunk)

Optional. A list of supporting references retrieved from the grounding source.

groundingSupports[]

object (GroundingSupport)

Optional. A list of grounding supports that connect the generated content to the grounding chunks.

SearchEntryPoint

A web search entry point that can be used to display search results.

JSON representation
{
  "renderedContent": string
}
Fields
renderedContent

string

Optional. An HTML snippet that can be embedded in a web page or an application's webview. This snippet displays a search result, including the title, URL, and a brief description of the search result.

GroundingChunk

A piece of evidence that supports a claim made by the model.

This is used to show a citation for a claim made by the model. It contains a reference to the source of the information.

JSON representation
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "web": {
    object (Web)
  },
  "retrievedContext": {
    object (RetrievedContext)
  }
  // End of mutually exclusive fields.
}
Fields
The source of the grounding chunk. Currently we only support web search. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
web

object (Web)

Optional. A grounding chunk from a web page, typically from web search. See the Web message for details.

retrievedContext

object (RetrievedContext)

Optional. A grounding chunk from a data source retrieved by a data store tool.

End of mutually exclusive fields.

Web

A Web chunk is a piece of evidence that comes from a web page. It contains the URI of the web page, the title of the page, and the domain of the page. This is used to provide the user with a link to the source of the information.

JSON representation
{
  "uri": string,
  "title": string,
  "domain": string
}
Fields
uri

string

Output only. The URI of the web page that contains the evidence.

title

string

Output only. The title of the web page that contains the evidence.

domain

string

Output only. The domain of the web page that contains the evidence. This can be used to filter out low-quality sources.

RetrievedContext

Context retrieved from a data source to ground the model's response. This is used when a retrieval tool fetches information from a user-provided corpus or a public dataset.

JSON representation
{
  "uri": string,
  "title": string,
  "text": string
}
Fields
uri

string

Output only. The URI of the retrieved data source.

title

string

Output only. The title of the retrieved data source.

text

string

Output only. The content of the retrieved data source.

GroundingSupport

A collection of supporting references for a segment or part of the model's response.

JSON representation
{
  "segment": {
    object (Segment)
  },
  "groundingChunkIndices": [
    integer
  ]
}
Fields
segment

object (Segment)

Optional. Segment of the content this support belongs to.

groundingChunkIndices[]

integer

Optional. A list of indices into groundingChunks field specifying the citations associated with the claim. For instance [1, 3] means that groundingChunks[1] and groundingChunks[3] are the retrieved contents attributed to the claim.

Segment

A segment of the content.

JSON representation
{
  "startIndex": integer,
  "endIndex": integer,
  "text": string
}
Fields
startIndex

integer

Output only. The start index of the segment, measured in bytes. This marks the beginning of the segment and is inclusive, meaning the byte at this index is the first byte of the segment.

endIndex

integer

Output only. The end index of the segment, measured in bytes. This marks the end of the segment and is exclusive, meaning the segment includes content up to, but not including, the byte at this index.

text

string

Output only. The text of the segment.