Class LiveServerMessage.Builder

java.lang.Object
com.google.genai.types.LiveServerMessage.Builder
Enclosing class:
LiveServerMessage

public abstract static class LiveServerMessage.Builder extends Object
Builder for LiveServerMessage.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setupComplete

      public abstract LiveServerMessage.Builder setupComplete(LiveServerSetupComplete setupComplete)
      Setter for setupComplete.

      setupComplete: Sent in response to a `LiveClientSetup` message from the client.

    • setupComplete

      @CanIgnoreReturnValue public LiveServerMessage.Builder setupComplete(LiveServerSetupComplete.Builder setupCompleteBuilder)
      Setter for setupComplete builder.

      setupComplete: Sent in response to a `LiveClientSetup` message from the client.

    • clearSetupComplete

      @CanIgnoreReturnValue public LiveServerMessage.Builder clearSetupComplete()
      Clears the value of setupComplete field.
    • serverContent

      public abstract LiveServerMessage.Builder serverContent(LiveServerContent serverContent)
      Setter for serverContent.

      serverContent: Content generated by the model in response to client messages.

    • serverContent

      @CanIgnoreReturnValue public LiveServerMessage.Builder serverContent(LiveServerContent.Builder serverContentBuilder)
      Setter for serverContent builder.

      serverContent: Content generated by the model in response to client messages.

    • clearServerContent

      @CanIgnoreReturnValue public LiveServerMessage.Builder clearServerContent()
      Clears the value of serverContent field.
    • toolCall

      public abstract LiveServerMessage.Builder toolCall(LiveServerToolCall toolCall)
      Setter for toolCall.

      toolCall: Request for the client to execute the `function_calls` and return the responses with the matching `id`s.

    • toolCall

      @CanIgnoreReturnValue public LiveServerMessage.Builder toolCall(LiveServerToolCall.Builder toolCallBuilder)
      Setter for toolCall builder.

      toolCall: Request for the client to execute the `function_calls` and return the responses with the matching `id`s.

    • clearToolCall

      @CanIgnoreReturnValue public LiveServerMessage.Builder clearToolCall()
      Clears the value of toolCall field.
    • toolCallCancellation

      public abstract LiveServerMessage.Builder toolCallCancellation(LiveServerToolCallCancellation toolCallCancellation)
      Setter for toolCallCancellation.

      toolCallCancellation: Notification for the client that a previously issued `ToolCallMessage` with the specified `id`s should have been not executed and should be cancelled.

    • toolCallCancellation

      @CanIgnoreReturnValue public LiveServerMessage.Builder toolCallCancellation(LiveServerToolCallCancellation.Builder toolCallCancellationBuilder)
      Setter for toolCallCancellation builder.

      toolCallCancellation: Notification for the client that a previously issued `ToolCallMessage` with the specified `id`s should have been not executed and should be cancelled.

    • clearToolCallCancellation

      @CanIgnoreReturnValue public LiveServerMessage.Builder clearToolCallCancellation()
      Clears the value of toolCallCancellation field.
    • usageMetadata

      public abstract LiveServerMessage.Builder usageMetadata(UsageMetadata usageMetadata)
      Setter for usageMetadata.

      usageMetadata: Usage metadata about model response(s).

    • usageMetadata

      @CanIgnoreReturnValue public LiveServerMessage.Builder usageMetadata(UsageMetadata.Builder usageMetadataBuilder)
      Setter for usageMetadata builder.

      usageMetadata: Usage metadata about model response(s).

    • clearUsageMetadata

      @CanIgnoreReturnValue public LiveServerMessage.Builder clearUsageMetadata()
      Clears the value of usageMetadata field.
    • goAway

      public abstract LiveServerMessage.Builder goAway(LiveServerGoAway goAway)
      Setter for goAway.

      goAway: Server will disconnect soon.

    • goAway

      @CanIgnoreReturnValue public LiveServerMessage.Builder goAway(LiveServerGoAway.Builder goAwayBuilder)
      Setter for goAway builder.

      goAway: Server will disconnect soon.

    • clearGoAway

      @CanIgnoreReturnValue public LiveServerMessage.Builder clearGoAway()
      Clears the value of goAway field.
    • sessionResumptionUpdate

      public abstract LiveServerMessage.Builder sessionResumptionUpdate(LiveServerSessionResumptionUpdate sessionResumptionUpdate)
      Setter for sessionResumptionUpdate.

      sessionResumptionUpdate: Update of the session resumption state.

    • sessionResumptionUpdate

      @CanIgnoreReturnValue public LiveServerMessage.Builder sessionResumptionUpdate(LiveServerSessionResumptionUpdate.Builder sessionResumptionUpdateBuilder)
      Setter for sessionResumptionUpdate builder.

      sessionResumptionUpdate: Update of the session resumption state.

    • clearSessionResumptionUpdate

      @CanIgnoreReturnValue public LiveServerMessage.Builder clearSessionResumptionUpdate()
      Clears the value of sessionResumptionUpdate field.
    • voiceActivityDetectionSignal

      public abstract LiveServerMessage.Builder voiceActivityDetectionSignal(VoiceActivityDetectionSignal voiceActivityDetectionSignal)
      Setter for voiceActivityDetectionSignal.

      voiceActivityDetectionSignal: Voice activity detection signal.

    • voiceActivityDetectionSignal

      @CanIgnoreReturnValue public LiveServerMessage.Builder voiceActivityDetectionSignal(VoiceActivityDetectionSignal.Builder voiceActivityDetectionSignalBuilder)
      Setter for voiceActivityDetectionSignal builder.

      voiceActivityDetectionSignal: Voice activity detection signal.

    • clearVoiceActivityDetectionSignal

      @CanIgnoreReturnValue public LiveServerMessage.Builder clearVoiceActivityDetectionSignal()
      Clears the value of voiceActivityDetectionSignal field.
    • build

      public abstract LiveServerMessage build()