Skip to content
v2.275.0

Experimental

@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

PromptInferenceConfigurationProps Struct ​

Properties for creating a prompt inference configuration.

Example ​

ts
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 ​

maxTokensoptionalnumbermax_tokensoptionalint | floatmaxTokensoptionalNumberMaxTokensoptionaldoubleMaxTokensoptional*float64#
The maximum number of tokens to return in the response.

Default: No limit specified

stopSequencesoptionalstring[]stop_sequencesoptionaltyping.List[str]stopSequencesoptionalList<String>StopSequencesoptionalstring[]StopSequencesoptional*[]*string#
A list of strings that define sequences after which the model will stop generating.

Default: No stop sequences

temperatureoptionalnumbertemperatureoptionalint | floattemperatureoptionalNumberTemperatureoptionaldoubleTemperatureoptional*float64#
Controls the randomness of the response.

Default: Model default temperature

Higher values make output more random, lower values more deterministic. Valid range is 0.0 to 1.0.

topPoptionalnumbertop_poptionalint | floattopPoptionalNumberTopPoptionaldoubleTopPoptional*float64#
The percentage of most-likely candidates that the model considers for the next token.

Default: Model default topP

Valid range is 0.0 to 1.0.