Class SafetySetting.Builder
-
- All Implemented Interfaces:
public abstract class SafetySetting.BuilderBuilder for SafetySetting.
-
-
Constructor Summary
Constructors Constructor Description SafetySetting.Builder()
-
Method Summary
Modifier and Type Method Description abstract SafetySetting.Buildercategory(HarmCategory category)Setter for category. SafetySetting.BuilderclearCategory()Clears the value of category field. SafetySetting.Buildercategory(HarmCategory.Known knownType)Setter for category given a known enum. SafetySetting.Buildercategory(String category)Setter for category given a string. abstract SafetySetting.Buildermethod(HarmBlockMethod method)Setter for method. SafetySetting.BuilderclearMethod()Clears the value of method field. SafetySetting.Buildermethod(HarmBlockMethod.Known knownType)Setter for method given a known enum. SafetySetting.Buildermethod(String method)Setter for method given a string. abstract SafetySetting.Builderthreshold(HarmBlockThreshold threshold)Setter for threshold. SafetySetting.BuilderclearThreshold()Clears the value of threshold field. SafetySetting.Builderthreshold(HarmBlockThreshold.Known knownType)Setter for threshold given a known enum. SafetySetting.Builderthreshold(String threshold)Setter for threshold given a string. abstract SafetySettingbuild()-
-
Method Detail
-
category
abstract SafetySetting.Builder category(HarmCategory category)
Setter for category.
category: Required. The harm category to be blocked.
-
clearCategory
@CanIgnoreReturnValue() SafetySetting.Builder clearCategory()
Clears the value of category field.
-
category
@CanIgnoreReturnValue() SafetySetting.Builder category(HarmCategory.Known knownType)
Setter for category given a known enum.
category: Required. The harm category to be blocked.
-
category
@CanIgnoreReturnValue() SafetySetting.Builder category(String category)
Setter for category given a string.
category: Required. The harm category to be blocked.
-
method
abstract SafetySetting.Builder method(HarmBlockMethod method)
Setter for method.
method: Optional. The method for blocking content. If not specified, the default behavior is to use the probability score. This field is not supported in Gemini API.
-
clearMethod
@CanIgnoreReturnValue() SafetySetting.Builder clearMethod()
Clears the value of method field.
-
method
@CanIgnoreReturnValue() SafetySetting.Builder method(HarmBlockMethod.Known knownType)
Setter for method given a known enum.
method: Optional. The method for blocking content. If not specified, the default behavior is to use the probability score. This field is not supported in Gemini API.
-
method
@CanIgnoreReturnValue() SafetySetting.Builder method(String method)
Setter for method given a string.
method: Optional. The method for blocking content. If not specified, the default behavior is to use the probability score. This field is not supported in Gemini API.
-
threshold
abstract SafetySetting.Builder threshold(HarmBlockThreshold threshold)
Setter for threshold.
threshold: Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
-
clearThreshold
@CanIgnoreReturnValue() SafetySetting.Builder clearThreshold()
Clears the value of threshold field.
-
threshold
@CanIgnoreReturnValue() SafetySetting.Builder threshold(HarmBlockThreshold.Known knownType)
Setter for threshold given a known enum.
threshold: Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
-
threshold
@CanIgnoreReturnValue() SafetySetting.Builder threshold(String threshold)
Setter for threshold given a string.
threshold: Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
-
build
abstract SafetySetting build()
-
-
-
-