Class: AWSCDK::Bedrock::CfnPrompt::MessageProperty

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



759
760
761
762
763
764
# File 'bedrock/cfn_prompt.rb', line 759

def initialize(content:, role:)
  @content = content
  Jsii::Type.check_type(@content, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHQuQ29udGVudEJsb2NrUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "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::CfnPrompt::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 .


775
776
777
# File 'bedrock/cfn_prompt.rb', line 775

def content
  @content
end

#roleString (readonly)

The role that the message plays in the message.



780
781
782
# File 'bedrock/cfn_prompt.rb', line 780

def role
  @role
end

Class Method Details

.jsii_propertiesObject



782
783
784
785
786
787
# File 'bedrock/cfn_prompt.rb', line 782

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

Instance Method Details

#to_jsiiObject



789
790
791
792
793
794
795
796
# File 'bedrock/cfn_prompt.rb', line 789

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