Package com.google.genai.types
Class RetrievalMetadata
-
- All Implemented Interfaces:
public abstract class RetrievalMetadata extends JsonSerializable
Metadata returned to client when grounding is enabled.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classRetrievalMetadata.BuilderBuilder for RetrievalMetadata.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description RetrievalMetadata()
-
Method Summary
Modifier and Type Method Description abstract Optional<Float>googleSearchDynamicRetrievalScore()Optional. static RetrievalMetadata.Builderbuilder()Instantiates a builder for RetrievalMetadata. abstract RetrievalMetadata.BuildertoBuilder()Creates a builder with the same values as this instance. static RetrievalMetadatafromJson(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
-
-
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.
-
builder
static RetrievalMetadata.Builder builder()
Instantiates a builder for RetrievalMetadata.
-
toBuilder
abstract RetrievalMetadata.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static RetrievalMetadata fromJson(String jsonString)
Deserializes a JSON string to a RetrievalMetadata object.
-
-
-
-