Class Guardrail
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.stepfunctions.tasks.Guardrail
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.110.0 (build 336b265)",
date="2025-04-17T00:47:13.297Z")
@Stability(Stable)
public class Guardrail
extends software.amazon.jsii.JsiiObject
Guradrail settings for BedrockInvokeModel.
Example:
import software.amazon.awscdk.services.bedrock.*; FoundationModel model = FoundationModel.fromFoundationModelId(this, "Model", FoundationModelIdentifier.AMAZON_TITAN_TEXT_G1_EXPRESS_V1); BedrockInvokeModel task = BedrockInvokeModel.Builder.create(this, "Prompt Model with guardrail") .model(model) .body(TaskInput.fromObject(Map.of( "inputText", "Generate a list of five first names.", "textGenerationConfig", Map.of( "maxTokenCount", 100, "temperature", 1)))) .guardrail(Guardrail.enable("guardrailId", 1)) .resultSelector(Map.of( "names", JsonPath.stringAt("$.Body.results[0].outputText"))) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Guardrail
Enable guardrail.static Guardrail
enableDraft
(String identifier) Enable guardrail with DRAFT version.The identitifier of guardrail.The version of guardrail.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
-
Constructor Details
-
Guardrail
protected Guardrail(software.amazon.jsii.JsiiObjectRef objRef) -
Guardrail
protected Guardrail(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
enable
@Stability(Stable) @NotNull public static Guardrail enable(@NotNull String identifier, @NotNull Number version) Enable guardrail.- Parameters:
identifier
- The id or arn of the guardrail. This parameter is required.version
- The version of the guardrail. This parameter is required.
-
enableDraft
Enable guardrail with DRAFT version.- Parameters:
identifier
- The identifier of the guardrail. This parameter is required.
-
getGuardrailIdentifier
The identitifier of guardrail. -
getGuardrailVersion
The version of guardrail.
-