> **Experimental**
>
> `@aws-cdk/aws-bedrock-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# ChatPromptVariantProps

Properties for creating a chat prompt variant.

Extends: ChatPromptVariantProps
Extends: CommonPromptVariantProps

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`bedrock/prompts/chat-prompt-variant.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0-alpha.0/packages/@aws-cdk/aws-bedrock-alpha/bedrock/prompts/chat-prompt-variant.ts#L13)

## Example

```ts
const cmk = new kms.Key(this, 'cmk', {});

const variantChat = bedrock.PromptVariant.chat({
  variantName: 'variant1',
  model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,
  messages: [
    bedrock.ChatMessage.user('From now on, you speak Japanese!'),
    bedrock.ChatMessage.assistant('Konnichiwa!'),
    bedrock.ChatMessage.user('From now on, you speak {{language}}!'),
  ],
  system: 'You are a helpful assistant that only speaks the language you`re told.',
  promptVariables: ['language'],
  toolConfiguration: {
    toolChoice: bedrock.ToolChoice.AUTO,
    tools: [
      bedrock.Tool.function({
        name: 'top_song',
        description: 'Get the most popular song played on a radio station.',
        inputSchema: {
          type: 'object',
          properties: {
            sign: {
              type: 'string',
              description: 'The call sign for the radio station for which you want the most popular song. Example calls signs are WZPZ and WKR.',
            },
          },
          required: ['sign'],
        },
      }),
    ],
  },
});

new bedrock.Prompt(this, 'prompt1', {
  promptName: 'prompt-chat',
  description: 'my first chat prompt',
  defaultVariant: variantChat,
  variants: [variantChat],
  kmsKey: cmk,
});
```

## Properties

- `inferenceConfiguration`: [PromptInferenceConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.PromptInferenceConfiguration.html) — Inference configuration for the Chat Prompt.

  **Default:** No inference configuration provided.

- `messages`: [ChatMessage](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.ChatMessage.html)[] (required) — The messages in the chat prompt.

  Must include at least one User Message.
  The messages should alternate between User and Assistant.

- `model`: [IBedrockInvokable](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.IBedrockInvokable.html) (required) — The model which is used to run the prompt.

  The model could be a foundation
  model, a custom model, or a provisioned model.

- `promptVariables`: string[] — The variables in the prompt template that can be filled in at runtime.

  **Default:** No variables defined.

- `system`: string — Context or instructions for the model to consider before generating a response.

  **Default:** No system message provided.

- `toolConfiguration`: [ToolConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.ToolConfiguration.html) — The configuration with available tools to the model and how it must use them.

  **Default:** No tool configuration provided.

- `variantName`: string (required) — The name of the prompt variant.
