- Resource: Template
- FilterConfig
- RaiFilterSettings
- RaiFilter
- RaiFilterType
- DetectionConfidenceLevel
- SdpFilterSettings
- SdpBasicConfig
- SdpBasicConfigEnforcement
- SdpAdvancedConfig
- PiAndJailbreakFilterSettings
- PiAndJailbreakFilterEnforcement
- MaliciousUriFilterSettings
- MaliciousUriFilterEnforcement
- TemplateMetadata
- Methods
Resource: Template
Message describing Template resource
JSON representation |
---|
{ "name": string, "createTime": string, "updateTime": string, "labels": { string: string, ... }, "filterConfig": { object ( |
Fields | |
---|---|
name |
Identifier. name of resource |
create |
Output only. [Output only] Create time stamp A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
update |
Output only. [Output only] Update time stamp A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
labels |
Optional. Labels as key value pairs An object containing a list of |
filter |
Required. filter configuration for this template |
template |
Optional. metadata for this template |
FilterConfig
Filters configuration.
JSON representation |
---|
{ "raiSettings": { object ( |
Fields | |
---|---|
rai |
Optional. Responsible AI settings. |
sdp |
Optional. Sensitive Data Protection settings. |
pi |
Optional. Prompt injection and Jailbreak filter settings. |
malicious |
Optional. Malicious URI filter settings. |
RaiFilterSettings
Responsible AI Filter settings.
JSON representation |
---|
{
"raiFilters": [
{
object ( |
Fields | |
---|---|
rai |
Required. List of Responsible AI filters enabled for template. |
RaiFilter
Responsible AI filter.
JSON representation |
---|
{ "filterType": enum ( |
Fields | |
---|---|
filter |
Required. Type of responsible AI filter. |
confidence |
Optional. Confidence level for this RAI filter. During data sanitization, if data is classified under this filter with a confidence level equal to or greater than the specified level, a positive match is reported. If the confidence level is unspecified (i.e., 0), the system will use a reasonable default level based on the |
RaiFilterType
Options for responsible AI Filter Types.
Enums | |
---|---|
RAI_FILTER_TYPE_UNSPECIFIED |
Unspecified filter type. |
SEXUALLY_EXPLICIT |
Sexually Explicit. |
HATE_SPEECH |
Hate Speech. |
HARASSMENT |
Harassment. |
DANGEROUS |
Danger |
DetectionConfidenceLevel
Confidence levels for detectors. Higher value maps to a greater confidence level. To enforce stricter level a lower value should be used.
Enums | |
---|---|
DETECTION_CONFIDENCE_LEVEL_UNSPECIFIED |
Same as LOW_AND_ABOVE. |
LOW_AND_ABOVE |
Highest chance of a false positive. |
MEDIUM_AND_ABOVE |
Some chance of false positives. |
HIGH |
Low chance of false positives. |
SdpFilterSettings
Sensitive Data Protection settings.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field sdp_configuration . Either of Sensitive Data Protection basic or advanced configuration. sdp_configuration can be only one of the following: |
|
basic |
Optional. Basic Sensitive Data Protection configuration inspects the content for sensitive data using a fixed set of six info-types. Sensitive Data Protection templates cannot be used with basic configuration. Only Sensitive Data Protection inspection operation is supported with basic configuration. |
advanced |
Optional. Advanced Sensitive Data Protection configuration which enables use of Sensitive Data Protection templates. Supports both Sensitive Data Protection inspection and de-identification operations. |
SdpBasicConfig
Sensitive Data Protection basic configuration.
JSON representation |
---|
{
"filterEnforcement": enum ( |
Fields | |
---|---|
filter |
Optional. Tells whether the Sensitive Data Protection basic config is enabled or disabled. |
SdpBasicConfigEnforcement
Option to specify the state of Sensitive Data Protection basic config (ENABLED/DISABLED).
Enums | |
---|---|
SDP_BASIC_CONFIG_ENFORCEMENT_UNSPECIFIED |
Same as Disabled |
ENABLED |
Enabled |
DISABLED |
Disabled |
SdpAdvancedConfig
Sensitive Data Protection Advanced configuration.
JSON representation |
---|
{ "inspectTemplate": string, "deidentifyTemplate": string } |
Fields | |
---|---|
inspect |
Optional. Sensitive Data Protection inspect template resource name If only inspect template is provided (de-identify template not provided), then Sensitive Data Protection InspectContent action is performed during Sanitization. All Sensitive Data Protection findings identified during inspection will be returned as SdpFinding in SdpInsepctionResult e.g. |
deidentify |
Optional. Optional Sensitive Data Protection Deidentify template resource name. If provided then DeidentifyContent action is performed during Sanitization using this template and inspect template. The De-identified data will be returned in SdpDeidentifyResult. Note that all info-types present in the deidentify template must be present in inspect template. e.g. |
PiAndJailbreakFilterSettings
Prompt injection and Jailbreak Filter settings.
JSON representation |
---|
{ "filterEnforcement": enum ( |
Fields | |
---|---|
filter |
Optional. Tells whether Prompt injection and Jailbreak filter is enabled or disabled. |
confidence |
Optional. Confidence level for this filter. Confidence level is used to determine the threshold for the filter. If detection confidence is equal to or greater than the specified level, a positive match is reported. Confidence level will only be used if the filter is enabled. |
PiAndJailbreakFilterEnforcement
Option to specify the state of Prompt Injection and Jailbreak filter (ENABLED/DISABLED).
Enums | |
---|---|
PI_AND_JAILBREAK_FILTER_ENFORCEMENT_UNSPECIFIED |
Same as Disabled |
ENABLED |
Enabled |
DISABLED |
Enabled |
MaliciousUriFilterSettings
Malicious URI filter settings.
JSON representation |
---|
{
"filterEnforcement": enum ( |
Fields | |
---|---|
filter |
Optional. Tells whether the Malicious URI filter is enabled or disabled. |
MaliciousUriFilterEnforcement
Option to specify the state of Malicious URI filter (ENABLED/DISABLED).
Enums | |
---|---|
MALICIOUS_URI_FILTER_ENFORCEMENT_UNSPECIFIED |
Same as Disabled |
ENABLED |
Enabled |
DISABLED |
Disabled |
TemplateMetadata
Message describing TemplateMetadata
JSON representation |
---|
{ "ignorePartialInvocationFailures": boolean, "customPromptSafetyErrorCode": integer, "customPromptSafetyErrorMessage": string, "customLlmResponseSafetyErrorCode": integer, "customLlmResponseSafetyErrorMessage": string, "logTemplateOperations": boolean, "logSanitizeOperations": boolean } |
Fields | |
---|---|
ignore |
Optional. If true, partial detector failures should be ignored. |
custom |
Optional. Indicates the custom error code set by the user to be returned to the end user by the service extension if the prompt trips Model Armor filters. |
custom |
Optional. Indicates the custom error message set by the user to be returned to the end user if the prompt trips Model Armor filters. |
custom |
Optional. Indicates the custom error code set by the user to be returned to the end user if the LLM response trips Model Armor filters. |
custom |
Optional. Indicates the custom error message set by the user to be returned to the end user if the LLM response trips Model Armor filters. |
log |
Optional. If true, log template crud operations. |
log |
Optional. If true, log sanitize operations. |
Methods |
|
---|---|
|
Creates a new Template in a given project and location. |
|
Deletes a single Template. |
|
Gets details of a single Template. |
|
Lists Templates in a given project and location. |
|
Updates the parameters of a single Template. |
|
Sanitizes Model Response. |
|
Sanitizes User Prompt. |