Reference documentation and code samples for the Google Cloud Ces V1 Client class Guardrail.
Guardrail contains a list of checks and balances to keep the agents safe and secure.
Generated from protobuf message google.cloud.ces.v1.Guardrail
Namespace
Google \ Cloud \ Ces \ V1Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ content_filter |
Guardrail\ContentFilter
Optional. Guardrail that bans certain content from being used in the conversation. |
↳ llm_prompt_security |
Guardrail\LlmPromptSecurity
Optional. Guardrail that blocks the conversation if the prompt is considered unsafe based on the LLM classification. |
↳ llm_policy |
Guardrail\LlmPolicy
Optional. Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification. |
↳ model_safety |
Guardrail\ModelSafety
Optional. Guardrail that blocks the conversation if the LLM response is considered unsafe based on the model safety settings. |
↳ code_callback |
Guardrail\CodeCallback
Optional. Guardrail that potentially blocks the conversation based on the result of the callback execution. |
↳ name |
string
Identifier. The unique identifier of the guardrail. Format: |
↳ display_name |
string
Required. Display name of the guardrail. |
↳ description |
string
Optional. Description of the guardrail. |
↳ enabled |
bool
Optional. Whether the guardrail is enabled. |
↳ action |
TriggerAction
Optional. Action to take when the guardrail is triggered. |
↳ create_time |
Google\Protobuf\Timestamp
Output only. Timestamp when the guardrail was created. |
↳ update_time |
Google\Protobuf\Timestamp
Output only. Timestamp when the guardrail was last updated. |
↳ etag |
string
Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes. |
getContentFilter
Optional. Guardrail that bans certain content from being used in the conversation.
| Returns | |
|---|---|
| Type | Description |
Guardrail\ContentFilter|null |
|
hasContentFilter
setContentFilter
Optional. Guardrail that bans certain content from being used in the conversation.
| Parameter | |
|---|---|
| Name | Description |
var |
Guardrail\ContentFilter
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getLlmPromptSecurity
Optional. Guardrail that blocks the conversation if the prompt is considered unsafe based on the LLM classification.
| Returns | |
|---|---|
| Type | Description |
Guardrail\LlmPromptSecurity|null |
|
hasLlmPromptSecurity
setLlmPromptSecurity
Optional. Guardrail that blocks the conversation if the prompt is considered unsafe based on the LLM classification.
| Parameter | |
|---|---|
| Name | Description |
var |
Guardrail\LlmPromptSecurity
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getLlmPolicy
Optional. Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification.
| Returns | |
|---|---|
| Type | Description |
Guardrail\LlmPolicy|null |
|
hasLlmPolicy
setLlmPolicy
Optional. Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification.
| Parameter | |
|---|---|
| Name | Description |
var |
Guardrail\LlmPolicy
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getModelSafety
Optional. Guardrail that blocks the conversation if the LLM response is considered unsafe based on the model safety settings.
| Returns | |
|---|---|
| Type | Description |
Guardrail\ModelSafety|null |
|
hasModelSafety
setModelSafety
Optional. Guardrail that blocks the conversation if the LLM response is considered unsafe based on the model safety settings.
| Parameter | |
|---|---|
| Name | Description |
var |
Guardrail\ModelSafety
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getCodeCallback
Optional. Guardrail that potentially blocks the conversation based on the result of the callback execution.
| Returns | |
|---|---|
| Type | Description |
Guardrail\CodeCallback|null |
|
hasCodeCallback
setCodeCallback
Optional. Guardrail that potentially blocks the conversation based on the result of the callback execution.
| Parameter | |
|---|---|
| Name | Description |
var |
Guardrail\CodeCallback
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getName
Identifier. The unique identifier of the guardrail.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}
| Returns | |
|---|---|
| Type | Description |
string |
|
setName
Identifier. The unique identifier of the guardrail.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getDisplayName
Required. Display name of the guardrail.
| Returns | |
|---|---|
| Type | Description |
string |
|
setDisplayName
Required. Display name of the guardrail.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getDescription
Optional. Description of the guardrail.
| Returns | |
|---|---|
| Type | Description |
string |
|
setDescription
Optional. Description of the guardrail.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getEnabled
Optional. Whether the guardrail is enabled.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setEnabled
Optional. Whether the guardrail is enabled.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getAction
Optional. Action to take when the guardrail is triggered.
| Returns | |
|---|---|
| Type | Description |
TriggerAction|null |
|
hasAction
clearAction
setAction
Optional. Action to take when the guardrail is triggered.
| Parameter | |
|---|---|
| Name | Description |
var |
TriggerAction
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getCreateTime
Output only. Timestamp when the guardrail was created.
| Returns | |
|---|---|
| Type | Description |
Google\Protobuf\Timestamp|null |
|
hasCreateTime
clearCreateTime
setCreateTime
Output only. Timestamp when the guardrail was created.
| Parameter | |
|---|---|
| Name | Description |
var |
Google\Protobuf\Timestamp
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getUpdateTime
Output only. Timestamp when the guardrail was last updated.
| Returns | |
|---|---|
| Type | Description |
Google\Protobuf\Timestamp|null |
|
hasUpdateTime
clearUpdateTime
setUpdateTime
Output only. Timestamp when the guardrail was last updated.
| Parameter | |
|---|---|
| Name | Description |
var |
Google\Protobuf\Timestamp
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getEtag
Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.
| Returns | |
|---|---|
| Type | Description |
string |
|
setEtag
Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getGuardrailType
| Returns | |
|---|---|
| Type | Description |
string |
|