interface PromptInferenceConfigurationProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Bedrock.Alpha.PromptInferenceConfigurationProps |
![]() | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#PromptInferenceConfigurationProps |
![]() | software.amazon.awscdk.services.bedrock.alpha.PromptInferenceConfigurationProps |
![]() | aws_cdk.aws_bedrock_alpha.PromptInferenceConfigurationProps |
![]() | @aws-cdk/aws-bedrock-alpha ยป PromptInferenceConfigurationProps |
Properties for creating a prompt inference configuration.
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 |
---|---|---|
max | number | The maximum number of tokens to return in the response. |
stop | string[] | A list of strings that define sequences after which the model will stop generating. |
temperature? | number | Controls the randomness of the response. |
top | number | The percentage of most-likely candidates that the model considers for the next token. |
maxTokens?
Type:
number
(optional, default: No limit specified)
The maximum number of tokens to return in the response.
stopSequences?
Type:
string[]
(optional, default: No stop sequences)
A list of strings that define sequences after which the model will stop generating.
temperature?
Type:
number
(optional, default: Model default temperature)
Controls the randomness of the response.
Higher values make output more random, lower values more deterministic. Valid range is 0.0 to 1.0.
topP?
Type:
number
(optional, default: Model default topP)
The percentage of most-likely candidates that the model considers for the next token.
Valid range is 0.0 to 1.0.