Skip to content

GroundingMetadata.Chunks is empty even when GroundingSearchesUsed is > 0 #230

@eezdev

Description

@eezdev

Hi all,
There is a critical issue where GroundingMetadata.Chunks returns an empty list despite the model successfully performing web searches. While SearchEntryPoint contains valid HTML/chips and the model text contains citations, the programmatically accessible metadata required for verification is missing.

Technical Details:

Package: Google.GenAI

Models Tested: gemini-3-flash-preview, gemini-3-1

Feature: GoogleSearch

Observed Behavior:

Search Execution: GroundingMetadata.GroundingSearchesUsed reports a positive integer (e.g., 10 or 15), proving the tool was triggered.

Visual Grounding: The SearchEntryPoint.RenderedContent is correctly populated with HTML source chips and links.

Missing Data: GroundingMetadata.Chunks is empty (Count = 0).

Broken References: GroundingMetadata.Supports may contain GroundingChunkIndices, but since the Chunks list is empty, these indices point to non-existent data, making it impossible to map segments to URIs.

Impact:

Without the Chunks list, it is impossible to programmatically verify the provenance of the AI's claims or distinguish between a grounded citation and a text-hallucinated URL. This prevents the implementation of automated QA filters.

Example Response Snippet (Logs):

FinishReason: STOP Grounding searches used: 15 GroundingChunks: [] <-- Should contain URIs and Titles GroundingSupports: [indices pointing to non-existent chunks]

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions