Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class ModelArmorConfig.
Configuration for customer defined Model Armor templates to be used for sanitizing user prompts and assistant responses.
Generated from protobuf message google.cloud.discoveryengine.v1.Assistant.CustomerPolicy.ModelArmorConfig
Namespace
Google \ Cloud \ DiscoveryEngine \ V1 \ Assistant \ CustomerPolicyMethods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ user_prompt_template |
string
Optional. The resource name of the Model Armor template for sanitizing user prompts. Format: |
↳ response_template |
string
Optional. The resource name of the Model Armor template for sanitizing assistant responses. Format: |
↳ failure_mode |
int
Optional. Defines the failure mode for Model Armor sanitization. |
getUserPromptTemplate
Optional. The resource name of the Model Armor template for sanitizing
user prompts. Format:
projects/{project}/locations/{location}/templates/{template_id}
If not specified, no sanitization will be applied to the user prompt.
| Returns | |
|---|---|
| Type | Description |
string |
|
setUserPromptTemplate
Optional. The resource name of the Model Armor template for sanitizing
user prompts. Format:
projects/{project}/locations/{location}/templates/{template_id}
If not specified, no sanitization will be applied to the user prompt.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getResponseTemplate
Optional. The resource name of the Model Armor template for sanitizing
assistant responses. Format:
projects/{project}/locations/{location}/templates/{template_id}
If not specified, no sanitization will be applied to the assistant
response.
| Returns | |
|---|---|
| Type | Description |
string |
|
setResponseTemplate
Optional. The resource name of the Model Armor template for sanitizing
assistant responses. Format:
projects/{project}/locations/{location}/templates/{template_id}
If not specified, no sanitization will be applied to the assistant
response.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getFailureMode
Optional. Defines the failure mode for Model Armor sanitization.
| Returns | |
|---|---|
| Type | Description |
int |
Enum of type FailureMode. |
setFailureMode
Optional. Defines the failure mode for Model Armor sanitization.
| Parameter | |
|---|---|
| Name | Description |
var |
int
Enum of type FailureMode. |
| Returns | |
|---|---|
| Type | Description |
$this |
|