Interface ChatPromptVariantProps
- All Superinterfaces:
CommonPromptVariantProps
,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
ChatPromptVariantProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)",
date="2025-08-05T19:18:43.771Z")
@Stability(Experimental)
public interface ChatPromptVariantProps
extends software.amazon.jsii.JsiiSerializable, CommonPromptVariantProps
(experimental) Properties for creating a chat prompt variant.
Example:
Key cmk = Key.Builder.create(this, "cmk").build(); IPromptVariant variantChat = PromptVariant.chat(ChatPromptVariantProps.builder() .variantName("variant1") .model(BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0) .messages(List.of(ChatMessage.user("From now on, you speak Japanese!"), ChatMessage.assistant("Konnichiwa!"), ChatMessage.user("From now on, you speak {{language}}!"))) .system("You are a helpful assistant that only speaks the language you`re told.") .promptVariables(List.of("language")) .toolConfiguration(ToolConfiguration.builder() .toolChoice(ToolChoice.AUTO) .tools(List.of(Tool.function(FunctionToolProps.builder() .name("top_song") .description("Get the most popular song played on a radio station.") .inputSchema(Map.of( "type", "object", "properties", Map.of( "sign", Map.of( "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", List.of("sign"))) .build()))) .build()) .build()); Prompt.Builder.create(this, "prompt1") .promptName("prompt-chat") .description("my first chat prompt") .defaultVariant(variantChat) .variants(List.of(variantChat)) .kmsKey(cmk) .build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
A builder forChatPromptVariantProps
static final class
An implementation forChatPromptVariantProps
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default PromptInferenceConfiguration
(experimental) Inference configuration for the Chat Prompt.(experimental) The messages in the chat prompt.default String
(experimental) Context or instructions for the model to consider before generating a response.default ToolConfiguration
(experimental) The configuration with available tools to the model and how it must use them.Methods inherited from interface software.amazon.awscdk.services.bedrock.alpha.CommonPromptVariantProps
getModel, getPromptVariables, getVariantName
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getMessages
(experimental) The messages in the chat prompt.Must include at least one User Message. The messages should alternate between User and Assistant.
-
getInferenceConfiguration
(experimental) Inference configuration for the Chat Prompt.Default: - No inference configuration provided.
-
getSystem
(experimental) Context or instructions for the model to consider before generating a response.Default: - No system message provided.
-
getToolConfiguration
(experimental) The configuration with available tools to the model and how it must use them.Default: - No tool configuration provided.
-
builder
- Returns:
- a
ChatPromptVariantProps.Builder
ofChatPromptVariantProps
-