Class GuardrailProps.Builder
java.lang.Object
software.amazon.awscdk.services.bedrock.alpha.GuardrailProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<GuardrailProps>
- Enclosing interface:
GuardrailProps
@Stability(Experimental)
public static final class GuardrailProps.Builder
extends Object
implements software.amazon.jsii.Builder<GuardrailProps>
A builder for
GuardrailProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionblockedInputMessaging(String blockedInputMessaging) Sets the value ofGuardrailProps.getBlockedInputMessaging()blockedOutputsMessaging(String blockedOutputsMessaging) Sets the value ofGuardrailProps.getBlockedOutputsMessaging()build()Builds the configured instance.contentFilters(List<? extends ContentFilter> contentFilters) Sets the value ofGuardrailProps.getContentFilters()contentFiltersTierConfig(TierConfig contentFiltersTierConfig) Sets the value ofGuardrailProps.getContentFiltersTierConfig()contextualGroundingFilters(List<? extends ContextualGroundingFilter> contextualGroundingFilters) Sets the value ofGuardrailProps.getContextualGroundingFilters()crossRegionConfig(GuardrailCrossRegionConfigProperty crossRegionConfig) Sets the value ofGuardrailProps.getCrossRegionConfig()deniedTopics(List<? extends Topic> deniedTopics) Sets the value ofGuardrailProps.getDeniedTopics()description(String description) Sets the value ofGuardrailProps.getDescription()guardrailName(String guardrailName) Sets the value ofGuardrailProps.getGuardrailName()Sets the value ofGuardrailProps.getKmsKey()managedWordListFilters(List<? extends ManagedWordFilter> managedWordListFilters) Sets the value ofGuardrailProps.getManagedWordListFilters()piiFilters(List<? extends PIIFilter> piiFilters) Sets the value ofGuardrailProps.getPiiFilters()regexFilters(List<? extends RegexFilter> regexFilters) Sets the value ofGuardrailProps.getRegexFilters()topicsTierConfig(TierConfig topicsTierConfig) Sets the value ofGuardrailProps.getTopicsTierConfig()wordFilters(List<? extends WordFilter> wordFilters) Sets the value ofGuardrailProps.getWordFilters()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
guardrailName
Sets the value ofGuardrailProps.getGuardrailName()- Parameters:
guardrailName- The name of the guardrail. This parameter is required. This will be used as the physical name of the guardrail.- Returns:
this
-
blockedInputMessaging
@Stability(Experimental) public GuardrailProps.Builder blockedInputMessaging(String blockedInputMessaging) Sets the value ofGuardrailProps.getBlockedInputMessaging()- Parameters:
blockedInputMessaging- The message to return when the guardrail blocks a prompt. Must be between 1 and 500 characters.- Returns:
this
-
blockedOutputsMessaging
@Stability(Experimental) public GuardrailProps.Builder blockedOutputsMessaging(String blockedOutputsMessaging) Sets the value ofGuardrailProps.getBlockedOutputsMessaging()- Parameters:
blockedOutputsMessaging- The message to return when the guardrail blocks a model response. Must be between 1 and 500 characters.- Returns:
this
-
contentFilters
@Stability(Experimental) public GuardrailProps.Builder contentFilters(List<? extends ContentFilter> contentFilters) Sets the value ofGuardrailProps.getContentFilters()- Parameters:
contentFilters- The content filters to apply to the guardrail.- Returns:
this
-
contentFiltersTierConfig
@Stability(Experimental) public GuardrailProps.Builder contentFiltersTierConfig(TierConfig contentFiltersTierConfig) Sets the value ofGuardrailProps.getContentFiltersTierConfig()- Parameters:
contentFiltersTierConfig- The tier configuration to apply to the guardrail.- Returns:
this
-
contextualGroundingFilters
@Stability(Experimental) public GuardrailProps.Builder contextualGroundingFilters(List<? extends ContextualGroundingFilter> contextualGroundingFilters) Sets the value ofGuardrailProps.getContextualGroundingFilters()- Parameters:
contextualGroundingFilters- The contextual grounding filters to apply to the guardrail.- Returns:
this
-
crossRegionConfig
@Stability(Experimental) public GuardrailProps.Builder crossRegionConfig(GuardrailCrossRegionConfigProperty crossRegionConfig) Sets the value ofGuardrailProps.getCrossRegionConfig()- Parameters:
crossRegionConfig- The cross-region configuration for the guardrail. This is optional and when provided, it should be of type GuardrailCrossRegionConfigProperty.- Returns:
this
-
deniedTopics
@Stability(Experimental) public GuardrailProps.Builder deniedTopics(List<? extends Topic> deniedTopics) Sets the value ofGuardrailProps.getDeniedTopics()- Parameters:
deniedTopics- A list of policies related to topics that the guardrail should deny.- Returns:
this
-
description
Sets the value ofGuardrailProps.getDescription()- Parameters:
description- The description of the guardrail.- Returns:
this
-
kmsKey
Sets the value ofGuardrailProps.getKmsKey()- Parameters:
kmsKey- A custom KMS key to use for encrypting data.- Returns:
this
-
managedWordListFilters
@Stability(Experimental) public GuardrailProps.Builder managedWordListFilters(List<? extends ManagedWordFilter> managedWordListFilters) Sets the value ofGuardrailProps.getManagedWordListFilters()- Parameters:
managedWordListFilters- The managed word filters to apply to the guardrail.- Returns:
this
-
piiFilters
@Stability(Experimental) public GuardrailProps.Builder piiFilters(List<? extends PIIFilter> piiFilters) Sets the value ofGuardrailProps.getPiiFilters()- Parameters:
piiFilters- The PII filters to apply to the guardrail.- Returns:
this
-
regexFilters
@Stability(Experimental) public GuardrailProps.Builder regexFilters(List<? extends RegexFilter> regexFilters) Sets the value ofGuardrailProps.getRegexFilters()- Parameters:
regexFilters- The regular expression (regex) filters to apply to the guardrail.- Returns:
this
-
topicsTierConfig
@Stability(Experimental) public GuardrailProps.Builder topicsTierConfig(TierConfig topicsTierConfig) Sets the value ofGuardrailProps.getTopicsTierConfig()- Parameters:
topicsTierConfig- The tier configuration to apply to the guardrail.- Returns:
this
-
wordFilters
@Stability(Experimental) public GuardrailProps.Builder wordFilters(List<? extends WordFilter> wordFilters) Sets the value ofGuardrailProps.getWordFilters()- Parameters:
wordFilters- The word filters to apply to the guardrail.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<GuardrailProps>- Returns:
- a new instance of
GuardrailProps - Throws:
NullPointerException- if any required attribute was not provided
-