Class: AWSCDK::Bedrock::CfnPromptVersion::MessageProperty

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

Overview

A message input, or returned from, a call to Converse or ConverseStream .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content:, role:) ⇒ MessageProperty

Returns a new instance of MessageProperty.

Parameters:



752
753
754
755
756
757
# File 'bedrock/cfn_prompt_version.rb', line 752

def initialize(content:, role:)
  @content = content
  Jsii::Type.check_type(@content, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHRWZXJzaW9uLkNvbnRlbnRCbG9ja1Byb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "content")
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "role")
end

Instance Attribute Details

#contentAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Bedrock::CfnPromptVersion::ContentBlockProperty> (readonly)

The message content. Note the following restrictions:.

  • You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
  • You can include up to five documents. Each document's size must be no more than 4.5 MB.
  • If you include a ContentBlock with a document field in the array, you must also include a ContentBlock with a text field.
  • You can only include images and documents if the role is user .


768
769
770
# File 'bedrock/cfn_prompt_version.rb', line 768

def content
  @content
end

#roleString (readonly)

The role that the message plays in the message.



773
774
775
# File 'bedrock/cfn_prompt_version.rb', line 773

def role
  @role
end

Class Method Details

.jsii_propertiesObject



775
776
777
778
779
780
# File 'bedrock/cfn_prompt_version.rb', line 775

def self.jsii_properties
  {
    :content => "content",
    :role => "role",
  }
end

Instance Method Details

#to_jsiiObject



782
783
784
785
786
787
788
789
# File 'bedrock/cfn_prompt_version.rb', line 782

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