Class GroundingChunk
-
- All Implemented Interfaces:
public abstract class GroundingChunk extends JsonSerializable
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classGroundingChunk.BuilderBuilder for GroundingChunk.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description GroundingChunk()
-
Method Summary
Modifier and Type Method Description abstract Optional<GroundingChunkImage>image()A grounding chunk from an image search result. abstract Optional<GroundingChunkMaps>maps()A `Maps` chunk is a piece of evidence that comes from Google Maps. abstract Optional<GroundingChunkRetrievedContext>retrievedContext()A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. abstract Optional<GroundingChunkWeb>web()A grounding chunk from a web page, typically from Google Search. static GroundingChunk.Builderbuilder()Instantiates a builder for GroundingChunk. abstract GroundingChunk.BuildertoBuilder()Creates a builder with the same values as this instance. static GroundingChunkfromJson(String jsonString)Deserializes a JSON string to a GroundingChunk object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
image
abstract Optional<GroundingChunkImage> image()
A grounding chunk from an image search result. See the `Image` message for details.
-
maps
abstract Optional<GroundingChunkMaps> 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.
-
retrievedContext
abstract Optional<GroundingChunkRetrievedContext> retrievedContext()
A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details
-
web
abstract Optional<GroundingChunkWeb> web()
A grounding chunk from a web page, typically from Google Search. See the `Web` message for details.
-
builder
static GroundingChunk.Builder builder()
Instantiates a builder for GroundingChunk.
-
toBuilder
abstract GroundingChunk.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static GroundingChunk fromJson(String jsonString)
Deserializes a JSON string to a GroundingChunk object.
-
-
-
-