Class SafetySetting.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • method

      public abstract SafetySetting.Builder method(HarmBlockMethod method)
      Setter for method.

      method: Determines if the harm block method uses probability or probability and severity scores.

    • method

      @CanIgnoreReturnValue public SafetySetting.Builder method(HarmBlockMethod.Known knownType)
      Setter for method given a known enum.

      method: Determines if the harm block method uses probability or probability and severity scores.

    • method

      @CanIgnoreReturnValue public SafetySetting.Builder method(String method)
      Setter for method given a string.

      method: Determines if the harm block method uses probability or probability and severity scores.

    • category

      public abstract SafetySetting.Builder category(HarmCategory category)
      Setter for category.

      category: Required. Harm category.

    • category

      @CanIgnoreReturnValue public SafetySetting.Builder category(HarmCategory.Known knownType)
      Setter for category given a known enum.

      category: Required. Harm category.

    • category

      @CanIgnoreReturnValue public SafetySetting.Builder category(String category)
      Setter for category given a string.

      category: Required. Harm category.

    • threshold

      public abstract SafetySetting.Builder threshold(HarmBlockThreshold threshold)
      Setter for threshold.

      threshold: Required. The harm block threshold.

    • threshold

      @CanIgnoreReturnValue public SafetySetting.Builder threshold(HarmBlockThreshold.Known knownType)
      Setter for threshold given a known enum.

      threshold: Required. The harm block threshold.

    • threshold

      @CanIgnoreReturnValue public SafetySetting.Builder threshold(String threshold)
      Setter for threshold given a string.

      threshold: Required. The harm block threshold.

    • build

      public abstract SafetySetting build()