interface ManagedWordFilter
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Bedrock.Alpha.ManagedWordFilter |
![]() | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#ManagedWordFilter |
![]() | software.amazon.awscdk.services.bedrock.alpha.ManagedWordFilter |
![]() | aws_cdk.aws_bedrock_alpha.ManagedWordFilter |
![]() | @aws-cdk/aws-bedrock-alpha ยป ManagedWordFilter |
Interface for managed word list filters.
Example
const guardrail = new bedrock.Guardrail(this, 'bedrockGuardrails', {
guardrailName: 'my-BedrockGuardrails',
});
// Add managed word list with input/output actions
guardrail.addManagedWordListFilter({
type: bedrock.ManagedWordFilterType.PROFANITY,
inputAction: bedrock.GuardrailAction.BLOCK,
inputEnabled: true,
outputAction: bedrock.GuardrailAction.NONE,
outputEnabled: true,
});
// Add individual words
guardrail.addWordFilter({text: 'drugs'});
guardrail.addWordFilter({text: 'competitor'});
// Add words from a file
guardrail.addWordFilterFromFile('./scripts/wordsPolicy.csv');
Properties
Name | Type | Description |
---|---|---|
input | Guardrail | The action to take when a managed word is detected in the input. |
input | boolean | Whether the managed word filter is enabled for input. |
output | Guardrail | The action to take when a managed word is detected in the output. |
output | boolean | Whether the managed word filter is enabled for output. |
type? | Managed | The type of managed word filter. |
inputAction?
Type:
Guardrail
(optional, default: GuardrailAction.BLOCK)
The action to take when a managed word is detected in the input.
inputEnabled?
Type:
boolean
(optional, default: true)
Whether the managed word filter is enabled for input.
outputAction?
Type:
Guardrail
(optional, default: GuardrailAction.BLOCK)
The action to take when a managed word is detected in the output.
outputEnabled?
Type:
boolean
(optional, default: true)
Whether the managed word filter is enabled for output.
type?
Type:
Managed
(optional, default: ManagedWordFilterType.PROFANITY)
The type of managed word filter.