Class: AWSCDK::Bedrock::CfnPrompt::TextPromptTemplateConfigurationProperty

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

Overview

Contains configurations for a text prompt template.

To include a variable, enclose a word in double curly braces as in {{variable}} .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cache_point: nil, input_variables: nil, text: nil, text_s3_location: nil) ⇒ TextPromptTemplateConfigurationProperty

Returns a new instance of TextPromptTemplateConfigurationProperty.

Parameters:



1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
# File 'bedrock/cfn_prompt.rb', line 1291

def initialize(cache_point: nil, input_variables: nil, text: nil, text_s3_location: nil)
  @cache_point = cache_point.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPrompt::CachePointBlockProperty.new(**cache_point.transform_keys(&:to_sym)) : cache_point
  Jsii::Type.check_type(@cache_point, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdC5DYWNoZVBvaW50QmxvY2tQcm9wZXJ0eSJ9XX19")), "cachePoint") unless @cache_point.nil?
  @input_variables = input_variables
  Jsii::Type.check_type(@input_variables, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHQuUHJvbXB0SW5wdXRWYXJpYWJsZVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "inputVariables") unless @input_variables.nil?
  @text = text
  Jsii::Type.check_type(@text, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "text") unless @text.nil?
  @text_s3_location = text_s3_location.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPrompt::TextS3LocationProperty.new(**text_s3_location.transform_keys(&:to_sym)) : text_s3_location
  Jsii::Type.check_type(@text_s3_location, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdC5UZXh0UzNMb2NhdGlvblByb3BlcnR5In1dfX0=")), "textS3Location") unless @text_s3_location.nil?
end

Instance Attribute Details

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

A cache checkpoint within a template configuration.



1306
1307
1308
# File 'bedrock/cfn_prompt.rb', line 1306

def cache_point
  @cache_point
end

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

An array of the variables in the prompt template.



1311
1312
1313
# File 'bedrock/cfn_prompt.rb', line 1311

def input_variables
  @input_variables
end

#textString? (readonly)

The message for the prompt.



1316
1317
1318
# File 'bedrock/cfn_prompt.rb', line 1316

def text
  @text
end

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

The Amazon S3 location of the prompt text.



1321
1322
1323
# File 'bedrock/cfn_prompt.rb', line 1321

def text_s3_location
  @text_s3_location
end

Class Method Details

.jsii_propertiesObject



1323
1324
1325
1326
1327
1328
1329
1330
# File 'bedrock/cfn_prompt.rb', line 1323

def self.jsii_properties
  {
    :cache_point => "cachePoint",
    :input_variables => "inputVariables",
    :text => "text",
    :text_s3_location => "textS3Location",
  }
end

Instance Method Details

#to_jsiiObject



1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
# File 'bedrock/cfn_prompt.rb', line 1332

def to_jsii
  result = {}
  result.merge!({
    "cachePoint" => @cache_point,
    "inputVariables" => @input_variables,
    "text" => @text,
    "textS3Location" => @text_s3_location,
  })
  result.compact
end