Class: AWSCDK::Bedrock::CfnGuardrail::WordConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_guardrail.rb

Overview

A word to configure for the guardrail.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text:, input_action: nil, input_enabled: nil, output_action: nil, output_enabled: nil) ⇒ WordConfigProperty

Returns a new instance of WordConfigProperty.

Parameters:

  • text (String)

    Text of the word configured for the guardrail to block.

  • input_action (String, nil) (defaults to: nil)

    Specifies the action to take when harmful content is detected in the input. Supported values include:.

  • input_enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether to enable guardrail evaluation on the intput.

  • output_action (String, nil) (defaults to: nil)

    Specifies the action to take when harmful content is detected in the output. Supported values include:.

  • output_enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether to enable guardrail evaluation on the output.



1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
# File 'bedrock/cfn_guardrail.rb', line 1831

def initialize(text:, input_action: nil, input_enabled: nil, output_action: nil, output_enabled: nil)
  @text = text
  Jsii::Type.check_type(@text, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "text")
  @input_action = input_action
  Jsii::Type.check_type(@input_action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "inputAction") unless @input_action.nil?
  @input_enabled = input_enabled
  Jsii::Type.check_type(@input_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "inputEnabled") unless @input_enabled.nil?
  @output_action = output_action
  Jsii::Type.check_type(@output_action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "outputAction") unless @output_action.nil?
  @output_enabled = output_enabled
  Jsii::Type.check_type(@output_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "outputEnabled") unless @output_enabled.nil?
end

Instance Attribute Details

#input_actionString? (readonly)

Specifies the action to take when harmful content is detected in the input. Supported values include:.

  • BLOCK – Block the content and replace it with blocked messaging.
  • NONE – Take no action but return detection information in the trace response.


1856
1857
1858
# File 'bedrock/cfn_guardrail.rb', line 1856

def input_action
  @input_action
end

#input_enabledBoolean, ... (readonly)

Specifies whether to enable guardrail evaluation on the intput.

When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.



1863
1864
1865
# File 'bedrock/cfn_guardrail.rb', line 1863

def input_enabled
  @input_enabled
end

#output_actionString? (readonly)

Specifies the action to take when harmful content is detected in the output. Supported values include:.

  • BLOCK – Block the content and replace it with blocked messaging.
  • NONE – Take no action but return detection information in the trace response.


1871
1872
1873
# File 'bedrock/cfn_guardrail.rb', line 1871

def output_action
  @output_action
end

#output_enabledBoolean, ... (readonly)

Specifies whether to enable guardrail evaluation on the output.

When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.



1878
1879
1880
# File 'bedrock/cfn_guardrail.rb', line 1878

def output_enabled
  @output_enabled
end

#textString (readonly)

Text of the word configured for the guardrail to block.



1848
1849
1850
# File 'bedrock/cfn_guardrail.rb', line 1848

def text
  @text
end

Class Method Details

.jsii_propertiesObject



1880
1881
1882
1883
1884
1885
1886
1887
1888
# File 'bedrock/cfn_guardrail.rb', line 1880

def self.jsii_properties
  {
    :text => "text",
    :input_action => "inputAction",
    :input_enabled => "inputEnabled",
    :output_action => "outputAction",
    :output_enabled => "outputEnabled",
  }
end

Instance Method Details

#to_jsiiObject



1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
# File 'bedrock/cfn_guardrail.rb', line 1890

def to_jsii
  result = {}
  result.merge!({
    "text" => @text,
    "inputAction" => @input_action,
    "inputEnabled" => @input_enabled,
    "outputAction" => @output_action,
    "outputEnabled" => @output_enabled,
  })
  result.compact
end