Class: AWSCDK::Bedrock::CfnPromptVersion::ChatPromptTemplateConfigurationProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Bedrock::CfnPromptVersion::ChatPromptTemplateConfigurationProperty
- Defined in:
- bedrock/cfn_prompt_version.rb
Overview
Contains configurations to use a prompt in a conversational format.
For more information, see Create a prompt using Prompt management .
Instance Attribute Summary collapse
-
#input_variables ⇒ AWSCDK::IResolvable, ...
readonly
An array of the variables in the prompt template.
-
#messages ⇒ AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Bedrock::CfnPromptVersion::MessageProperty>
readonly
Contains messages in the chat for the prompt.
-
#system ⇒ AWSCDK::IResolvable, ...
readonly
Contains system prompts to provide context to the model or to describe how it should behave.
-
#tool_configuration ⇒ AWSCDK::IResolvable, ...
readonly
Configuration information for the tools that the model can use when generating a response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(messages:, input_variables: nil, system: nil, tool_configuration: nil) ⇒ ChatPromptTemplateConfigurationProperty
constructor
A new instance of ChatPromptTemplateConfigurationProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(messages:, input_variables: nil, system: nil, tool_configuration: nil) ⇒ ChatPromptTemplateConfigurationProperty
Returns a new instance of ChatPromptTemplateConfigurationProperty.
648 649 650 651 652 653 654 655 656 657 |
# File 'bedrock/cfn_prompt_version.rb', line 648 def initialize(messages:, input_variables: nil, system: nil, tool_configuration: nil) @messages = Jsii::Type.check_type(@messages, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHRWZXJzaW9uLk1lc3NhZ2VQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "messages") @input_variables = input_variables Jsii::Type.check_type(@input_variables, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHRWZXJzaW9uLlByb21wdElucHV0VmFyaWFibGVQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "inputVariables") unless @input_variables.nil? @system = system Jsii::Type.check_type(@system, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHRWZXJzaW9uLlN5c3RlbUNvbnRlbnRCbG9ja1Byb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "system") unless @system.nil? @tool_configuration = tool_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPromptVersion::ToolConfigurationProperty.new(**tool_configuration.transform_keys(&:to_sym)) : tool_configuration Jsii::Type.check_type(@tool_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdFZlcnNpb24uVG9vbENvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "toolConfiguration") unless @tool_configuration.nil? end |
Instance Attribute Details
#input_variables ⇒ AWSCDK::IResolvable, ... (readonly)
An array of the variables in the prompt template.
668 669 670 |
# File 'bedrock/cfn_prompt_version.rb', line 668 def input_variables @input_variables end |
#messages ⇒ AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Bedrock::CfnPromptVersion::MessageProperty> (readonly)
Contains messages in the chat for the prompt.
663 664 665 |
# File 'bedrock/cfn_prompt_version.rb', line 663 def @messages end |
#system ⇒ AWSCDK::IResolvable, ... (readonly)
Contains system prompts to provide context to the model or to describe how it should behave.
673 674 675 |
# File 'bedrock/cfn_prompt_version.rb', line 673 def system @system end |
#tool_configuration ⇒ AWSCDK::IResolvable, ... (readonly)
Configuration information for the tools that the model can use when generating a response.
678 679 680 |
# File 'bedrock/cfn_prompt_version.rb', line 678 def tool_configuration @tool_configuration end |
Class Method Details
.jsii_properties ⇒ Object
680 681 682 683 684 685 686 687 |
# File 'bedrock/cfn_prompt_version.rb', line 680 def self.jsii_properties { :messages => "messages", :input_variables => "inputVariables", :system => "system", :tool_configuration => "toolConfiguration", } end |
Instance Method Details
#to_jsii ⇒ Object
689 690 691 692 693 694 695 696 697 698 |
# File 'bedrock/cfn_prompt_version.rb', line 689 def to_jsii result = {} result.merge!({ "messages" => @messages, "inputVariables" => @input_variables, "system" => @system, "toolConfiguration" => @tool_configuration, }) result.compact end |