interface ContextualGroundingFilter
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Alpha.ContextualGroundingFilter |
Go | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#ContextualGroundingFilter |
Java | software.amazon.awscdk.services.bedrock.alpha.ContextualGroundingFilter |
Python | aws_cdk.aws_bedrock_alpha.ContextualGroundingFilter |
TypeScript (source) | @aws-cdk/aws-bedrock-alpha ยป ContextualGroundingFilter |
Interface to define a Contextual Grounding Filter.
Example
const guardrail = new bedrock.Guardrail(this, 'bedrockGuardrails', {
guardrailName: 'my-BedrockGuardrails',
});
// Add contextual grounding filter with action and enabled flag
guardrail.addContextualGroundingFilter({
type: bedrock.ContextualGroundingFilterType.GROUNDING,
threshold: 0.8,
// the properties below are optional
action: bedrock.GuardrailAction.BLOCK,
enabled: true,
});
Properties
| Name | Type | Description |
|---|---|---|
| threshold | number | The threshold for the contextual grounding filter. |
| type | Contextual | The type of contextual grounding filter. |
| action? | Guardrail | The action to take when contextual grounding is detected. |
| enabled? | boolean | Whether the contextual grounding filter is enabled. |
threshold
Type:
number
The threshold for the contextual grounding filter.
0(blocks nothing)0.99(blocks almost everything)
type
Type:
Contextual
The type of contextual grounding filter.
action?
Type:
Guardrail
(optional, default: GuardrailAction.BLOCK)
The action to take when contextual grounding is detected.
enabled?
Type:
boolean
(optional, default: true)
Whether the contextual grounding filter is enabled.

.NET
Go
Java
Python
TypeScript (