Class: AWSCDK::Bedrock::CfnPrompt::ChatPromptTemplateConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_prompt.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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(messages:, input_variables: nil, system: nil, tool_configuration: nil) ⇒ ChatPromptTemplateConfigurationProperty

Returns a new instance of ChatPromptTemplateConfigurationProperty.

Parameters:



655
656
657
658
659
660
661
662
663
664
# File 'bedrock/cfn_prompt.rb', line 655

def initialize(messages:, input_variables: nil, system: nil, tool_configuration: nil)
  @messages = messages
  Jsii::Type.check_type(@messages, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHQuTWVzc2FnZVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "messages")
  @input_variables = input_variables
  Jsii::Type.check_type(@input_variables, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHQuUHJvbXB0SW5wdXRWYXJpYWJsZVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "inputVariables") unless @input_variables.nil?
  @system = system
  Jsii::Type.check_type(@system, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHQuU3lzdGVtQ29udGVudEJsb2NrUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "system") unless @system.nil?
  @tool_configuration = tool_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPrompt::ToolConfigurationProperty.new(**tool_configuration.transform_keys(&:to_sym)) : tool_configuration
  Jsii::Type.check_type(@tool_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdC5Ub29sQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "toolConfiguration") unless @tool_configuration.nil?
end

Instance Attribute Details

#input_variablesAWSCDK::IResolvable, ... (readonly)

An array of the variables in the prompt template.



675
676
677
# File 'bedrock/cfn_prompt.rb', line 675

def input_variables
  @input_variables
end

#systemAWSCDK::IResolvable, ... (readonly)

Contains system prompts to provide context to the model or to describe how it should behave.



680
681
682
# File 'bedrock/cfn_prompt.rb', line 680

def system
  @system
end

#tool_configurationAWSCDK::IResolvable, ... (readonly)

Configuration information for the tools that the model can use when generating a response.



685
686
687
# File 'bedrock/cfn_prompt.rb', line 685

def tool_configuration
  @tool_configuration
end

Class Method Details

.jsii_propertiesObject



687
688
689
690
691
692
693
694
# File 'bedrock/cfn_prompt.rb', line 687

def self.jsii_properties
  {
    :messages => "messages",
    :input_variables => "inputVariables",
    :system => "system",
    :tool_configuration => "toolConfiguration",
  }
end

Instance Method Details

#to_jsiiObject



696
697
698
699
700
701
702
703
704
705
# File 'bedrock/cfn_prompt.rb', line 696

def to_jsii
  result = {}
  result.merge!({
    "messages" => @messages,
    "inputVariables" => @input_variables,
    "system" => @system,
    "toolConfiguration" => @tool_configuration,
  })
  result.compact
end