Information about the sources that support the content of a response.
When grounding is enabled, the model returns citations for claims in the response. This object contains the retrieved sources.
webSearchQueries[]string
Optional. The web search queries that were used to generate the content. This field is populated only when the grounding source is Google Search.
retrievalQueries[]string
Optional. The queries that were executed by the retrieval tools. This field is populated only when the grounding source is a retrieval tool, such as Vertex AI Search.
A list of supporting references retrieved from the grounding source. This field is populated when the grounding source is Google Search, Vertex AI Search, or Google Maps.
Optional. A list of grounding supports that connect the generated content to the grounding chunks. This field is populated when the grounding source is Google Search or Vertex AI Search.
Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps.
Optional. A web search entry point that can be used to display search results. This field is populated only when the grounding source is Google Search.
Optional. Output only. metadata related to the retrieval grounding source.
googleMapsWidgetContextTokenstring
Optional. Output only. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps.
| JSON representation |
|---|
{ "webSearchQueries": [ string ], "retrievalQueries": [ string ], "groundingChunks": [ { object ( |
SearchEntryPoint
An entry point for displaying Google Search results.
A SearchEntryPoint is populated when the grounding source for a model's response is Google Search. It provides information that you can use to display the search results in your application.
renderedContentstring
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.
Optional. A base64-encoded JSON object that contains a list of search queries and their corresponding search URLs. This information can be used to build a custom search UI.
A base64-encoded string.
| JSON representation |
|---|
{ "renderedContent": string, "sdkBlob": string } |
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. When grounding is enabled, the model returns a GroundingChunk that contains a reference to the source of the information.
chunk_typeUnion type
chunk_type can be only one of the following:A grounding chunk from a web page, typically from Google Search. See the Web message for details.
A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the RetrievedContext message for details
A grounding chunk from Google Maps. See the Maps message for details.
| JSON representation |
|---|
{ // chunk_type "web": { object ( |
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.
uristring
The URI of the web page that contains the evidence.
titlestring
The title of the web page that contains the evidence.
domainstring
The domain of the web page that contains the evidence. This can be used to filter out low-quality sources.
| JSON representation |
|---|
{ "uri": string, "title": string, "domain": string } |
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.
context_detailsUnion type
context_details can be only one of the following:Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used.
uristring
The URI of the retrieved data source.
titlestring
The title of the retrieved data source.
textstring
The content of the retrieved data source.
documentNamestring
Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}/documents/{document}.
| JSON representation |
|---|
{
// context_details
"ragChunk": {
object ( |
Maps
A Maps chunk is a piece of evidence that comes from Google Maps. It contains information about a place, such as its name, address, and reviews. This is used to provide the user with rich, location-based information.
The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content.
uristring
The URI of the place.
titlestring
The title of the place.
textstring
The text of the place answer.
placeIdstring
This Place's resource name, in places/{placeId} format. This can be used to look up the place in the Google Maps API.
| JSON representation |
|---|
{
"placeAnswerSources": {
object ( |
PlaceAnswerSources
The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content.
Snippets of reviews that were used to generate the answer.
| JSON representation |
|---|
{
"reviewSnippets": [
{
object ( |
ReviewSnippet
A review snippet that is used to generate the answer.
reviewIdstring
The id of the review that is being referenced.
googleMapsUristring
A link to show the review on Google Maps.
titlestring
The title of the review.
| JSON representation |
|---|
{ "reviewId": string, "googleMapsUri": string, "title": string } |
GroundingSupport
A collection of supporting references for a segment of the model's response.
groundingChunkIndices[]integer
A list of indices into the groundingChunks field of the GroundingMetadata message. These indices specify which grounding chunks support the claim made in the content segment.
For example, if this field has the values [1, 3], it means that groundingChunks[1] and groundingChunks[3] are the sources for the claim in the content segment.
confidenceScores[]number
The confidence scores for the support references. This list is parallel to the groundingChunkIndices list. A score is a value between 0.0 and 1.0, with a higher score indicating a higher confidence that the reference supports the claim.
For Gemini 2.0 and before, this list has the same size as groundingChunkIndices. For Gemini 2.5 and later, this list is empty and should be ignored.
The content segment that this support message applies to.
| JSON representation |
|---|
{
"groundingChunkIndices": [
integer
],
"confidenceScores": [
number
],
"segment": {
object ( |
Segment
A segment of the content.
partIndexinteger
Output only. The index of the Part object that this segment belongs to. This is useful for associating the segment with a specific part of the content.
startIndexinteger
Output only. The start index of the segment in the Part, 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.
endIndexinteger
Output only. The end index of the segment in the Part, 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.
textstring
Output only. The text of the segment.
| JSON representation |
|---|
{ "partIndex": integer, "startIndex": integer, "endIndex": integer, "text": string } |
RetrievalMetadata
metadata related to the retrieval grounding source. This is part of the GroundingMetadata returned when grounding is enabled.
googleSearchDynamicRetrievalScorenumber
Optional. A score indicating how likely it is that a Google Search query could help answer the prompt. The score is in the range of [0, 1]. A score of 1 means the model is confident that a search will be helpful, and 0 means it is not. This score is populated only when Google Search grounding and dynamic retrieval are enabled. The score is used to determine whether to trigger a search.
| JSON representation |
|---|
{ "googleSearchDynamicRetrievalScore": number } |
SourceFlaggingUri
A URI that can be used to flag a place or review for inappropriate content. This is populated only when the grounding source is Google Maps.
sourceIdstring
The id of the place or review.
flagContentUristring
The URI that can be used to flag the content.
| JSON representation |
|---|
{ "sourceId": string, "flagContentUri": string } |