Class: Google::Apis::CesV1::GuardrailLlmPromptSecurity

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_policyGoogle::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_settingsGoogle::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_openBoolean 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

Returns:

  • (Boolean)


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