Abstract Class: PromptVariant
March 19, 2026 ยท View on GitHub
@cdklabs/generative-ai-cdk-constructs
@cdklabs/generative-ai-cdk-constructs / bedrock / PromptVariant
Abstract Class: PromptVariant
Variants are specific sets of inputs that guide FMs on Amazon Bedrock to generate an appropriate response or output for a given task or instruction. You can optimize the prompt for specific use cases and models.
Constructors
Constructor
protectednew PromptVariant():PromptVariant
Returns
PromptVariant
Properties
genAiResource?
abstractoptionalgenAiResource?:PromptGenAiResourceProperty
The template configuration.
inferenceConfiguration?
abstractoptionalinferenceConfiguration?:PromptInferenceConfigurationProperty
The inference configuration.
modelId?
abstractoptionalmodelId?:string
The unique identifier of the model with which to run inference on the prompt.
name
abstractname:string
The name of the prompt variant.
templateConfiguration
abstracttemplateConfiguration:PromptTemplateConfigurationProperty
The template configuration.
templateType
abstracttemplateType:PromptTemplateType
The type of prompt template.
Methods
agent()
staticagent(props):PromptVariant
Static method to create an agent prompt template.
Parameters
props
Returns
PromptVariant
chat()
staticchat(props):PromptVariant
Static method to create a chat template. Use this template type when the model supports the Converse API or the AnthropicClaude Messages API. This allows you to include a System prompt and previous User messages and Assistant messages for context.
Parameters
props
Returns
PromptVariant
text()
statictext(props):PromptVariant
Static method to create a text template
Parameters
props
Returns
PromptVariant