Class GroundingMetadata

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

public abstract class GroundingMetadata extends JsonSerializable
Information for various kinds of grounding.
  • Constructor Details

    • GroundingMetadata

      public GroundingMetadata()
  • Method Details

    • imageSearchQueries

      public 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

      public 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

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

      public abstract Optional<RetrievalMetadata> retrievalMetadata()
      Metadata related to retrieval in the grounding flow.
    • searchEntryPoint

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

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

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

      public 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

      public 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

      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.