interface PromptVersionProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Bedrock.Alpha.PromptVersionProps |
![]() | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#PromptVersionProps |
![]() | software.amazon.awscdk.services.bedrock.alpha.PromptVersionProps |
![]() | aws_cdk.aws_bedrock_alpha.PromptVersionProps |
![]() | @aws-cdk/aws-bedrock-alpha » PromptVersionProps |
Properties for creating a CDK managed Bedrock Prompt Version.
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,
});
const promptVersion = new bedrock.PromptVersion(this, 'MyPromptVersion', {
prompt: prompt1,
description: 'my first version',
});
//or alternatively:
// const promptVersion = prompt1.createVersion('my first version');
const versionString = promptVersion.version;
Properties
Name | Type | Description |
---|---|---|
prompt | IPrompt | The prompt to use for this version. |
description? | string | The description of the prompt version. |
prompt
Type:
IPrompt
The prompt to use for this version.
description?
Type:
string
(optional, default: No description provided.
Maximum length: 200)
The description of the prompt version.