# Class LiveRequest

java.lang.Object
com.google.adk.JsonBaseModel
com.google.adk.agents.LiveRequest

public abstract class LiveRequest extends JsonBaseModel
Represents a request to be sent to a live connection to the LLM model.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `LiveRequest.Builder`
  Builder for constructing `LiveRequest` instances.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract Optional<com.google.genai.types.Blob>`
  `blob()`
  Returns the blob of the request.
  `static LiveRequest.Builder`
  `builder()`
  `abstract Optional<Boolean>`
  `close()`
  Returns whether the connection should be closed.
  `abstract Optional<com.google.genai.types.Content>`
  `content()`
  Returns the content of the request.
  `static LiveRequest`
  `fromJsonString(String json)`
  Deserializes a Json string to a `LiveRequest` object.
  `boolean`
  `shouldClose()`
  Extracts boolean value from the close field or returns false if unset.
  `abstract LiveRequest.Builder`
  `toBuilder()`

  ### Methods inherited from class JsonBaseModel

  `fromJsonNode, fromJsonString, getMapper, toJson, toJsonNode, toJsonString`
  Modifier and Type
  Method
  Description
  `static <T extends JsonBaseModel>
  T`
  `fromJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode, Class<T> clazz)`
  Deserializes a JsonNode to an object of the given type.
  `static <T extends JsonBaseModel>
  T`
  `fromJsonString(String jsonString, Class<T> clazz)`
  Deserializes a Json string to an object of the given type.
  `static com.fasterxml.jackson.databind.ObjectMapper`
  `getMapper()`
  Returns the mutable ObjectMapper instance used by ADK.
  `String`
  `toJson()`
  Serializes this object (i.e., the ObjectMappper instance used by ADK) to a Json string.
  `protected static com.fasterxml.jackson.databind.JsonNode`
  `toJsonNode(Object object)`
  Serializes an object to a JsonNode.
  `static String`
  `toJsonString(Object object)`
  Serializes an object to a Json string.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### content

    public abstract Optional<com.google.genai.types.Content> content()
    Returns the content of the request.

    If set, send the content to the model in turn-by-turn mode.

    Returns:
      An optional `Content` object containing the content of the request.

  - ### blob

    public abstract Optional<com.google.genai.types.Blob> blob()
    Returns the blob of the request.

    If set, send the blob to the model in realtime mode.

    Returns:
      An optional `Blob` object containing the blob of the request.

  - ### close

    public abstract Optional<Boolean> close()
    Returns whether the connection should be closed.

    If set to true, the connection will be closed after the request is sent.

    Returns:
      A boolean indicating whether the connection should be closed.

  - ### shouldClose

    public boolean shouldClose()
    Extracts boolean value from the close field or returns false if unset.

  - ### builder

    public static LiveRequest.Builder builder()

  - ### toBuilder

    public abstract LiveRequest.Builder toBuilder()

  - ### fromJsonString

    public static LiveRequest fromJsonString(String json)
    Deserializes a Json string to a `LiveRequest` object.