GroundingMetadata

metadata returned to client when grounding is enabled.

Fields
webSearchQueries[] string

Optional. Web search queries for the following-up web search.

retrievalQueries[] string

Optional. Queries executed by the retrieval tools.

groundingChunks[] object (GroundingChunk)

List of supporting references retrieved from specified grounding source.

groundingSupports[] object (GroundingSupport)

Optional. List of grounding support.

searchEntryPoint object (SearchEntryPoint)

Optional. Google search entry for the following-up web searches.

retrievalMetadata object (RetrievalMetadata)

Optional. Output only. Retrieval metadata.

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

SearchEntryPoint

Google search entry point.

Fields
renderedContent string

Optional. Web content snippet that can be embedded in a web page or an app webview.

sdkBlob string (bytes format)

Optional. Base64 encoded JSON representing array of <search term, search url> tuple.

A base64-encoded string.

JSON representation
{
  "renderedContent": string,
  "sdkBlob": string
}

GroundingChunk

Grounding chunk.

Fields
chunk_type Union type
Chunk type. chunk_type can be only one of the following:
web object (Web)

Grounding chunk from the web.

retrievedContext object (RetrievedContext)

Grounding chunk from context retrieved by the retrieval tools.

JSON representation
{

  // chunk_type
  "web": {
    object (Web)
  },
  "retrievedContext": {
    object (RetrievedContext)
  }
  // Union type
}

Web

Chunk from the web.

Fields
uri string

URI reference of the chunk.

title string

title of the chunk.

domain string

domain of the (original) URI.

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

RetrievedContext

Chunk from context retrieved by the retrieval tools.

Fields
context_details Union type
Tool-specific details about the retrieved context. context_details can be only one of the following:
ragChunk object (RagChunk)

Additional context for the RAG retrieval result. This is only populated when using the RAG retrieval tool.

uri string

URI reference of the attribution.

title string

title of the attribution.

text string

Text of the attribution.

JSON representation
{

  // context_details
  "ragChunk": {
    object (RagChunk)
  }
  // Union type
  "uri": string,
  "title": string,
  "text": string
}

GroundingSupport

Grounding support.

Fields
groundingChunkIndices[] integer

A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.

confidenceScores[] number

confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the groundingChunkIndices.

segment object (Segment)

Segment of the content this support belongs to.

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

Segment

Segment of the content.

Fields
partIndex integer

Output only. The index of a Part object within its parent Content object.

startIndex integer

Output only. Start index in the given Part, measured in bytes. offset from the start of the Part, inclusive, starting at zero.

endIndex integer

Output only. End index in the given Part, measured in bytes. offset from the start of the Part, exclusive, starting at zero.

text string

Output only. The text corresponding to the segment from the response.

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

RetrievalMetadata

metadata related to retrieval in the grounding flow.

Fields
googleSearchDynamicRetrievalScore number

Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search.

JSON representation
{
  "googleSearchDynamicRetrievalScore": number
}