ContextualGroundingFilterType

class aws_cdk.aws_bedrock_alpha.ContextualGroundingFilterType(*values)

Bases: Enum

(experimental) The type of contextual grounding filter.

Stability:

experimental

ExampleMetadata:

fixture=default infused

Example:

guardrail = bedrock.Guardrail(self, "bedrockGuardrails",
    guardrail_name="my-BedrockGuardrails"
)
# Add contextual grounding filter with action and enabled flag
guardrail.add_contextual_grounding_filter(
    type=bedrock.ContextualGroundingFilterType.GROUNDING,
    threshold=0.8,
    # the properties below are optional
    action=bedrock.GuardrailAction.BLOCK,
    enabled=True
)

Attributes

GROUNDING

(experimental) Grounding score represents the confidence that the model response is factually correct and grounded in the source.

If the model response has a lower score than the defined threshold, the response will be blocked and the configured blocked message will be returned to the user. A higher threshold level blocks more responses.

Stability:

experimental

RELEVANCE

(experimental) Relevance score represents the confidence that the model response is relevant to the user’s query.

If the model response has a lower score than the defined threshold, the response will be blocked and the configured blocked message will be returned to the user. A higher threshold level blocks more responses.

Stability:

experimental