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.
  • 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.