Class CfnPrompt

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:39.618Z") @Stability(Stable) public class CfnPrompt extends CfnResource implements IInspectable, ITaggableV2
Creates a prompt in your prompt library that you can add to a flow.

For more information, see Prompt management in Amazon Bedrock , Create a prompt using Prompt management and Prompt flows in Amazon Bedrock in the Amazon Bedrock User Guide.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.bedrock.*;
 CfnPrompt cfnPrompt = CfnPrompt.Builder.create(this, "MyCfnPrompt")
         .name("name")
         // the properties below are optional
         .customerEncryptionKeyArn("customerEncryptionKeyArn")
         .defaultVariant("defaultVariant")
         .description("description")
         .tags(Map.of(
                 "tagsKey", "tags"))
         .variants(List.of(PromptVariantProperty.builder()
                 .name("name")
                 .templateType("templateType")
                 // the properties below are optional
                 .inferenceConfiguration(PromptInferenceConfigurationProperty.builder()
                         .text(PromptModelInferenceConfigurationProperty.builder()
                                 .maxTokens(123)
                                 .stopSequences(List.of("stopSequences"))
                                 .temperature(123)
                                 .topK(123)
                                 .topP(123)
                                 .build())
                         .build())
                 .modelId("modelId")
                 .templateConfiguration(PromptTemplateConfigurationProperty.builder()
                         .text(TextPromptTemplateConfigurationProperty.builder()
                                 .inputVariables(List.of(PromptInputVariableProperty.builder()
                                         .name("name")
                                         .build()))
                                 .text("text")
                                 .textS3Location(TextS3LocationProperty.builder()
                                         .bucket("bucket")
                                         .key("key")
                                         // the properties below are optional
                                         .version("version")
                                         .build())
                                 .build())
                         .build())
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnPrompt

      protected CfnPrompt(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnPrompt

      protected CfnPrompt(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnPrompt

      @Stability(Stable) public CfnPrompt(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnPromptProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the prompt or the prompt version (if you specified a version in the request).
    • getAttrCreatedAt

      @Stability(Stable) @NotNull public String getAttrCreatedAt()
      The time at which the prompt was created.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The unique identifier of the prompt.
    • getAttrUpdatedAt

      @Stability(Stable) @NotNull public String getAttrUpdatedAt()
      The time at which the prompt was last updated.
    • getAttrVersion

      @Stability(Stable) @NotNull public String getAttrVersion()
      The version of the prompt that this summary applies to.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getName

      @Stability(Stable) @NotNull public String getName()
      The name of the prompt.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name of the prompt.
    • getCustomerEncryptionKeyArn

      @Stability(Stable) @Nullable public String getCustomerEncryptionKeyArn()
      The Amazon Resource Name (ARN) of the KMS key that the prompt is encrypted with.
    • setCustomerEncryptionKeyArn

      @Stability(Stable) public void setCustomerEncryptionKeyArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the KMS key that the prompt is encrypted with.
    • getDefaultVariant

      @Stability(Stable) @Nullable public String getDefaultVariant()
      The name of the default variant for the prompt.
    • setDefaultVariant

      @Stability(Stable) public void setDefaultVariant(@Nullable String value)
      The name of the default variant for the prompt.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the prompt.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the prompt.
    • getTags

      @Stability(Stable) @Nullable public Map<String,String> getTags()
      Metadata that you can assign to a resource as key-value pairs.

      For more information, see the following resources:.

    • setTags

      @Stability(Stable) public void setTags(@Nullable Map<String,String> value)
      Metadata that you can assign to a resource as key-value pairs.

      For more information, see the following resources:.

    • getVariants

      @Stability(Stable) @Nullable public Object getVariants()
      A list of objects, each containing details about a variant of the prompt.
    • setVariants

      @Stability(Stable) public void setVariants(@Nullable IResolvable value)
      A list of objects, each containing details about a variant of the prompt.
    • setVariants

      @Stability(Stable) public void setVariants(@Nullable List<Object> value)
      A list of objects, each containing details about a variant of the prompt.