Class GroundingMetadata
-
- All Implemented Interfaces:
public abstract class GroundingMetadata extends JsonSerializable
Information for various kinds of grounding.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classGroundingMetadata.BuilderBuilder for GroundingMetadata.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description GroundingMetadata()
-
Method Summary
Modifier and Type Method Description abstract Optional<List<String>>imageSearchQueries()Optional. abstract Optional<List<GroundingChunk>>groundingChunks()A list of supporting references retrieved from the grounding source. abstract Optional<List<GroundingSupport>>groundingSupports()List of grounding support. abstract Optional<RetrievalMetadata>retrievalMetadata()Metadata related to retrieval in the grounding flow. abstract Optional<SearchEntryPoint>searchEntryPoint()Optional. abstract Optional<List<String>>webSearchQueries()Web search queries for the following-up web search. abstract Optional<String>googleMapsWidgetContextToken()Optional. abstract Optional<List<String>>retrievalQueries()Optional. abstract Optional<List<GroundingMetadataSourceFlaggingUri>>sourceFlaggingUris()Optional. static GroundingMetadata.Builderbuilder()Instantiates a builder for GroundingMetadata. abstract GroundingMetadata.BuildertoBuilder()Creates a builder with the same values as this instance. static GroundingMetadatafromJson(String jsonString)Deserializes a JSON string to a GroundingMetadata 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
-
imageSearchQueries
abstract Optional<List<String>> 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.
-
groundingChunks
abstract Optional<List<GroundingChunk>> 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.
-
groundingSupports
abstract Optional<List<GroundingSupport>> groundingSupports()
List of grounding support.
-
retrievalMetadata
abstract Optional<RetrievalMetadata> retrievalMetadata()
Metadata related to retrieval in the grounding flow.
-
searchEntryPoint
abstract Optional<SearchEntryPoint> searchEntryPoint()
Optional. Google search entry for the following-up web searches.
-
webSearchQueries
abstract Optional<List<String>> webSearchQueries()
Web search queries for the following-up web search.
-
googleMapsWidgetContextToken
abstract Optional<String> 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.
-
retrievalQueries
abstract Optional<List<String>> 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.
-
sourceFlaggingUris
abstract Optional<List<GroundingMetadataSourceFlaggingUri>> 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.
-
builder
static GroundingMetadata.Builder builder()
Instantiates a builder for GroundingMetadata.
-
toBuilder
abstract GroundingMetadata.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static GroundingMetadata fromJson(String jsonString)
Deserializes a JSON string to a GroundingMetadata object.
-
-
-
-