Class LiveRequest
java.lang.Object
com.google.adk.JsonBaseModel
com.google.adk.agents.LiveRequest
Represents a request to be sent to a live connection to the LLM model.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionabstract Optional<com.google.genai.types.Blob> blob()Returns the blob of the request.static LiveRequest.Builderbuilder()close()Returns whether the connection should be closed.abstract Optional<com.google.genai.types.Content> content()Returns the content of the request.static LiveRequestfromJsonString(String json) Deserializes a Json string to aLiveRequestobject.booleanExtracts boolean value from the partial field or returns false if unset.partial()Returns whethercontent()is a partial update that leaves the current turn open.booleanExtracts boolean value from the close field or returns false if unset.abstract LiveRequest.BuilderMethods inherited from class JsonBaseModel
fromJsonNode, fromJsonString, getMapper, toJson, toJsonNode, toJsonStringModifier and TypeMethodDescriptionstatic <T extends JsonBaseModel>
TfromJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode, Class<T> clazz) Deserializes a JsonNode to an object of the given type.static <T extends JsonBaseModel>
TfromJsonString(String jsonString, Class<T> clazz) Deserializes a Json string to an object of the given type.static com.fasterxml.jackson.databind.ObjectMapperReturns the mutable ObjectMapper instance used by ADK.toJson()Serializes this object (i.e., the ObjectMappper instance used by ADK) to a Json string.protected static com.fasterxml.jackson.databind.JsonNodetoJsonNode(Object object) Serializes an object to a JsonNode.static StringtoJsonString(Object object) Serializes an object to a Json string.
-
Method Details
-
content
Returns the content of the request.If set, send the content to the model in turn-by-turn mode.
- Returns:
- An optional
Contentobject containing the content of the request.
-
partial
-
isPartial
public boolean isPartial()Extracts boolean value from the partial field or returns false if unset. -
blob
Returns the blob of the request.If set, send the blob to the model in realtime mode.
- Returns:
- An optional
Blobobject containing the blob of the request.
-
close
-
shouldClose
public boolean shouldClose()Extracts boolean value from the close field or returns false if unset. -
builder
-
toBuilder
-
fromJsonString
Deserializes a Json string to aLiveRequestobject.
-