Class: AWSCDK::Bedrock::CfnFlowVersion::FlowNodeConfigurationProperty

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

Overview

Contains configurations for a node in your flow.

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(agent: nil, collector: nil, condition: nil, inline_code: nil, input: nil, iterator: nil, knowledge_base: nil, lambda_function: nil, lex: nil, loop: nil, loop_controller: nil, loop_input: nil, output: nil, prompt: nil, retrieval: nil, storage: nil) ⇒ FlowNodeConfigurationProperty

Returns a new instance of FlowNodeConfigurationProperty.

Parameters:



979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
# File 'bedrock/cfn_flow_version.rb', line 979

def initialize(agent: nil, collector: nil, condition: nil, inline_code: nil, input: nil, iterator: nil, knowledge_base: nil, lambda_function: nil, lex: nil, loop: nil, loop_controller: nil, loop_input: nil, output: nil, prompt: nil, retrieval: nil, storage: nil)
  @agent = agent.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::AgentFlowNodeConfigurationProperty.new(**agent.transform_keys(&:to_sym)) : agent
  Jsii::Type.check_type(@agent, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLkFnZW50Rmxvd05vZGVDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "agent") unless @agent.nil?
  @collector = collector
  Jsii::Type.check_type(@collector, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "collector") unless @collector.nil?
  @condition = condition.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::ConditionFlowNodeConfigurationProperty.new(**condition.transform_keys(&:to_sym)) : condition
  Jsii::Type.check_type(@condition, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLkNvbmRpdGlvbkZsb3dOb2RlQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "condition") unless @condition.nil?
  @inline_code = inline_code.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::InlineCodeFlowNodeConfigurationProperty.new(**inline_code.transform_keys(&:to_sym)) : inline_code
  Jsii::Type.check_type(@inline_code, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLklubGluZUNvZGVGbG93Tm9kZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "inlineCode") unless @inline_code.nil?
  @input = input
  Jsii::Type.check_type(@input, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "input") unless @input.nil?
  @iterator = iterator
  Jsii::Type.check_type(@iterator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "iterator") unless @iterator.nil?
  @knowledge_base = knowledge_base.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::KnowledgeBaseFlowNodeConfigurationProperty.new(**knowledge_base.transform_keys(&:to_sym)) : knowledge_base
  Jsii::Type.check_type(@knowledge_base, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLktub3dsZWRnZUJhc2VGbG93Tm9kZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "knowledgeBase") unless @knowledge_base.nil?
  @lambda_function = lambda_function.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::LambdaFunctionFlowNodeConfigurationProperty.new(**lambda_function.transform_keys(&:to_sym)) : lambda_function
  Jsii::Type.check_type(@lambda_function, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLkxhbWJkYUZ1bmN0aW9uRmxvd05vZGVDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "lambdaFunction") unless @lambda_function.nil?
  @lex = lex.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::LexFlowNodeConfigurationProperty.new(**lex.transform_keys(&:to_sym)) : lex
  Jsii::Type.check_type(@lex, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLkxleEZsb3dOb2RlQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "lex") unless @lex.nil?
  @loop = loop.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::LoopFlowNodeConfigurationProperty.new(**loop.transform_keys(&:to_sym)) : loop
  Jsii::Type.check_type(@loop, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLkxvb3BGbG93Tm9kZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "loop") unless @loop.nil?
  @loop_controller = loop_controller.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::LoopControllerFlowNodeConfigurationProperty.new(**loop_controller.transform_keys(&:to_sym)) : loop_controller
  Jsii::Type.check_type(@loop_controller, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLkxvb3BDb250cm9sbGVyRmxvd05vZGVDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "loopController") unless @loop_controller.nil?
  @loop_input = loop_input
  Jsii::Type.check_type(@loop_input, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "loopInput") unless @loop_input.nil?
  @output = output
  Jsii::Type.check_type(@output, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "output") unless @output.nil?
  @prompt = prompt.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::PromptFlowNodeConfigurationProperty.new(**prompt.transform_keys(&:to_sym)) : prompt
  Jsii::Type.check_type(@prompt, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLlByb21wdEZsb3dOb2RlQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "prompt") unless @prompt.nil?
  @retrieval = retrieval.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::RetrievalFlowNodeConfigurationProperty.new(**retrieval.transform_keys(&:to_sym)) : retrieval
  Jsii::Type.check_type(@retrieval, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLlJldHJpZXZhbEZsb3dOb2RlQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "retrieval") unless @retrieval.nil?
  @storage = storage.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::StorageFlowNodeConfigurationProperty.new(**storage.transform_keys(&:to_sym)) : storage
  Jsii::Type.check_type(@storage, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLlN0b3JhZ2VGbG93Tm9kZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "storage") unless @storage.nil?
end

Instance Attribute Details

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

Contains configurations for an agent node in your flow.

Invokes an alias of an agent and returns the response.



1020
1021
1022
# File 'bedrock/cfn_flow_version.rb', line 1020

def agent
  @agent
end

#collectorObject? (readonly)

Contains configurations for a collector node in your flow.

Collects an iteration of inputs and consolidates them into an array of outputs.



1027
1028
1029
# File 'bedrock/cfn_flow_version.rb', line 1027

def collector
  @collector
end

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

Contains configurations for a condition node in your flow.

Defines conditions that lead to different branches of the flow.



1034
1035
1036
# File 'bedrock/cfn_flow_version.rb', line 1034

def condition
  @condition
end

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

Contains configurations for an inline code node in your flow.

Inline code nodes let you write and execute code directly within your flow, enabling data transformations, custom logic, and integrations without needing an external Lambda function.



1041
1042
1043
# File 'bedrock/cfn_flow_version.rb', line 1041

def inline_code
  @inline_code
end

#inputObject? (readonly)

Contains configurations for an input flow node in your flow.

The first node in the flow. inputs can't be specified for this node.



1048
1049
1050
# File 'bedrock/cfn_flow_version.rb', line 1048

def input
  @input
end

#iteratorObject? (readonly)

Contains configurations for an iterator node in your flow.

Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.

The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.



1057
1058
1059
# File 'bedrock/cfn_flow_version.rb', line 1057

def iterator
  @iterator
end

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

Contains configurations for a knowledge base node in your flow.

Queries a knowledge base and returns the retrieved results or generated response.



1064
1065
1066
# File 'bedrock/cfn_flow_version.rb', line 1064

def knowledge_base
  @knowledge_base
end

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

Contains configurations for a Lambda function node in your flow.

Invokes an AWS Lambda function.



1071
1072
1073
# File 'bedrock/cfn_flow_version.rb', line 1071

def lambda_function
  @lambda_function
end

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

Contains configurations for a Lex node in your flow.

Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.



1078
1079
1080
# File 'bedrock/cfn_flow_version.rb', line 1078

def lex
  @lex
end

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

Contains configurations for a DoWhile loop in your flow.



1083
1084
1085
# File 'bedrock/cfn_flow_version.rb', line 1083

def loop
  @loop
end

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

Contains controller node configurations for a DoWhile loop in your flow.



1088
1089
1090
# File 'bedrock/cfn_flow_version.rb', line 1088

def loop_controller
  @loop_controller
end

#loop_inputObject? (readonly)

Contains input node configurations for a DoWhile loop in your flow.



1093
1094
1095
# File 'bedrock/cfn_flow_version.rb', line 1093

def loop_input
  @loop_input
end

#outputObject? (readonly)

Contains configurations for an output flow node in your flow.

The last node in the flow. outputs can't be specified for this node.



1100
1101
1102
# File 'bedrock/cfn_flow_version.rb', line 1100

def output
  @output
end

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

Contains configurations for a prompt node in your flow.

Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.



1107
1108
1109
# File 'bedrock/cfn_flow_version.rb', line 1107

def prompt
  @prompt
end

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

Contains configurations for a retrieval node in your flow.

Retrieves data from an Amazon S3 location and returns it as the output.



1114
1115
1116
# File 'bedrock/cfn_flow_version.rb', line 1114

def retrieval
  @retrieval
end

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

Contains configurations for a storage node in your flow.

Stores an input in an Amazon S3 location.



1121
1122
1123
# File 'bedrock/cfn_flow_version.rb', line 1121

def storage
  @storage
end

Class Method Details

.jsii_propertiesObject



1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
# File 'bedrock/cfn_flow_version.rb', line 1123

def self.jsii_properties
  {
    :agent => "agent",
    :collector => "collector",
    :condition => "condition",
    :inline_code => "inlineCode",
    :input => "input",
    :iterator => "iterator",
    :knowledge_base => "knowledgeBase",
    :lambda_function => "lambdaFunction",
    :lex => "lex",
    :loop => "loop",
    :loop_controller => "loopController",
    :loop_input => "loopInput",
    :output => "output",
    :prompt => "prompt",
    :retrieval => "retrieval",
    :storage => "storage",
  }
end

Instance Method Details

#to_jsiiObject



1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
# File 'bedrock/cfn_flow_version.rb', line 1144

def to_jsii
  result = {}
  result.merge!({
    "agent" => @agent,
    "collector" => @collector,
    "condition" => @condition,
    "inlineCode" => @inline_code,
    "input" => @input,
    "iterator" => @iterator,
    "knowledgeBase" => @knowledge_base,
    "lambdaFunction" => @lambda_function,
    "lex" => @lex,
    "loop" => @loop,
    "loopController" => @loop_controller,
    "loopInput" => @loop_input,
    "output" => @output,
    "prompt" => @prompt,
    "retrieval" => @retrieval,
    "storage" => @storage,
  })
  result.compact
end