Class AutomaticActivityDetection

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.AutomaticActivityDetection

public abstract class AutomaticActivityDetection extends JsonSerializable
Configures automatic detection of activity.
  • Constructor Details

    • AutomaticActivityDetection

      public AutomaticActivityDetection()
  • Method Details

    • disabled

      public abstract Optional<Boolean> disabled()
      If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.
    • startOfSpeechSensitivity

      public abstract Optional<StartSensitivity> startOfSpeechSensitivity()
      Determines how likely speech is to be detected.
    • endOfSpeechSensitivity

      public abstract Optional<EndSensitivity> endOfSpeechSensitivity()
      Determines how likely detected speech is ended.
    • prefixPaddingMs

      public abstract Optional<Integer> 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 Optional<Integer> 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.
    • builder

      public static AutomaticActivityDetection.Builder builder()
      Instantiates a builder for AutomaticActivityDetection.
    • toBuilder

      public abstract AutomaticActivityDetection.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static AutomaticActivityDetection fromJson(String jsonString)
      Deserializes a JSON string to a AutomaticActivityDetection object.