Class: Google::Apis::CesV1::Guardrail

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 contains a list of checks and balances to keep the agents safe and secure.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Guardrail

Returns a new instance of Guardrail.



3536
3537
3538
# File 'lib/google/apis/ces_v1/classes.rb', line 3536

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#actionGoogle::Apis::CesV1::TriggerAction

Action that is taken when a certain precondition is met. Corresponds to the JSON property action



3466
3467
3468
# File 'lib/google/apis/ces_v1/classes.rb', line 3466

def action
  @action
end

#code_callbackGoogle::Apis::CesV1::GuardrailCodeCallback

Guardrail that blocks the conversation based on the code callbacks provided. Corresponds to the JSON property codeCallback



3471
3472
3473
# File 'lib/google/apis/ces_v1/classes.rb', line 3471

def code_callback
  @code_callback
end

#content_filterGoogle::Apis::CesV1::GuardrailContentFilter

Guardrail that bans certain content from being used in the conversation. Corresponds to the JSON property contentFilter



3476
3477
3478
# File 'lib/google/apis/ces_v1/classes.rb', line 3476

def content_filter
  @content_filter
end

#create_timeString

Output only. Timestamp when the guardrail was created. Corresponds to the JSON property createTime

Returns:

  • (String)


3481
3482
3483
# File 'lib/google/apis/ces_v1/classes.rb', line 3481

def create_time
  @create_time
end

#descriptionString

Optional. Description of the guardrail. Corresponds to the JSON property description

Returns:

  • (String)


3486
3487
3488
# File 'lib/google/apis/ces_v1/classes.rb', line 3486

def description
  @description
end

#display_nameString

Required. Display name of the guardrail. Corresponds to the JSON property displayName

Returns:

  • (String)


3491
3492
3493
# File 'lib/google/apis/ces_v1/classes.rb', line 3491

def display_name
  @display_name
end

#enabledBoolean Also known as: enabled?

Optional. Whether the guardrail is enabled. Corresponds to the JSON property enabled

Returns:

  • (Boolean)


3496
3497
3498
# File 'lib/google/apis/ces_v1/classes.rb', line 3496

def enabled
  @enabled
end

#etagString

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

Returns:

  • (String)


3504
3505
3506
# File 'lib/google/apis/ces_v1/classes.rb', line 3504

def etag
  @etag
end

#llm_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 llmPolicy



3510
3511
3512
# File 'lib/google/apis/ces_v1/classes.rb', line 3510

def llm_policy
  @llm_policy
end

#llm_prompt_securityGoogle::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



3516
3517
3518
# File 'lib/google/apis/ces_v1/classes.rb', line 3516

def llm_prompt_security
  @llm_prompt_security
end

#model_safetyGoogle::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



3523
3524
3525
# File 'lib/google/apis/ces_v1/classes.rb', line 3523

def model_safety
  @model_safety
end

#nameString

Identifier. The unique identifier of the guardrail. Format: projects/project /locations/location/apps/app/guardrails/guardrail` Corresponds to the JSON propertyname`

Returns:

  • (String)


3529
3530
3531
# File 'lib/google/apis/ces_v1/classes.rb', line 3529

def name
  @name
end

#update_timeString

Output only. Timestamp when the guardrail was last updated. Corresponds to the JSON property updateTime

Returns:

  • (String)


3534
3535
3536
# File 'lib/google/apis/ces_v1/classes.rb', line 3534

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
# File 'lib/google/apis/ces_v1/classes.rb', line 3541

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