Class: AWSCDK::Bedrock::CfnGuardrail::WordConfigProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Bedrock::CfnGuardrail::WordConfigProperty
- Defined in:
- bedrock/cfn_guardrail.rb
Overview
A word to configure for the guardrail.
Instance Attribute Summary collapse
-
#input_action ⇒ String?
readonly
Specifies the action to take when harmful content is detected in the input.
-
#input_enabled ⇒ Boolean, ...
readonly
Specifies whether to enable guardrail evaluation on the intput.
-
#output_action ⇒ String?
readonly
Specifies the action to take when harmful content is detected in the output.
-
#output_enabled ⇒ Boolean, ...
readonly
Specifies whether to enable guardrail evaluation on the output.
-
#text ⇒ String
readonly
Text of the word configured for the guardrail to block.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(text:, input_action: nil, input_enabled: nil, output_action: nil, output_enabled: nil) ⇒ WordConfigProperty
constructor
A new instance of WordConfigProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(text:, input_action: nil, input_enabled: nil, output_action: nil, output_enabled: nil) ⇒ WordConfigProperty
Returns a new instance of WordConfigProperty.
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_action ⇒ String? (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_enabled ⇒ Boolean, ... (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_action ⇒ String? (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_enabled ⇒ Boolean, ... (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 |
#text ⇒ String (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_properties ⇒ Object
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_jsii ⇒ Object
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 |