Class CfnPrompt
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.bedrock.CfnPrompt
- All Implemented Interfaces:
IInspectable
,ITaggableV2
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.106.0 (build e852934)",
date="2025-02-05T22:42:00.175Z")
@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.*; Object any; Object auto; Object json; 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") .templateConfiguration(PromptTemplateConfigurationProperty.builder() .chat(ChatPromptTemplateConfigurationProperty.builder() .messages(List.of(MessageProperty.builder() .content(List.of(ContentBlockProperty.builder() .text("text") .build())) .role("role") .build())) // the properties below are optional .inputVariables(List.of(PromptInputVariableProperty.builder() .name("name") .build())) .system(List.of(SystemContentBlockProperty.builder() .text("text") .build())) .toolConfiguration(ToolConfigurationProperty.builder() .tools(List.of(ToolProperty.builder() .toolSpec(ToolSpecificationProperty.builder() .inputSchema(ToolInputSchemaProperty.builder() .json(json) .build()) .name("name") // the properties below are optional .description("description") .build()) .build())) // the properties below are optional .toolChoice(ToolChoiceProperty.builder() .any(any) .auto(auto) .tool(SpecificToolChoiceProperty.builder() .name("name") .build()) .build()) .build()) .build()) .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()) .templateType("templateType") // the properties below are optional .genAiResource(PromptGenAiResourceProperty.builder() .agent(PromptAgentResourceProperty.builder() .agentIdentifier("agentIdentifier") .build()) .build()) .inferenceConfiguration(PromptInferenceConfigurationProperty.builder() .text(PromptModelInferenceConfigurationProperty.builder() .maxTokens(123) .stopSequences(List.of("stopSequences")) .temperature(123) .topP(123) .build()) .build()) .modelId("modelId") .build())) .build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A fluent builder forCfnPrompt
.static interface
Contains configurations to use a prompt in a conversational format.static interface
A block of content for a message that you pass to, or receive from, a model with the Converse or ConverseStream API operations.static interface
A message input, or returned from, a call to Converse or ConverseStream .static interface
Contains specifications for an Amazon Bedrock agent with which to use the prompt.static interface
Contains specifications for a generative AI resource with which to use the prompt.static interface
Contains inference configurations for the prompt.static interface
Contains information about a variable in the prompt.static interface
Contains inference configurations related to model inference for a prompt.static interface
Contains the message for a prompt.static interface
Contains details about a variant of the prompt.static interface
The model must request a specific tool.static interface
Contains configurations for instructions to provide the model for how to handle input.static interface
Contains configurations for a text prompt template.static interface
The Amazon S3 location of the prompt text.static interface
Determines which tools the model should request in a call toConverse
orConverseStream
.static interface
Configuration information for the tools that you pass to a model.static interface
The schema for the tool.static interface
Information about a tool that you can use with the Converse API.static interface
The specification for the tool.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
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CfnPrompt
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnPrompt
(software.amazon.jsii.JsiiObjectRef objRef) CfnPrompt
(software.constructs.Construct scope, String id, CfnPromptProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe Amazon Resource Name (ARN) of the prompt or the prompt version (if you specified a version in the request).The time at which the prompt was created.The unique identifier of the prompt.The time at which the prompt was last updated.The version of the prompt that this summary applies to.Tag Manager which manages the tags for this resource.The Amazon Resource Name (ARN) of the KMS key that the prompt is encrypted with.The name of the default variant for the prompt.The description of the prompt.getName()
The name of the prompt.getTags()
Metadata that you can assign to a resource as key-value pairs.A list of objects, each containing details about a variant of the prompt.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
The Amazon Resource Name (ARN) of the KMS key that the prompt is encrypted with.void
setDefaultVariant
(String value) The name of the default variant for the prompt.void
setDescription
(String value) The description of the prompt.void
The name of the prompt.void
Metadata that you can assign to a resource as key-value pairs.void
setVariants
(List<Object> value) A list of objects, each containing details about a variant of the prompt.void
setVariants
(IResolvable value) A list of objects, each containing details about a variant of the prompt.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
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
-
Field Details
-
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
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- 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 classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the prompt or the prompt version (if you specified a version in the request). -
getAttrCreatedAt
The time at which the prompt was created. -
getAttrId
The unique identifier of the prompt. -
getAttrUpdatedAt
The time at which the prompt was last updated. -
getAttrVersion
The version of the prompt that this summary applies to. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManager
in interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getName
The name of the prompt. -
setName
The name of the prompt. -
getCustomerEncryptionKeyArn
The Amazon Resource Name (ARN) of the KMS key that the prompt is encrypted with. -
setCustomerEncryptionKeyArn
The Amazon Resource Name (ARN) of the KMS key that the prompt is encrypted with. -
getDefaultVariant
The name of the default variant for the prompt. -
setDefaultVariant
The name of the default variant for the prompt. -
getDescription
The description of the prompt. -
setDescription
The description of the prompt. -
getTags
Metadata that you can assign to a resource as key-value pairs.For more information, see the following resources:.
-
setTags
Metadata that you can assign to a resource as key-value pairs.For more information, see the following resources:.
-
getVariants
A list of objects, each containing details about a variant of the prompt. -
setVariants
A list of objects, each containing details about a variant of the prompt. -
setVariants
A list of objects, each containing details about a variant of the prompt.
-