Class GroundingMetadata

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

public abstract class GroundingMetadata extends JsonSerializable
None
  • 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.
    • 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. This field is not supported in Gemini API.
    • 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. This field is not supported in Gemini API.
    • searchEntryPoint

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

      public abstract Optional<List<GroundingMetadataSourceFlaggingUri>> sourceFlaggingUris()
      Optional. Output only. List of source flagging uris. This is currently populated only for Google Maps grounding. This field is not supported in Gemini API.
    • 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.