Class SafetySetting

java.lang.Object
com.google.genai.gaos.models.interactions.SafetySetting

public class SafetySetting extends Object
SafetySetting

A safety setting that affects the safety-blocking behavior.

A SafetySetting consists of a harm category and a threshold for that category.

  • Constructor Details

  • Method Details

    • method

      public Optional<Method> method()
      Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.
    • threshold

      public Optional<Threshold> threshold()
      Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
    • type

      public Optional<HarmCategory> type()
    • builder

      public static SafetySetting.Builder builder()
    • withMethod

      public SafetySetting withMethod(@Nullable Method method)
      Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.
    • withThreshold

      public SafetySetting withThreshold(@Nonnull Threshold threshold)
      Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
    • withType

      public SafetySetting withType(@Nonnull HarmCategory type)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object