Class GroundingSupport

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

public abstract class GroundingSupport extends JsonSerializable
Grounding support.
  • Constructor Details

    • GroundingSupport

      public GroundingSupport()
  • Method Details

    • confidenceScores

      public abstract Optional<List<Float>> 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 Optional<List<Integer>> 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 Optional<Segment> segment()
      Segment of the content this support belongs to.
    • builder

      public static GroundingSupport.Builder builder()
      Instantiates a builder for GroundingSupport.
    • toBuilder

      public abstract GroundingSupport.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static GroundingSupport fromJson(String jsonString)
      Deserializes a JSON string to a GroundingSupport object.