Class: Google::Apis::CesV1::GuardrailLlmPromptSecurity
- Inherits:
-
Object
- Object
- Google::Apis::CesV1::GuardrailLlmPromptSecurity
- 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 that blocks the conversation if the input is considered unsafe based on the LLM classification.
Instance Attribute Summary collapse
-
#custom_policy ⇒ Google::Apis::CesV1::GuardrailLlmPolicy
Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification.
-
#default_settings ⇒ Google::Apis::CesV1::GuardrailLlmPromptSecurityDefaultSecuritySettings
Configuration for default system security settings.
-
#fail_open ⇒ Boolean
(also: #fail_open?)
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GuardrailLlmPromptSecurity
constructor
A new instance of GuardrailLlmPromptSecurity.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GuardrailLlmPromptSecurity
Returns a new instance of GuardrailLlmPromptSecurity.
3728 3729 3730 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3728 def initialize(**args) update!(**args) end |
Instance Attribute Details
#custom_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 customPolicy
3712 3713 3714 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3712 def custom_policy @custom_policy end |
#default_settings ⇒ Google::Apis::CesV1::GuardrailLlmPromptSecurityDefaultSecuritySettings
Configuration for default system security settings.
Corresponds to the JSON property defaultSettings
3717 3718 3719 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3717 def default_settings @default_settings end |
#fail_open ⇒ Boolean Also known as: fail_open?
Optional. Determines the behavior when the guardrail encounters an LLM error. -
If true: the guardrail is bypassed. - If false (default): the guardrail
triggers/blocks. Note: If a custom policy is provided, this field is ignored
in favor of the policy's 'fail_open' configuration.
Corresponds to the JSON property failOpen
3725 3726 3727 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3725 def fail_open @fail_open end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
3733 3734 3735 3736 3737 |
# File 'lib/google/apis/ces_v1/classes.rb', line 3733 def update!(**args) @custom_policy = args[:custom_policy] if args.key?(:custom_policy) @default_settings = args[:default_settings] if args.key?(:default_settings) @fail_open = args[:fail_open] if args.key?(:fail_open) end |