Class: Google::Apis::CesV1::Guardrail
- Inherits:
-
Object
- Object
- Google::Apis::CesV1::Guardrail
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/ces_v1/classes.rb,
lib/google/apis/ces_v1/representations.rb,
lib/google/apis/ces_v1/representations.rb
Overview
Guardrail contains a list of checks and balances to keep the agents safe and secure.
Instance Attribute Summary collapse
-
#action ⇒ Google::Apis::CesV1::TriggerAction
Action that is taken when a certain precondition is met.
-
#code_callback ⇒ Google::Apis::CesV1::GuardrailCodeCallback
Guardrail that blocks the conversation based on the code callbacks provided.
-
#content_filter ⇒ Google::Apis::CesV1::GuardrailContentFilter
Guardrail that bans certain content from being used in the conversation.
-
#create_time ⇒ String
Output only.
-
#description ⇒ String
Optional.
-
#display_name ⇒ String
Required.
-
#enabled ⇒ Boolean
(also: #enabled?)
Optional.
-
#etag ⇒ String
Etag used to ensure the object hasn't changed during a read-modify-write operation.
-
#llm_policy ⇒ Google::Apis::CesV1::GuardrailLlmPolicy
Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification.
-
#llm_prompt_security ⇒ Google::Apis::CesV1::GuardrailLlmPromptSecurity
Guardrail that blocks the conversation if the input is considered unsafe based on the LLM classification.
-
#model_safety ⇒ Google::Apis::CesV1::GuardrailModelSafety
Model safety settings overrides.
-
#name ⇒ String
Identifier.
-
#update_time ⇒ String
Output only.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Guardrail
constructor
A new instance of Guardrail.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Guardrail
Returns a new instance of Guardrail.
3895 3896 3897 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3895 def initialize(**args) update!(**args) end |
Instance Attribute Details
#action ⇒ Google::Apis::CesV1::TriggerAction
Action that is taken when a certain precondition is met.
Corresponds to the JSON property action
3825 3826 3827 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3825 def action @action end |
#code_callback ⇒ Google::Apis::CesV1::GuardrailCodeCallback
Guardrail that blocks the conversation based on the code callbacks provided.
Corresponds to the JSON property codeCallback
3830 3831 3832 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3830 def code_callback @code_callback end |
#content_filter ⇒ Google::Apis::CesV1::GuardrailContentFilter
Guardrail that bans certain content from being used in the conversation.
Corresponds to the JSON property contentFilter
3835 3836 3837 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3835 def content_filter @content_filter end |
#create_time ⇒ String
Output only. Timestamp when the guardrail was created.
Corresponds to the JSON property createTime
3840 3841 3842 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3840 def create_time @create_time end |
#description ⇒ String
Optional. Description of the guardrail.
Corresponds to the JSON property description
3845 3846 3847 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3845 def description @description end |
#display_name ⇒ String
Required. Display name of the guardrail.
Corresponds to the JSON property displayName
3850 3851 3852 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3850 def display_name @display_name end |
#enabled ⇒ Boolean Also known as: enabled?
Optional. Whether the guardrail is enabled.
Corresponds to the JSON property enabled
3855 3856 3857 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3855 def enabled @enabled end |
#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.
Corresponds to the JSON property etag
3863 3864 3865 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3863 def etag @etag end |
#llm_policy ⇒ Google::Apis::CesV1::GuardrailLlmPolicy
Guardrail that blocks the conversation if the LLM response is considered
violating the policy based on the LLM classification.
Corresponds to the JSON property llmPolicy
3869 3870 3871 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3869 def llm_policy @llm_policy end |
#llm_prompt_security ⇒ Google::Apis::CesV1::GuardrailLlmPromptSecurity
Guardrail that blocks the conversation if the input is considered unsafe based
on the LLM classification.
Corresponds to the JSON property llmPromptSecurity
3875 3876 3877 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3875 def llm_prompt_security @llm_prompt_security end |
#model_safety ⇒ Google::Apis::CesV1::GuardrailModelSafety
Model safety settings overrides. When this is set, it will override the
default settings and trigger the guardrail if the response is considered
unsafe.
Corresponds to the JSON property modelSafety
3882 3883 3884 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3882 def model_safety @model_safety end |
#name ⇒ String
Identifier. The unique identifier of the guardrail. Format: projects/project
/locations/location/apps/app/guardrails/guardrail`
Corresponds to the JSON propertyname`
3888 3889 3890 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3888 def name @name end |
#update_time ⇒ String
Output only. Timestamp when the guardrail was last updated.
Corresponds to the JSON property updateTime
3893 3894 3895 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3893 def update_time @update_time end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3900 def update!(**args) @action = args[:action] if args.key?(:action) @code_callback = args[:code_callback] if args.key?(:code_callback) @content_filter = args[:content_filter] if args.key?(:content_filter) @create_time = args[:create_time] if args.key?(:create_time) @description = args[:description] if args.key?(:description) @display_name = args[:display_name] if args.key?(:display_name) @enabled = args[:enabled] if args.key?(:enabled) @etag = args[:etag] if args.key?(:etag) @llm_policy = args[:llm_policy] if args.key?(:llm_policy) @llm_prompt_security = args[:llm_prompt_security] if args.key?(:llm_prompt_security) @model_safety = args[:model_safety] if args.key?(:model_safety) @name = args[:name] if args.key?(:name) @update_time = args[:update_time] if args.key?(:update_time) end |