Skip to content
v2.274.0

PromptVariantProperty Struct ​

Contains details about a variant of the prompt.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrock as bedrock } from 'aws-cdk-lib';

declare const additionalModelRequestFields: any;
declare const any: any;
declare const auto: any;
declare const json: any;
const promptVariantProperty: bedrock.CfnPrompt.PromptVariantProperty = {
  name: 'name',
  templateConfiguration: {
    chat: {
      messages: [{
        content: [{
          cachePoint: {
            type: 'type',
          },
          text: 'text',
        }],
        role: 'role',
      }],

      // the properties below are optional
      inputVariables: [{
        name: 'name',
      }],
      system: [{
        cachePoint: {
          type: 'type',
        },
        text: 'text',
      }],
      toolConfiguration: {
        tools: [{
          cachePoint: {
            type: 'type',
          },
          toolSpec: {
            inputSchema: {
              json: json,
            },
            name: 'name',

            // the properties below are optional
            description: 'description',
          },
        }],

        // the properties below are optional
        toolChoice: {
          any: any,
          auto: auto,
          tool: {
            name: 'name',
          },
        },
      },
    },
    text: {
      cachePoint: {
        type: 'type',
      },
      inputVariables: [{
        name: 'name',
      }],
      text: 'text',
      textS3Location: {
        bucket: 'bucket',
        key: 'key',

        // the properties below are optional
        version: 'version',
      },
    },
  },
  templateType: 'templateType',

  // the properties below are optional
  additionalModelRequestFields: additionalModelRequestFields,
  genAiResource: {
    agent: {
      agentIdentifier: 'agentIdentifier',
    },
  },
  inferenceConfiguration: {
    text: {
      maxTokens: 123,
      stopSequences: ['stopSequences'],
      temperature: 123,
      topP: 123,
    },
  },
  metadata: [{
    key: 'key',
    value: 'value',
  }],
  modelId: 'modelId',
};

Properties ​

additionalModelRequestFieldsanyadditional_model_request_fieldsAnyadditionalModelRequestFieldsObjectAdditionalModelRequestFieldsobjectAdditionalModelRequestFieldsinterface{}#
Contains model-specific inference configurations that aren't in the `inferenceConfiguration` field.

To see model-specific inference parameters, see Inference request parameters and response fields for foundation models .

genAiResourceIResolvable | CfnPrompt.PromptGenAiResourcePropertygen_ai_resourcetyping.Union[IResolvable, PromptGenAiResourceProperty]genAiResourceIResolvableGenAiResourceIResolvableGenAiResourceinterface{}#
Specifies a generative AI resource with which to use the prompt.
inferenceConfigurationIResolvable | CfnPrompt.PromptInferenceConfigurationPropertyinference_configurationtyping.Union[IResolvable, PromptInferenceConfigurationProperty]inferenceConfigurationIResolvableInferenceConfigurationIResolvableInferenceConfigurationinterface{}#
Contains inference configurations for the prompt variant.
metadataIResolvable | IResolvable | CfnPrompt.PromptMetadataEntryProperty[]metadatatyping.Union[IResolvable, typing.List[typing.Union[IResolvable, PromptMetadataEntryProperty]]]metadataIResolvableMetadataIResolvableMetadatainterface{}#
An array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant.
modelIdstringmodel_idstrmodelIdStringModelIdstringModelId*string#
The unique identifier of the model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) with which to run inference on the prompt.
namestringnamestrnameStringNamestringName*stringrequired#
The name of the prompt variant.
templateConfigurationIResolvable | CfnPrompt.PromptTemplateConfigurationPropertytemplate_configurationtyping.Union[IResolvable, PromptTemplateConfigurationProperty]templateConfigurationIResolvableTemplateConfigurationIResolvableTemplateConfigurationinterface{}required#
Contains configurations for the prompt template.
templateTypestringtemplate_typestrtemplateTypeStringTemplateTypestringTemplateType*stringrequired#
The type of prompt template to use.