Class: Google::Apis::CesV1::GuardrailContentFilter

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 bans certain content from being used in the conversation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GuardrailContentFilter

Returns a new instance of GuardrailContentFilter.



3630
3631
3632
# File 'lib/google/apis/ces_v1/classes.rb', line 3630

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

Instance Attribute Details

#banned_contentsArray<String>

Optional. List of banned phrases. Applies to both user inputs and agent responses. Corresponds to the JSON property bannedContents

Returns:

  • (Array<String>)


3607
3608
3609
# File 'lib/google/apis/ces_v1/classes.rb', line 3607

def banned_contents
  @banned_contents
end

#banned_contents_in_agent_responseArray<String>

Optional. List of banned phrases. Applies only to agent responses. Corresponds to the JSON property bannedContentsInAgentResponse

Returns:

  • (Array<String>)


3612
3613
3614
# File 'lib/google/apis/ces_v1/classes.rb', line 3612

def banned_contents_in_agent_response
  @banned_contents_in_agent_response
end

#banned_contents_in_user_inputArray<String>

Optional. List of banned phrases. Applies only to user inputs. Corresponds to the JSON property bannedContentsInUserInput

Returns:

  • (Array<String>)


3617
3618
3619
# File 'lib/google/apis/ces_v1/classes.rb', line 3617

def banned_contents_in_user_input
  @banned_contents_in_user_input
end

#disregard_diacriticsBoolean Also known as: disregard_diacritics?

Optional. If true, diacritics are ignored during matching. Corresponds to the JSON property disregardDiacritics

Returns:

  • (Boolean)


3622
3623
3624
# File 'lib/google/apis/ces_v1/classes.rb', line 3622

def disregard_diacritics
  @disregard_diacritics
end

#match_typeString

Required. Match type for the content filter. Corresponds to the JSON property matchType

Returns:

  • (String)


3628
3629
3630
# File 'lib/google/apis/ces_v1/classes.rb', line 3628

def match_type
  @match_type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3635
3636
3637
3638
3639
3640
3641
# File 'lib/google/apis/ces_v1/classes.rb', line 3635

def update!(**args)
  @banned_contents = args[:banned_contents] if args.key?(:banned_contents)
  @banned_contents_in_agent_response = args[:banned_contents_in_agent_response] if args.key?(:banned_contents_in_agent_response)
  @banned_contents_in_user_input = args[:banned_contents_in_user_input] if args.key?(:banned_contents_in_user_input)
  @disregard_diacritics = args[:disregard_diacritics] if args.key?(:disregard_diacritics)
  @match_type = args[:match_type] if args.key?(:match_type)
end