Class RetrievalMetadata

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

public abstract class RetrievalMetadata extends JsonSerializable
Metadata related to retrieval in the grounding flow.
  • Constructor Details

    • RetrievalMetadata

      public RetrievalMetadata()
  • Method Details

    • googleSearchDynamicRetrievalScore

      public abstract Optional<Float> googleSearchDynamicRetrievalScore()
      Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range `[0, 1]`, where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search.
    • builder

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

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

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