Package com.google.genai.types
Class SafetySetting
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.SafetySetting
Safety settings.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SafetySetting.Builderbuilder()Instantiates a builder for SafetySetting.abstract Optional<HarmCategory>category()Required.static SafetySettingDeserializes a JSON string to a SafetySetting object.abstract Optional<HarmBlockMethod>method()Optional.abstract Optional<HarmBlockThreshold>Required.abstract SafetySetting.BuilderCreates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
setMaxReadLength, stringToJsonNode, toJson
-
Constructor Details
-
SafetySetting
public SafetySetting()
-
-
Method Details
-
category
Required. Harm category. -
method
Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. This field is not supported in Gemini API. -
threshold
Required. The harm block threshold. -
builder
Instantiates a builder for SafetySetting. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a SafetySetting object.
-