Class LiveClientContent

  • All Implemented Interfaces:

    
    public abstract class LiveClientContent
    extends JsonSerializable
                        

    Incremental update of the current conversation delivered from the client.

    All the content here will unconditionally be appended to the conversation history and used as part of the prompt to the model to generate content.

    A message here will interrupt any current model generation.

    • Nested Class Summary

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

      Builder for LiveClientContent.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Optional<List<Content>> turns() The content appended to the current conversation with the model.
      abstract Optional<Boolean> turnComplete() If true, indicates that the server content generation should start with the currently accumulated prompt.
      static LiveClientContent.Builder builder() Instantiates a builder for LiveClientContent.
      abstract LiveClientContent.Builder toBuilder() Creates a builder with the same values as this instance.
      static LiveClientContent fromJson(String jsonString) Deserializes a JSON string to a LiveClientContent 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

      • LiveClientContent

        LiveClientContent()
    • Method Detail

      • turns

         abstract Optional<List<Content>> turns()

        The content appended to the current conversation with the model.

        For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history and latest request.

      • turnComplete

         abstract Optional<Boolean> turnComplete()

        If true, indicates that the server content generation should start with the currently accumulated prompt. Otherwise, the server will await additional messages before starting generation.