enum ContentFilterStrength
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Bedrock.Alpha.ContentFilterStrength |
![]() | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#ContentFilterStrength |
![]() | software.amazon.awscdk.services.bedrock.alpha.ContentFilterStrength |
![]() | aws_cdk.aws_bedrock_alpha.ContentFilterStrength |
![]() | @aws-cdk/aws-bedrock-alpha ยป ContentFilterStrength |
The strength of the content filter.
As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
Example
// Create a guardrail to filter inappropriate content
const guardrail = new bedrock.Guardrail(this, 'bedrockGuardrails', {
guardrailName: 'my-BedrockGuardrails',
description: 'Legal ethical guardrails.',
});
guardrail.addContentFilter({
type: bedrock.ContentFilterType.SEXUAL,
inputStrength: bedrock.ContentFilterStrength.HIGH,
outputStrength: bedrock.ContentFilterStrength.MEDIUM,
});
// Create an agent with the guardrail
const agentWithGuardrail = new bedrock.Agent(this, 'AgentWithGuardrail', {
foundationModel: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_HAIKU_V1_0,
instruction: 'You are a helpful and friendly agent that answers questions about literature.',
guardrail: guardrail,
});
Members
Name | Description |
---|---|
NONE | No content filtering applied. |
LOW | Low strength content filtering - minimal filtering of harmful content. |
MEDIUM | Medium strength content filtering - balanced filtering of harmful content. |
HIGH | High strength content filtering - aggressive filtering of harmful content. |
NONE
No content filtering applied.
LOW
Low strength content filtering - minimal filtering of harmful content.
MEDIUM
Medium strength content filtering - balanced filtering of harmful content.
HIGH
High strength content filtering - aggressive filtering of harmful content.