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();
 
  • Method Details

    • getPromptName

      @Stability(Experimental) @NotNull String 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

      @Stability(Experimental) @Nullable default IPromptVariant getDefaultVariant()
      (experimental) The Prompt Variant that will be used by default.

      Default: - No default variant provided.

    • getDescription

      @Stability(Experimental) @Nullable default String getDescription()
      (experimental) A description of what the prompt does.

      Default: - No description provided. Maximum Length: 200

    • getKmsKey

      @Stability(Experimental) @Nullable default IKey getKmsKey()
      (experimental) The KMS key that the prompt is encrypted with.

      Default: - AWS owned and managed key.

    • getTags

      @Stability(Experimental) @Nullable default Map<String,String> getTags()
      (experimental) Tags to apply to the prompt.

      Default: - No tags applied.

    • getVariants

      @Stability(Experimental) @Nullable default List<IPromptVariant> 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

      @Stability(Experimental) static PromptProps.Builder builder()
      Returns:
      a PromptProps.Builder of PromptProps