Experimental
@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
PromptTemplateConfiguration Class
Abstract base class for prompt template configurations.
This provides a high-level abstraction over the underlying CloudFormation template configuration properties, offering a more developer-friendly interface while maintaining full compatibility with the underlying AWS Bedrock service.
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 promptTemplateConfiguration = bedrock_alpha.PromptTemplateConfiguration.chat({
messages: [chatMessage],
// the properties below are optional
inputVariables: ['inputVariables'],
system: 'system',
toolConfiguration: {
toolChoice: toolChoice,
tools: [tool],
},
});
Initializer
ts
new PromptTemplateConfiguration()
python
PromptTemplateConfiguration()
java
new PromptTemplateConfiguration()
csharp
new PromptTemplateConfiguration()
go
NewPromptTemplateConfiguration()
Methods
chat(props: ChatTemplateConfigurationProps): PromptTemplateConfiguration // chainable@staticmethod def chat(props: ChatTemplateConfigurationProps) -> PromptTemplateConfigurationpublic static PromptTemplateConfiguration chat(ChatTemplateConfigurationProps props)public static PromptTemplateConfiguration Chat(ChatTemplateConfigurationProps props)func Chat(Props ChatTemplateConfigurationProps) PromptTemplateConfigurationstatic#Creates a chat template configuration.
text(props: TextTemplateConfigurationProps): PromptTemplateConfiguration // chainable@staticmethod def text(props: TextTemplateConfigurationProps) -> PromptTemplateConfigurationpublic static PromptTemplateConfiguration text(TextTemplateConfigurationProps props)public static PromptTemplateConfiguration Text(TextTemplateConfigurationProps props)func Text(Props TextTemplateConfigurationProps) PromptTemplateConfigurationstatic#Creates a text template configuration.