Class: AWSCDK::Bedrock::CfnPrompt::PromptTemplateConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_prompt.rb

Overview

Contains the message for a prompt.

For more information, see Construct and store reusable prompts with Prompt management in Amazon Bedrock .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(chat: nil, text: nil) ⇒ PromptTemplateConfigurationProperty

Returns a new instance of PromptTemplateConfigurationProperty.

Parameters:



1057
1058
1059
1060
1061
1062
# File 'bedrock/cfn_prompt.rb', line 1057

def initialize(chat: nil, text: nil)
  @chat = chat.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPrompt::ChatPromptTemplateConfigurationProperty.new(**chat.transform_keys(&:to_sym)) : chat
  Jsii::Type.check_type(@chat, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdC5DaGF0UHJvbXB0VGVtcGxhdGVDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "chat") unless @chat.nil?
  @text = text.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPrompt::TextPromptTemplateConfigurationProperty.new(**text.transform_keys(&:to_sym)) : text
  Jsii::Type.check_type(@text, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdC5UZXh0UHJvbXB0VGVtcGxhdGVDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "text") unless @text.nil?
end

Instance Attribute Details

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

Contains configurations to use the prompt in a conversational format.



1068
1069
1070
# File 'bedrock/cfn_prompt.rb', line 1068

def chat
  @chat
end

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

Contains configurations for the text in a message for a prompt.



1073
1074
1075
# File 'bedrock/cfn_prompt.rb', line 1073

def text
  @text
end

Class Method Details

.jsii_propertiesObject



1075
1076
1077
1078
1079
1080
# File 'bedrock/cfn_prompt.rb', line 1075

def self.jsii_properties
  {
    :chat => "chat",
    :text => "text",
  }
end

Instance Method Details

#to_jsiiObject



1082
1083
1084
1085
1086
1087
1088
1089
# File 'bedrock/cfn_prompt.rb', line 1082

def to_jsii
  result = {}
  result.merge!({
    "chat" => @chat,
    "text" => @text,
  })
  result.compact
end