Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see
Model versions and lifecycle .
Send feedback
Interface SafetySettingOrBuilder (0.4.0)
Stay organized with collections
Save and categorize content based on your preferences.
public interface SafetySettingOrBuilder extends MessageOrBuilder
Methods
getCategory()
public abstract HarmCategory getCategory ()
Required. Harm category.
.google.cloud.vertexai.v1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED];
getCategoryValue()
public abstract int getCategoryValue ()
Required. Harm category.
.google.cloud.vertexai.v1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED];
Returns
Type
Description
int
The enum numeric value on the wire for category.
getThreshold()
public abstract SafetySetting . HarmBlockThreshold getThreshold ()
Required. The harm block threshold.
.google.cloud.vertexai.v1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED];
getThresholdValue()
public abstract int getThresholdValue ()
Required. The harm block threshold.
.google.cloud.vertexai.v1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED];
Returns
Type
Description
int
The enum numeric value on the wire for threshold.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-04 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Interface SafetySettingOrBuilder (0.4.0)\n\n public interface SafetySettingOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getCategory()\n\n public abstract HarmCategory getCategory()\n\nRequired. Harm category.\n\n`\n.google.cloud.vertexai.v1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED];\n`\n\n### getCategoryValue()\n\n public abstract int getCategoryValue()\n\nRequired. Harm category.\n\n`\n.google.cloud.vertexai.v1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED];\n`\n\n### getThreshold()\n\n public abstract SafetySetting.HarmBlockThreshold getThreshold()\n\nRequired. The harm block threshold.\n\n`\n.google.cloud.vertexai.v1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED];\n`\n\n### getThresholdValue()\n\n public abstract int getThresholdValue()\n\nRequired. The harm block threshold.\n\n`\n.google.cloud.vertexai.v1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED];\n`"]]