Class: AWSCDK::Bedrock::CfnPrompt::PromptVariantProperty

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

Overview

Contains details about a variant of the prompt.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, template_configuration:, template_type:, additional_model_request_fields: nil, gen_ai_resource: nil, inference_configuration: nil, metadata: nil, model_id: nil) ⇒ PromptVariantProperty

Returns a new instance of PromptVariantProperty.

Parameters:



1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
# File 'bedrock/cfn_prompt.rb', line 1106

def initialize(name:, template_configuration:, template_type:, additional_model_request_fields: nil, gen_ai_resource: nil, inference_configuration: nil, metadata: nil, model_id: nil)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @template_configuration = template_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPrompt::PromptTemplateConfigurationProperty.new(**template_configuration.transform_keys(&:to_sym)) : template_configuration
  Jsii::Type.check_type(@template_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdC5Qcm9tcHRUZW1wbGF0ZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "templateConfiguration")
  @template_type = template_type
  Jsii::Type.check_type(@template_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "templateType")
  @additional_model_request_fields = additional_model_request_fields
  Jsii::Type.check_type(@additional_model_request_fields, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "additionalModelRequestFields") unless @additional_model_request_fields.nil?
  @gen_ai_resource = gen_ai_resource.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPrompt::PromptGenAiResourceProperty.new(**gen_ai_resource.transform_keys(&:to_sym)) : gen_ai_resource
  Jsii::Type.check_type(@gen_ai_resource, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdC5Qcm9tcHRHZW5BaVJlc291cmNlUHJvcGVydHkifV19fQ==")), "genAiResource") unless @gen_ai_resource.nil?
  @inference_configuration = inference_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPrompt::PromptInferenceConfigurationProperty.new(**inference_configuration.transform_keys(&:to_sym)) : inference_configuration
  Jsii::Type.check_type(@inference_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdC5Qcm9tcHRJbmZlcmVuY2VDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "inferenceConfiguration") unless @inference_configuration.nil?
  @metadata = 
  Jsii::Type.check_type(@metadata, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHQuUHJvbXB0TWV0YWRhdGFFbnRyeVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "metadata") unless @metadata.nil?
  @model_id = model_id
  Jsii::Type.check_type(@model_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "modelId") unless @model_id.nil?
end

Instance Attribute Details

#additional_model_request_fieldsObject? (readonly)

Contains model-specific inference configurations that aren't in the inferenceConfiguration field.

To see model-specific inference parameters, see Inference request parameters and response fields for foundation models .



1146
1147
1148
# File 'bedrock/cfn_prompt.rb', line 1146

def additional_model_request_fields
  @additional_model_request_fields
end

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

Specifies a generative AI resource with which to use the prompt.



1151
1152
1153
# File 'bedrock/cfn_prompt.rb', line 1151

def gen_ai_resource
  @gen_ai_resource
end

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

Contains inference configurations for the prompt variant.



1156
1157
1158
# File 'bedrock/cfn_prompt.rb', line 1156

def inference_configuration
  @inference_configuration
end

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

An array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant.



1161
1162
1163
# File 'bedrock/cfn_prompt.rb', line 1161

def 
  @metadata
end

#model_idString? (readonly)

The unique identifier of the model or inference profile with which to run inference on the prompt.



1166
1167
1168
# File 'bedrock/cfn_prompt.rb', line 1166

def model_id
  @model_id
end

#nameString (readonly)

The name of the prompt variant.



1129
1130
1131
# File 'bedrock/cfn_prompt.rb', line 1129

def name
  @name
end

#template_configurationAWSCDK::IResolvable, AWSCDK::Bedrock::CfnPrompt::PromptTemplateConfigurationProperty (readonly)

Contains configurations for the prompt template.



1134
1135
1136
# File 'bedrock/cfn_prompt.rb', line 1134

def template_configuration
  @template_configuration
end

#template_typeString (readonly)

The type of prompt template to use.



1139
1140
1141
# File 'bedrock/cfn_prompt.rb', line 1139

def template_type
  @template_type
end

Class Method Details

.jsii_propertiesObject



1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
# File 'bedrock/cfn_prompt.rb', line 1168

def self.jsii_properties
  {
    :name => "name",
    :template_configuration => "templateConfiguration",
    :template_type => "templateType",
    :additional_model_request_fields => "additionalModelRequestFields",
    :gen_ai_resource => "genAiResource",
    :inference_configuration => "inferenceConfiguration",
    :metadata => "metadata",
    :model_id => "modelId",
  }
end

Instance Method Details

#to_jsiiObject



1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
# File 'bedrock/cfn_prompt.rb', line 1181

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "templateConfiguration" => @template_configuration,
    "templateType" => @template_type,
    "additionalModelRequestFields" => @additional_model_request_fields,
    "genAiResource" => @gen_ai_resource,
    "inferenceConfiguration" => @inference_configuration,
    "metadata" => @metadata,
    "modelId" => @model_id,
  })
  result.compact
end