Class ModelArmorConfig
-
- All Implemented Interfaces:
public abstract class ModelArmorConfig extends JsonSerializable
Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and security filtering for prompts and responses. It helps protect your AI applications from risks such as harmful content, sensitive data leakage, and prompt injection attacks. This data type is not supported in Gemini API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classModelArmorConfig.BuilderBuilder for ModelArmorConfig.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description ModelArmorConfig()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>promptTemplateName()Optional. abstract Optional<String>responseTemplateName()Optional. static ModelArmorConfig.Builderbuilder()Instantiates a builder for ModelArmorConfig. abstract ModelArmorConfig.BuildertoBuilder()Creates a builder with the same values as this instance. static ModelArmorConfigfromJson(String jsonString)Deserializes a JSON string to a ModelArmorConfig object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
promptTemplateName
abstract Optional<String> promptTemplateName()
Optional. The resource name of the Model Armor template to use for prompt screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the user's prompt for safety and security risks before it is sent to the model. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.
-
responseTemplateName
abstract Optional<String> responseTemplateName()
Optional. The resource name of the Model Armor template to use for response screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the model's response for safety and security risks before it is returned to the user. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.
-
builder
static ModelArmorConfig.Builder builder()
Instantiates a builder for ModelArmorConfig.
-
toBuilder
abstract ModelArmorConfig.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static ModelArmorConfig fromJson(String jsonString)
Deserializes a JSON string to a ModelArmorConfig object.
-
-
-
-