Table of Contents

Class GroundingMetadata

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Information for various kinds of grounding.

public record GroundingMetadata : IEquatable<GroundingMetadata>
Inheritance
GroundingMetadata
Implements
Inherited Members

Properties

GoogleMapsWidgetContextToken

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.

[JsonPropertyName("googleMapsWidgetContextToken")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? GoogleMapsWidgetContextToken { get; set; }

Property Value

string

GroundingChunks

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.

[JsonPropertyName("groundingChunks")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<GroundingChunk>? GroundingChunks { get; set; }

Property Value

List<GroundingChunk>

GroundingSupports

List of grounding support.

[JsonPropertyName("groundingSupports")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<GroundingSupport>? GroundingSupports { get; set; }

Property Value

List<GroundingSupport>

ImageSearchQueries

Optional. The image search queries that were used to generate the content. This field is populated only when the grounding source is Google Search with the Image Search search_type enabled.

[JsonPropertyName("imageSearchQueries")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? ImageSearchQueries { get; set; }

Property Value

List<string>

RetrievalMetadata

Metadata related to retrieval in the grounding flow.

[JsonPropertyName("retrievalMetadata")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public RetrievalMetadata? RetrievalMetadata { get; set; }

Property Value

RetrievalMetadata

RetrievalQueries

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. This field is not supported in Gemini API.

[JsonPropertyName("retrievalQueries")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? RetrievalQueries { get; set; }

Property Value

List<string>

SearchEntryPoint

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

[JsonPropertyName("searchEntryPoint")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SearchEntryPoint? SearchEntryPoint { get; set; }

Property Value

SearchEntryPoint

SourceFlaggingUris

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. This field is not supported in Gemini API.

[JsonPropertyName("sourceFlaggingUris")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<GroundingMetadataSourceFlaggingUri>? SourceFlaggingUris { get; set; }

Property Value

List<GroundingMetadataSourceFlaggingUri>

WebSearchQueries

Web search queries for the following-up web search.

[JsonPropertyName("webSearchQueries")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? WebSearchQueries { get; set; }

Property Value

List<string>

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a GroundingMetadata object.

public static GroundingMetadata? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

GroundingMetadata

The deserialized GroundingMetadata object, or null if deserialization fails.