Class PromptVersion
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.services.bedrock.alpha.PromptVersion
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)",
date="2025-07-24T11:33:25.575Z")
@Stability(Experimental)
public class PromptVersion
extends software.constructs.Construct
(experimental) Class to create a Prompt Version with CDK.
Creates a version of the prompt. Use this to create a static snapshot of your prompt that can be deployed to production. Versions allow you to easily switch between different configurations for your prompt and update your application with the most appropriate version for your use-case.
Example:
Key cmk = Key.Builder.create(this, "cmk").build(); BedrockFoundationModel claudeModel = BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0; IPromptVariant variant1 = PromptVariant.text(TextPromptVariantProps.builder() .variantName("variant1") .model(claudeModel) .promptVariables(List.of("topic")) .promptText("This is my first text prompt. Please summarize our conversation on: {{topic}}.") .inferenceConfiguration(PromptInferenceConfiguration.text(PromptInferenceConfigurationProps.builder() .temperature(1) .topP(0.999) .maxTokens(2000) .build())) .build()); Prompt prompt1 = Prompt.Builder.create(this, "prompt1") .promptName("prompt1") .description("my first prompt") .defaultVariant(variant1) .variants(List.of(variant1)) .kmsKey(cmk) .build(); PromptVersion promptVersion = PromptVersion.Builder.create(this, "MyPromptVersion") .prompt(prompt1) .description("my first version") .build(); //or alternatively: // const promptVersion = prompt1.createVersion('my first version'); String versionString = promptVersion.getVersion();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
(experimental) A fluent builder forPromptVersion
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PromptVersion
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
PromptVersion
(software.amazon.jsii.JsiiObjectRef objRef) PromptVersion
(software.constructs.Construct scope, String id, PromptVersionProps props) (experimental) **************************************************************************** CONSTRUCTOR ***************************************************************************. -
Method Summary
Modifier and TypeMethodDescription(experimental) The description of the prompt version.(experimental) The prompt used by this version.(experimental) The version of the prompt that was created.(experimental) The Amazon Resource Name (ARN) of the prompt version.Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
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, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
PromptVersion
protected PromptVersion(software.amazon.jsii.JsiiObjectRef objRef) -
PromptVersion
protected PromptVersion(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
PromptVersion
@Stability(Experimental) public PromptVersion(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull PromptVersionProps props) (experimental) **************************************************************************** CONSTRUCTOR ***************************************************************************.- Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
getPrompt
(experimental) The prompt used by this version. -
getVersion
(experimental) The version of the prompt that was created. -
getVersionArn
(experimental) The Amazon Resource Name (ARN) of the prompt version.Example:
"arn:aws:bedrock:us-east-1:123456789012:prompt/PROMPT12345:1";
-
getDescription
(experimental) The description of the prompt version.
-