Class GroundingMetadata.Builder

java.lang.Object
com.google.genai.types.GroundingMetadata.Builder
Enclosing class:
GroundingMetadata

public abstract static class GroundingMetadata.Builder extends Object
Builder for GroundingMetadata.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • imageSearchQueries

      public abstract GroundingMetadata.Builder imageSearchQueries(List<String> imageSearchQueries)
      Setter for imageSearchQueries.

      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.

    • imageSearchQueries

      @CanIgnoreReturnValue public GroundingMetadata.Builder imageSearchQueries(String... imageSearchQueries)
      Setter for imageSearchQueries.

      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.

    • clearImageSearchQueries

      @CanIgnoreReturnValue public GroundingMetadata.Builder clearImageSearchQueries()
      Clears the value of imageSearchQueries field.
    • groundingChunks

      public abstract GroundingMetadata.Builder groundingChunks(List<GroundingChunk> groundingChunks)
      Setter for groundingChunks.

      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.

    • groundingChunks

      @CanIgnoreReturnValue public GroundingMetadata.Builder groundingChunks(GroundingChunk... groundingChunks)
      Setter for groundingChunks.

      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.

    • groundingChunks

      @CanIgnoreReturnValue public GroundingMetadata.Builder groundingChunks(GroundingChunk.Builder... groundingChunksBuilders)
      Setter for groundingChunks builder.

      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.

    • clearGroundingChunks

      @CanIgnoreReturnValue public GroundingMetadata.Builder clearGroundingChunks()
      Clears the value of groundingChunks field.
    • groundingSupports

      public abstract GroundingMetadata.Builder groundingSupports(List<GroundingSupport> groundingSupports)
      Setter for groundingSupports.

      groundingSupports: List of grounding support.

    • groundingSupports

      @CanIgnoreReturnValue public GroundingMetadata.Builder groundingSupports(GroundingSupport... groundingSupports)
      Setter for groundingSupports.

      groundingSupports: List of grounding support.

    • groundingSupports

      @CanIgnoreReturnValue public GroundingMetadata.Builder groundingSupports(GroundingSupport.Builder... groundingSupportsBuilders)
      Setter for groundingSupports builder.

      groundingSupports: List of grounding support.

    • clearGroundingSupports

      @CanIgnoreReturnValue public GroundingMetadata.Builder clearGroundingSupports()
      Clears the value of groundingSupports field.
    • retrievalMetadata

      public abstract GroundingMetadata.Builder retrievalMetadata(RetrievalMetadata retrievalMetadata)
      Setter for retrievalMetadata.

      retrievalMetadata: Metadata related to retrieval in the grounding flow.

    • retrievalMetadata

      @CanIgnoreReturnValue public GroundingMetadata.Builder retrievalMetadata(RetrievalMetadata.Builder retrievalMetadataBuilder)
      Setter for retrievalMetadata builder.

      retrievalMetadata: Metadata related to retrieval in the grounding flow.

    • clearRetrievalMetadata

      @CanIgnoreReturnValue public GroundingMetadata.Builder clearRetrievalMetadata()
      Clears the value of retrievalMetadata field.
    • searchEntryPoint

      public abstract GroundingMetadata.Builder searchEntryPoint(SearchEntryPoint searchEntryPoint)
      Setter for searchEntryPoint.

      searchEntryPoint: Optional. Google search entry for the following-up web searches.

    • searchEntryPoint

      @CanIgnoreReturnValue public GroundingMetadata.Builder searchEntryPoint(SearchEntryPoint.Builder searchEntryPointBuilder)
      Setter for searchEntryPoint builder.

      searchEntryPoint: Optional. Google search entry for the following-up web searches.

    • clearSearchEntryPoint

      @CanIgnoreReturnValue public GroundingMetadata.Builder clearSearchEntryPoint()
      Clears the value of searchEntryPoint field.
    • webSearchQueries

      public abstract GroundingMetadata.Builder webSearchQueries(List<String> webSearchQueries)
      Setter for webSearchQueries.

      webSearchQueries: Web search queries for the following-up web search.

    • webSearchQueries

      @CanIgnoreReturnValue public GroundingMetadata.Builder webSearchQueries(String... webSearchQueries)
      Setter for webSearchQueries.

      webSearchQueries: Web search queries for the following-up web search.

    • clearWebSearchQueries

      @CanIgnoreReturnValue public GroundingMetadata.Builder clearWebSearchQueries()
      Clears the value of webSearchQueries field.
    • googleMapsWidgetContextToken

      public abstract GroundingMetadata.Builder googleMapsWidgetContextToken(String googleMapsWidgetContextToken)
      Setter for googleMapsWidgetContextToken.

      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.

    • clearGoogleMapsWidgetContextToken

      @CanIgnoreReturnValue public GroundingMetadata.Builder clearGoogleMapsWidgetContextToken()
      Clears the value of googleMapsWidgetContextToken field.
    • retrievalQueries

      public abstract GroundingMetadata.Builder retrievalQueries(List<String> retrievalQueries)
      Setter for retrievalQueries.

      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.

    • retrievalQueries

      @CanIgnoreReturnValue public GroundingMetadata.Builder retrievalQueries(String... retrievalQueries)
      Setter for retrievalQueries.

      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.

    • clearRetrievalQueries

      @CanIgnoreReturnValue public GroundingMetadata.Builder clearRetrievalQueries()
      Clears the value of retrievalQueries field.
    • sourceFlaggingUris

      public abstract GroundingMetadata.Builder sourceFlaggingUris(List<GroundingMetadataSourceFlaggingUri> sourceFlaggingUris)
      Setter for sourceFlaggingUris.

      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.

    • sourceFlaggingUris

      @CanIgnoreReturnValue public GroundingMetadata.Builder sourceFlaggingUris(GroundingMetadataSourceFlaggingUri... sourceFlaggingUris)
      Setter for sourceFlaggingUris.

      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.

    • sourceFlaggingUris

      @CanIgnoreReturnValue public GroundingMetadata.Builder sourceFlaggingUris(GroundingMetadataSourceFlaggingUri.Builder... sourceFlaggingUrisBuilders)
      Setter for sourceFlaggingUris builder.

      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.

    • clearSourceFlaggingUris

      @CanIgnoreReturnValue public GroundingMetadata.Builder clearSourceFlaggingUris()
      Clears the value of sourceFlaggingUris field.
    • build

      public abstract GroundingMetadata build()