Class AutomaticActivityDetection.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • disabled

      public abstract AutomaticActivityDetection.Builder disabled(boolean disabled)
      Setter for disabled.

      disabled: If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.

    • startOfSpeechSensitivity

      public abstract AutomaticActivityDetection.Builder startOfSpeechSensitivity(StartSensitivity startOfSpeechSensitivity)
      Setter for startOfSpeechSensitivity.

      startOfSpeechSensitivity: Determines how likely speech is to be detected.

    • startOfSpeechSensitivity

      @CanIgnoreReturnValue public AutomaticActivityDetection.Builder startOfSpeechSensitivity(StartSensitivity.Known knownType)
      Setter for startOfSpeechSensitivity given a known enum.

      startOfSpeechSensitivity: Determines how likely speech is to be detected.

    • startOfSpeechSensitivity

      @CanIgnoreReturnValue public AutomaticActivityDetection.Builder startOfSpeechSensitivity(String startOfSpeechSensitivity)
      Setter for startOfSpeechSensitivity given a string.

      startOfSpeechSensitivity: Determines how likely speech is to be detected.

    • endOfSpeechSensitivity

      public abstract AutomaticActivityDetection.Builder endOfSpeechSensitivity(EndSensitivity endOfSpeechSensitivity)
      Setter for endOfSpeechSensitivity.

      endOfSpeechSensitivity: Determines how likely detected speech is ended.

    • endOfSpeechSensitivity

      @CanIgnoreReturnValue public AutomaticActivityDetection.Builder endOfSpeechSensitivity(EndSensitivity.Known knownType)
      Setter for endOfSpeechSensitivity given a known enum.

      endOfSpeechSensitivity: Determines how likely detected speech is ended.

    • endOfSpeechSensitivity

      @CanIgnoreReturnValue public AutomaticActivityDetection.Builder endOfSpeechSensitivity(String endOfSpeechSensitivity)
      Setter for endOfSpeechSensitivity given a string.

      endOfSpeechSensitivity: Determines how likely detected speech is ended.

    • prefixPaddingMs

      public abstract AutomaticActivityDetection.Builder prefixPaddingMs(Integer prefixPaddingMs)
      Setter for prefixPaddingMs.

      prefixPaddingMs: The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives.

    • silenceDurationMs

      public abstract AutomaticActivityDetection.Builder silenceDurationMs(Integer silenceDurationMs)
      Setter for silenceDurationMs.

      silenceDurationMs: The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.

    • build

      public abstract AutomaticActivityDetection build()