Class GroundingSupport.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • confidenceScores

      public abstract GroundingSupport.Builder confidenceScores(List<Float> confidenceScores)
      Setter for confidenceScores.

      confidenceScores: Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. For Gemini 2.0 and before, this list must have the same size as the grounding_chunk_indices. For Gemini 2.5 and after, this list will be empty and should be ignored.

    • confidenceScores

      public GroundingSupport.Builder confidenceScores(Float... confidenceScores)
      Setter for confidenceScores.

      confidenceScores: Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. For Gemini 2.0 and before, this list must have the same size as the grounding_chunk_indices. For Gemini 2.5 and after, this list will be empty and should be ignored.

    • groundingChunkIndices

      public abstract GroundingSupport.Builder groundingChunkIndices(List<Integer> groundingChunkIndices)
      Setter for groundingChunkIndices.

      groundingChunkIndices: A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.

    • groundingChunkIndices

      public GroundingSupport.Builder groundingChunkIndices(Integer... groundingChunkIndices)
      Setter for groundingChunkIndices.

      groundingChunkIndices: A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.

    • segment

      public abstract GroundingSupport.Builder segment(Segment segment)
      Setter for segment.

      segment: Segment of the content this support belongs to.

    • segment

      public GroundingSupport.Builder segment(Segment.Builder segmentBuilder)
      Setter for segment builder.

      segment: Segment of the content this support belongs to.

    • build

      public abstract GroundingSupport build()