Interface PromptProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
PromptProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)",
date="2025-07-29T17:51:11.511Z")
@Stability(Experimental)
public interface PromptProps
extends software.amazon.jsii.JsiiSerializable
(experimental) Properties for creating a CDK managed Bedrock Prompt.
Example:
Key cmk = Key.Builder.create(this, "cmk").build(); // Assuming you have an existing agent and alias IAgent agent = Agent.fromAgentAttributes(this, "ImportedAgent", AgentAttributes.builder() .agentArn("arn:aws:bedrock:region:account:agent/agent-id") .roleArn("arn:aws:iam::account:role/agent-role") .build()); IAgentAlias agentAlias = AgentAlias.fromAttributes(this, "ImportedAlias", AgentAliasAttributes.builder() .aliasId("alias-id") .aliasName("my-alias") .agentVersion("1") .agent(agent) .build()); IPromptVariant agentVariant = PromptVariant.agent(AgentPromptVariantProps.builder() .variantName("agent-variant") .model(BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0) .agentAlias(agentAlias) .promptText("Use the agent to help with: {{task}}. Please be thorough and provide detailed explanations.") .promptVariables(List.of("task")) .build()); Prompt.Builder.create(this, "agentPrompt") .promptName("agent-prompt") .description("Prompt for agent interactions") .defaultVariant(agentVariant) .variants(List.of(agentVariant)) .kmsKey(cmk) .build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
A builder forPromptProps
static final class
An implementation forPromptProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic PromptProps.Builder
builder()
default IPromptVariant
(experimental) The Prompt Variant that will be used by default.default String
(experimental) A description of what the prompt does.default IKey
(experimental) The KMS key that the prompt is encrypted with.(experimental) The name of the prompt.getTags()
(experimental) Tags to apply to the prompt.default List
<IPromptVariant> (experimental) The variants of your prompt.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getPromptName
(experimental) The name of the prompt.This will be used as the physical name of the prompt. Allowed Pattern: ^([0-9a-zA-Z][_-]?){1,100}$
-
getDefaultVariant
(experimental) The Prompt Variant that will be used by default.Default: - No default variant provided.
-
getDescription
(experimental) A description of what the prompt does.Default: - No description provided. Maximum Length: 200
-
getKmsKey
(experimental) The KMS key that the prompt is encrypted with.Default: - AWS owned and managed key.
-
getTags
(experimental) Tags to apply to the prompt.Default: - No tags applied.
-
getVariants
(experimental) The variants of your prompt.Variants can use different messages, models, or configurations so that you can compare their outputs to decide the best variant for your use case. Maximum of 1 variants.
Default: - No additional variants provided.
-
builder
- Returns:
- a
PromptProps.Builder
ofPromptProps
-