Skip to content
v2.277.0

Experimental

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

ChatTemplateConfigurationProps Struct ​

Properties for creating a chat template configuration.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_alpha from '@aws-cdk/aws-bedrock-alpha';

declare const chatMessage: bedrock_alpha.ChatMessage;
declare const tool: bedrock_alpha.Tool;
declare const toolChoice: bedrock_alpha.ToolChoice;
const chatTemplateConfigurationProps: bedrock_alpha.ChatTemplateConfigurationProps = {
  messages: [chatMessage],

  // the properties below are optional
  inputVariables: ['inputVariables'],
  system: 'system',
  toolConfiguration: {
    toolChoice: toolChoice,
    tools: [tool],
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_alpha as bedrock_alpha

# chat_message: bedrock_alpha.ChatMessage
# tool: bedrock_alpha.Tool
# tool_choice: bedrock_alpha.ToolChoice

chat_template_configuration_props = bedrock_alpha.ChatTemplateConfigurationProps(
    messages=[chat_message],

    # the properties below are optional
    input_variables=["inputVariables"],
    system="system",
    tool_configuration=bedrock_alpha.ToolConfiguration(
        tool_choice=tool_choice,
        tools=[tool]
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.alpha.*;

ChatMessage chatMessage;
Tool tool;
ToolChoice toolChoice;

ChatTemplateConfigurationProps chatTemplateConfigurationProps = ChatTemplateConfigurationProps.builder()
        .messages(List.of(chatMessage))

        // the properties below are optional
        .inputVariables(List.of("inputVariables"))
        .system("system")
        .toolConfiguration(ToolConfiguration.builder()
                .toolChoice(toolChoice)
                .tools(List.of(tool))
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Alpha;

ChatMessage chatMessage;
Tool tool;
ToolChoice toolChoice;

var chatTemplateConfigurationProps = new ChatTemplateConfigurationProps {
    Messages = new [] { chatMessage },

    // the properties below are optional
    InputVariables = new [] { "inputVariables" },
    System = "system",
    ToolConfiguration = new ToolConfiguration {
        ToolChoice = toolChoice,
        Tools = new [] { tool }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockalpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import bedrock_alpha "github.com/aws/aws-cdk-go/awsbedrockalpha"

var chatMessage ChatMessage
var tool Tool
var toolChoice ToolChoice

chatTemplateConfigurationProps := &ChatTemplateConfigurationProps{
	Messages: []ChatMessage{
		chatMessage,
	},

	// the properties below are optional
	InputVariables: []*string{
		jsii.String("inputVariables"),
	},
	System: jsii.String("system"),
	ToolConfiguration: &ToolConfiguration{
		ToolChoice: toolChoice,
		Tools: []Tool{
			tool,
		},
	},
}

Properties ​

inputVariablesoptionalstring[]input_variablesoptionaltyping.List[str]inputVariablesoptionalList<String>InputVariablesoptionalstring[]InputVariablesoptional*[]*string #
The input variables for the template.

Default: No input variables

messagesChatMessage[]messagestyping.List[ChatMessage]messagesList<ChatMessage>MessagesChatMessage[]Messages*[]ChatMessage required #
The messages in the chat template.
systemoptionalstringsystemoptionalstrsystemoptionalStringSystemoptionalstringSystemoptional*string #
The system message for the chat template.

Default: No system message

toolConfigurationoptionalToolConfigurationtool_configurationoptionalToolConfigurationtoolConfigurationoptionalToolConfigurationToolConfigurationoptionalToolConfigurationToolConfigurationoptionalToolConfiguration #
The tool configuration for the chat template.

Default: No tool configuration