Interface PromptProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
PromptProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)", date="2025-09-02T11:25:42.847Z") @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();
 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();
 
  • 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