Class: AWSCDK::Bedrock::CfnFlow::PromptFlowNodeConfigurationProperty

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

Overview

Contains configurations for a prompt node in the flow.

You can use a prompt from Prompt management or you can define one in this node. If the prompt contains variables, the inputs into this node will fill in the variables. The output from this node is the response generated by the model. For more information, see Node types in a flow in the Amazon Bedrock User Guide.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_configuration:, guardrail_configuration: nil) ⇒ PromptFlowNodeConfigurationProperty

Returns a new instance of PromptFlowNodeConfigurationProperty.

Parameters:



2079
2080
2081
2082
2083
2084
# File 'bedrock/cfn_flow.rb', line 2079

def initialize(source_configuration:, guardrail_configuration: nil)
  @source_configuration = source_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlow::PromptFlowNodeSourceConfigurationProperty.new(**source_configuration.transform_keys(&:to_sym)) : source_configuration
  Jsii::Type.check_type(@source_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3cuUHJvbXB0Rmxvd05vZGVTb3VyY2VDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "sourceConfiguration")
  @guardrail_configuration = guardrail_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlow::GuardrailConfigurationProperty.new(**guardrail_configuration.transform_keys(&:to_sym)) : guardrail_configuration
  Jsii::Type.check_type(@guardrail_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3cuR3VhcmRyYWlsQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "guardrailConfiguration") unless @guardrail_configuration.nil?
end

Instance Attribute Details

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

Contains configurations for a guardrail to apply to the prompt in this node and the response generated from it.



2095
2096
2097
# File 'bedrock/cfn_flow.rb', line 2095

def guardrail_configuration
  @guardrail_configuration
end

#source_configurationAWSCDK::IResolvable, AWSCDK::Bedrock::CfnFlow::PromptFlowNodeSourceConfigurationProperty (readonly)

Specifies whether the prompt is from Prompt management or defined inline.



2090
2091
2092
# File 'bedrock/cfn_flow.rb', line 2090

def source_configuration
  @source_configuration
end

Class Method Details

.jsii_propertiesObject



2097
2098
2099
2100
2101
2102
# File 'bedrock/cfn_flow.rb', line 2097

def self.jsii_properties
  {
    :source_configuration => "sourceConfiguration",
    :guardrail_configuration => "guardrailConfiguration",
  }
end

Instance Method Details

#to_jsiiObject



2104
2105
2106
2107
2108
2109
2110
2111
# File 'bedrock/cfn_flow.rb', line 2104

def to_jsii
  result = {}
  result.merge!({
    "sourceConfiguration" => @source_configuration,
    "guardrailConfiguration" => @guardrail_configuration,
  })
  result.compact
end