Class: AWSCDK::Bedrock::CfnGuardrail::ContextualGroundingFilterConfigProperty

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

Overview

The filter configuration details for the guardrails contextual grounding filter.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(threshold:, type:, action: nil, enabled: nil) ⇒ ContextualGroundingFilterConfigProperty

Returns a new instance of ContextualGroundingFilterConfigProperty.

Parameters:

  • threshold (Numeric)

    The threshold details for the guardrails contextual grounding filter.

  • type (String)

    The filter details for the guardrails contextual grounding filter.

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

    Specifies the action to take when content fails the contextual grounding evaluation. Supported values include:.

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

    Specifies whether to enable contextual grounding evaluation.



1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
# File 'bedrock/cfn_guardrail.rb', line 1021

def initialize(threshold:, type:, action: nil, enabled: nil)
  @threshold = threshold
  Jsii::Type.check_type(@threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "threshold")
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  @action = action
  Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "action") unless @action.nil?
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enabled") unless @enabled.nil?
end

Instance Attribute Details

#actionString? (readonly)

Specifies the action to take when content fails the contextual grounding evaluation. 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.


1049
1050
1051
# File 'bedrock/cfn_guardrail.rb', line 1049

def action
  @action
end

#enabledBoolean, ... (readonly)

Specifies whether to enable contextual grounding evaluation.

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



1056
1057
1058
# File 'bedrock/cfn_guardrail.rb', line 1056

def enabled
  @enabled
end

#thresholdNumeric (readonly)

The threshold details for the guardrails contextual grounding filter.



1036
1037
1038
# File 'bedrock/cfn_guardrail.rb', line 1036

def threshold
  @threshold
end

#typeString (readonly)

The filter details for the guardrails contextual grounding filter.



1041
1042
1043
# File 'bedrock/cfn_guardrail.rb', line 1041

def type
  @type
end

Class Method Details

.jsii_propertiesObject



1058
1059
1060
1061
1062
1063
1064
1065
# File 'bedrock/cfn_guardrail.rb', line 1058

def self.jsii_properties
  {
    :threshold => "threshold",
    :type => "type",
    :action => "action",
    :enabled => "enabled",
  }
end

Instance Method Details

#to_jsiiObject



1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
# File 'bedrock/cfn_guardrail.rb', line 1067

def to_jsii
  result = {}
  result.merge!({
    "threshold" => @threshold,
    "type" => @type,
    "action" => @action,
    "enabled" => @enabled,
  })
  result.compact
end