Class GroundingChunk.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • image

      public abstract GroundingChunk.Builder image(GroundingChunkImage image)
      Setter for image.

      image: A grounding chunk from an image search result. See the `Image` message for details.

    • image

      @CanIgnoreReturnValue public GroundingChunk.Builder image(GroundingChunkImage.Builder imageBuilder)
      Setter for image builder.

      image: A grounding chunk from an image search result. See the `Image` message for details.

    • clearImage

      @CanIgnoreReturnValue public GroundingChunk.Builder clearImage()
      Clears the value of image field.
    • maps

      public abstract GroundingChunk.Builder maps(GroundingChunkMaps maps)
      Setter for maps.

      maps: A `Maps` chunk is a piece of evidence that comes from Google Maps.

      It contains information about a place, such as its name, address, and reviews. This is used to provide the user with rich, location-based information.

    • maps

      @CanIgnoreReturnValue public GroundingChunk.Builder maps(GroundingChunkMaps.Builder mapsBuilder)
      Setter for maps builder.

      maps: A `Maps` chunk is a piece of evidence that comes from Google Maps.

      It contains information about a place, such as its name, address, and reviews. This is used to provide the user with rich, location-based information.

    • clearMaps

      @CanIgnoreReturnValue public GroundingChunk.Builder clearMaps()
      Clears the value of maps field.
    • retrievedContext

      public abstract GroundingChunk.Builder retrievedContext(GroundingChunkRetrievedContext retrievedContext)
      Setter for retrievedContext.

      retrievedContext: A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details. This field is not supported in Gemini API.

    • retrievedContext

      @CanIgnoreReturnValue public GroundingChunk.Builder retrievedContext(GroundingChunkRetrievedContext.Builder retrievedContextBuilder)
      Setter for retrievedContext builder.

      retrievedContext: A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details. This field is not supported in Gemini API.

    • clearRetrievedContext

      @CanIgnoreReturnValue public GroundingChunk.Builder clearRetrievedContext()
      Clears the value of retrievedContext field.
    • web

      public abstract GroundingChunk.Builder web(GroundingChunkWeb web)
      Setter for web.

      web: A grounding chunk from a web page, typically from Google Search. See the `Web` message for details.

    • web

      @CanIgnoreReturnValue public GroundingChunk.Builder web(GroundingChunkWeb.Builder webBuilder)
      Setter for web builder.

      web: A grounding chunk from a web page, typically from Google Search. See the `Web` message for details.

    • clearWeb

      @CanIgnoreReturnValue public GroundingChunk.Builder clearWeb()
      Clears the value of web field.
    • build

      public abstract GroundingChunk build()