Class RetrievalMetadata

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

public abstract class RetrievalMetadata extends JsonSerializable
Metadata related to the retrieval grounding source. This is part of the `GroundingMetadata` returned when grounding is enabled.
  • Constructor Details

    • RetrievalMetadata

      public RetrievalMetadata()
  • Method Details

    • googleSearchDynamicRetrievalScore

      public abstract Optional<Float> googleSearchDynamicRetrievalScore()
      Optional. A score indicating how likely it is that a Google Search query could help answer the prompt. The score is in the range of `[0, 1]`. A score of 1 means the model is confident that a search will be helpful, and 0 means it is not. This score is populated only when Google Search grounding and dynamic retrieval are enabled. The score is used to determine whether to trigger a 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.