Class SafetyRating.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • blocked

      public abstract SafetyRating.Builder blocked(boolean blocked)
      Setter for blocked.

      blocked: Output only. Indicates whether the content was filtered out because of this rating.

    • category

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

      category: Output only. Harm category.

    • category

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

      category: Output only. Harm category.

    • category

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

      category: Output only. Harm category.

    • overwrittenThreshold

      public abstract SafetyRating.Builder overwrittenThreshold(HarmBlockThreshold overwrittenThreshold)
      Setter for overwrittenThreshold.

      overwrittenThreshold: Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.

    • overwrittenThreshold

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

      overwrittenThreshold: Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.

    • overwrittenThreshold

      @CanIgnoreReturnValue public SafetyRating.Builder overwrittenThreshold(String overwrittenThreshold)
      Setter for overwrittenThreshold given a string.

      overwrittenThreshold: Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.

    • probability

      public abstract SafetyRating.Builder probability(HarmProbability probability)
      Setter for probability.

      probability: Output only. Harm probability levels in the content.

    • probability

      @CanIgnoreReturnValue public SafetyRating.Builder probability(HarmProbability.Known knownType)
      Setter for probability given a known enum.

      probability: Output only. Harm probability levels in the content.

    • probability

      @CanIgnoreReturnValue public SafetyRating.Builder probability(String probability)
      Setter for probability given a string.

      probability: Output only. Harm probability levels in the content.

    • probabilityScore

      public abstract SafetyRating.Builder probabilityScore(Float probabilityScore)
      Setter for probabilityScore.

      probabilityScore: Output only. Harm probability score.

    • severity

      public abstract SafetyRating.Builder severity(HarmSeverity severity)
      Setter for severity.

      severity: Output only. Harm severity levels in the content.

    • severity

      @CanIgnoreReturnValue public SafetyRating.Builder severity(HarmSeverity.Known knownType)
      Setter for severity given a known enum.

      severity: Output only. Harm severity levels in the content.

    • severity

      @CanIgnoreReturnValue public SafetyRating.Builder severity(String severity)
      Setter for severity given a string.

      severity: Output only. Harm severity levels in the content.

    • severityScore

      public abstract SafetyRating.Builder severityScore(Float severityScore)
      Setter for severityScore.

      severityScore: Output only. Harm severity score.

    • build

      public abstract SafetyRating build()