Class GroundingMetadata

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.GroundingMetadata

public abstract class GroundingMetadata extends JsonSerializable
Metadata returned to client when grounding is enabled.
  • Constructor Details

    • GroundingMetadata

      public GroundingMetadata()
  • Method Details

    • googleMapsWidgetContextToken

      public abstract Optional<String> googleMapsWidgetContextToken()
      Optional. Output only. Resource name of the Google Maps widget context token to be used with the PlacesContextElement widget to render contextual data. This is populated only for Google Maps grounding.
    • groundingChunks

      public abstract Optional<List<GroundingChunk>> groundingChunks()
      List of supporting references retrieved from specified grounding source.
    • groundingSupports

      public abstract Optional<List<GroundingSupport>> groundingSupports()
      Optional. List of grounding support.
    • retrievalMetadata

      public abstract Optional<RetrievalMetadata> retrievalMetadata()
      Optional. Output only. Retrieval metadata.
    • retrievalQueries

      public abstract Optional<List<String>> retrievalQueries()
      Optional. Queries executed by the retrieval tools.
    • searchEntryPoint

      public abstract Optional<SearchEntryPoint> searchEntryPoint()
      Optional. Google search entry for the following-up web searches.
    • webSearchQueries

      public abstract Optional<List<String>> webSearchQueries()
      Optional. Web search queries for the following-up web search.
    • builder

      public static GroundingMetadata.Builder builder()
      Instantiates a builder for GroundingMetadata.
    • toBuilder

      public abstract GroundingMetadata.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static GroundingMetadata fromJson(String jsonString)
      Deserializes a JSON string to a GroundingMetadata object.