interface TextPromptVariantProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Alpha.TextPromptVariantProps |
Go | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#TextPromptVariantProps |
Java | software.amazon.awscdk.services.bedrock.alpha.TextPromptVariantProps |
Python | aws_cdk.aws_bedrock_alpha.TextPromptVariantProps |
TypeScript (source) | @aws-cdk/aws-bedrock-alpha ยป TextPromptVariantProps |
Properties for creating a text prompt variant.
Example
const cmk = new kms.Key(this, 'cmk', {});
const claudeModel = bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0;
const variant1 = bedrock.PromptVariant.text({
variantName: 'variant1',
model: claudeModel,
promptVariables: ['topic'],
promptText: 'This is my first text prompt. Please summarize our conversation on: {{topic}}.',
inferenceConfiguration: bedrock.PromptInferenceConfiguration.text({
temperature: 1.0,
topP: 0.999,
maxTokens: 2000,
}),
});
const prompt1 = new bedrock.Prompt(this, 'prompt1', {
promptName: 'prompt1',
description: 'my first prompt',
defaultVariant: variant1,
variants: [variant1],
kmsKey: cmk,
});
Properties
| Name | Type | Description |
|---|---|---|
| model | IBedrock | The model which is used to run the prompt. |
| prompt | string | The text prompt. |
| variant | string | The name of the prompt variant. |
| inference | Prompt | Inference configuration for the Text Prompt. |
| prompt | string[] | The variables in the prompt template that can be filled in at runtime. |
model
Type:
IBedrock
The model which is used to run the prompt.
The model could be a foundation model, a custom model, or a provisioned model.
promptText
Type:
string
The text prompt.
Variables are used by enclosing its name with double curly braces
as in {{variable_name}}.
variantName
Type:
string
The name of the prompt variant.
inferenceConfiguration?
Type:
Prompt
(optional, default: No inference configuration provided.)
Inference configuration for the Text Prompt.
promptVariables?
Type:
string[]
(optional, default: No variables defined.)
The variables in the prompt template that can be filled in at runtime.

.NET
Go
Java
Python
TypeScript (