Class RetrievalMetadata

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public abstract class RetrievalMetadata.Builder

      Builder for RetrievalMetadata.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Optional<Float> googleSearchDynamicRetrievalScore() Optional.
      static RetrievalMetadata.Builder builder() Instantiates a builder for RetrievalMetadata.
      abstract RetrievalMetadata.Builder toBuilder() Creates a builder with the same values as this instance.
      static RetrievalMetadata fromJson(String jsonString) Deserializes a JSON string to a RetrievalMetadata object.
      • Methods inherited from class com.google.genai.JsonSerializable

        fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RetrievalMetadata

        RetrievalMetadata()
    • Method Detail

      • googleSearchDynamicRetrievalScore

         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.