Class Topic
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrock.alpha.Topic
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)",
date="2025-09-02T11:25:42.857Z")
@Stability(Experimental)
public class Topic
extends software.amazon.jsii.JsiiObject
(experimental) Represents predefined topics that can be used to filter content.
Example:
Guardrail guardrail = Guardrail.Builder.create(this, "bedrockGuardrails") .guardrailName("my-BedrockGuardrails") // Configure tier for topic filters (optional) .topicsTierConfig(TierConfig.STANDARD) .build(); // Use a predefined topic guardrail.addDeniedTopicFilter(Topic.FINANCIAL_ADVICE); // Create a custom topic with input/output actions guardrail.addDeniedTopicFilter(Topic.custom(CustomTopicProps.builder() .name("Legal_Advice") .definition("Offering guidance or suggestions on legal matters, legal actions, interpretation of laws, or legal rights and responsibilities.") .examples(List.of("Can I sue someone for this?", "What are my legal rights in this situation?", "Is this action against the law?", "What should I do to file a legal complaint?", "Can you explain this law to me?")) // props below are optional .inputAction(GuardrailAction.BLOCK) .inputEnabled(true) .outputAction(GuardrailAction.NONE) .outputEnabled(true) .build()));
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Topic
(experimental) Filter for financial advice and investment recommendations.static final Topic
(experimental) Filter for inappropriate or explicit content.static final Topic
(experimental) Filter for legal advice and recommendations.static final Topic
(experimental) Filter for medical advice and health recommendations.static final Topic
(experimental) Filter for political advice and recommendations. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Topic
(CustomTopicProps props) protected
Topic
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
Topic
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic Topic
custom
(CustomTopicProps props) (experimental) Create a custom topic filter.(experimental) Definition of the topic.(experimental) Representative phrases that refer to the topic.(experimental) The action to take when a topic is detected in the input.(experimental) Whether the topic filter is enabled for input.getName()
(experimental) The name of the topic to deny.(experimental) The action to take when a topic is detected in the output.(experimental) Whether the topic filter is enabled for output.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
FINANCIAL_ADVICE
(experimental) Filter for financial advice and investment recommendations. -
INAPPROPRIATE_CONTENT
(experimental) Filter for inappropriate or explicit content. -
LEGAL_ADVICE
(experimental) Filter for legal advice and recommendations. -
MEDICAL_ADVICE
(experimental) Filter for medical advice and health recommendations. -
POLITICAL_ADVICE
(experimental) Filter for political advice and recommendations.
-
-
Constructor Details
-
Topic
protected Topic(software.amazon.jsii.JsiiObjectRef objRef) -
Topic
protected Topic(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Topic
- Parameters:
props
- This parameter is required.
-
-
Method Details
-
custom
(experimental) Create a custom topic filter.- Parameters:
props
- Properties for the custom topic filter. This parameter is required.
-
getDefinition
(experimental) Definition of the topic. -
getName
(experimental) The name of the topic to deny. -
getExamples
(experimental) Representative phrases that refer to the topic. -
getInputAction
(experimental) The action to take when a topic is detected in the input.Default: GuardrailAction.BLOCK
-
getInputEnabled
(experimental) Whether the topic filter is enabled for input.Default: true
-
getOutputAction
(experimental) The action to take when a topic is detected in the output.Default: GuardrailAction.BLOCK
-
getOutputEnabled
(experimental) Whether the topic filter is enabled for output.Default: true
-