Table of Contents

Class GroundingChunk

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

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.

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

Properties

Image

A grounding chunk from an image search result. See the Image message for details.

[JsonPropertyName("image")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GroundingChunkImage? Image { get; set; }

Property Value

GroundingChunkImage

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.

[JsonPropertyName("maps")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GroundingChunkMaps? Maps { get; set; }

Property Value

GroundingChunkMaps

RetrievedContext

A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the RetrievedContext message for details

[JsonPropertyName("retrievedContext")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GroundingChunkRetrievedContext? RetrievedContext { get; set; }

Property Value

GroundingChunkRetrievedContext

Web

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

[JsonPropertyName("web")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GroundingChunkWeb? Web { get; set; }

Property Value

GroundingChunkWeb

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a GroundingChunk object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

GroundingChunk

The deserialized GroundingChunk object, or null if deserialization fails.