LoopFlowNodeConfigurationProperty Struct
Contains configurations for the nodes of a DoWhile loop in your flow.
A DoWhile loop is made up of the following nodes:
Loop- The container node that holds the loop's flow definition. This node encompasses the entire loop structure.LoopInput- The entry point node for the loop. This node receives inputs from nodes outside the loop and from previous loop iterations.- Body nodes - The processing nodes that execute within each loop iteration. These can be nodes for handling data in your flow, such as a prompt or Lambda function nodes. Some node types aren't supported inside a DoWhile loop body. For more information, see LoopIncompatibleNodeTypeFlowValidationDetails .
LoopController- The node that evaluates whether the loop should continue or exit based on a condition.
These nodes work together to create a loop that runs at least once and continues until a specified condition is met or a maximum number of iterations is reached.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrock as bedrock } from 'aws-cdk-lib';
declare const additionalModelRequestFields: any;
declare const collector: any;
declare const input: any;
declare const iterator: any;
declare const loopFlowNodeConfigurationProperty_: bedrock.CfnFlow.LoopFlowNodeConfigurationProperty;
declare const loopInput: any;
declare const output: any;
const loopFlowNodeConfigurationProperty: bedrock.CfnFlow.LoopFlowNodeConfigurationProperty = {
definition: {
connections: [{
name: 'name',
source: 'source',
target: 'target',
type: 'type',
// the properties below are optional
configuration: {
conditional: {
condition: 'condition',
},
data: {
sourceOutput: 'sourceOutput',
targetInput: 'targetInput',
},
},
}],
nodes: [{
name: 'name',
type: 'type',
// the properties below are optional
configuration: {
agent: {
agentAliasArn: 'agentAliasArn',
},
collector: collector,
condition: {
conditions: [{
name: 'name',
// the properties below are optional
expression: 'expression',
}],
},
inlineCode: {
code: 'code',
language: 'language',
},
input: input,
iterator: iterator,
knowledgeBase: {
knowledgeBaseId: 'knowledgeBaseId',
// the properties below are optional
guardrailConfiguration: {
guardrailIdentifier: 'guardrailIdentifier',
guardrailVersion: 'guardrailVersion',
},
inferenceConfiguration: {
text: {
maxTokens: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topP: 123,
},
},
modelId: 'modelId',
numberOfResults: 123,
orchestrationConfiguration: {
additionalModelRequestFields: additionalModelRequestFields,
inferenceConfig: {
text: {
maxTokens: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topP: 123,
},
},
performanceConfig: {
latency: 'latency',
},
promptTemplate: {
textPromptTemplate: 'textPromptTemplate',
},
},
promptTemplate: {
textPromptTemplate: 'textPromptTemplate',
},
rerankingConfiguration: {
type: 'type',
// the properties below are optional
bedrockRerankingConfiguration: {
modelConfiguration: {
modelArn: 'modelArn',
// the properties below are optional
additionalModelRequestFields: additionalModelRequestFields,
},
// the properties below are optional
metadataConfiguration: {
selectionMode: 'selectionMode',
// the properties below are optional
selectiveModeConfiguration: {
fieldsToExclude: [{
fieldName: 'fieldName',
}],
fieldsToInclude: [{
fieldName: 'fieldName',
}],
},
},
numberOfRerankedResults: 123,
},
},
},
lambdaFunction: {
lambdaArn: 'lambdaArn',
},
lex: {
botAliasArn: 'botAliasArn',
localeId: 'localeId',
},
loop: loopFlowNodeConfigurationProperty_,
loopController: {
continueCondition: {
name: 'name',
// the properties below are optional
expression: 'expression',
},
// the properties below are optional
maxIterations: 123,
},
loopInput: loopInput,
output: output,
prompt: {
sourceConfiguration: {
inline: {
modelId: 'modelId',
templateConfiguration: {
text: {
text: 'text',
// the properties below are optional
inputVariables: [{
name: 'name',
}],
},
},
templateType: 'templateType',
// the properties below are optional
inferenceConfiguration: {
text: {
maxTokens: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topP: 123,
},
},
},
resource: {
promptArn: 'promptArn',
},
},
// the properties below are optional
guardrailConfiguration: {
guardrailIdentifier: 'guardrailIdentifier',
guardrailVersion: 'guardrailVersion',
},
},
retrieval: {
serviceConfiguration: {
s3: {
bucketName: 'bucketName',
},
},
},
storage: {
serviceConfiguration: {
s3: {
bucketName: 'bucketName',
},
},
},
},
inputs: [{
expression: 'expression',
name: 'name',
type: 'type',
// the properties below are optional
category: 'category',
}],
outputs: [{
name: 'name',
type: 'type',
}],
}],
},
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock
# additional_model_request_fields: Any
# collector: Any
# input: Any
# iterator: Any
# loop_flow_node_configuration_property_: bedrock.CfnFlow.LoopFlowNodeConfigurationProperty
# loop_input: Any
# output: Any
loop_flow_node_configuration_property = bedrock.CfnFlow.LoopFlowNodeConfigurationProperty(
definition=bedrock.CfnFlow.FlowDefinitionProperty(
connections=[bedrock.CfnFlow.FlowConnectionProperty(
name="name",
source="source",
target="target",
type="type",
# the properties below are optional
configuration=bedrock.CfnFlow.FlowConnectionConfigurationProperty(
conditional=bedrock.CfnFlow.FlowConditionalConnectionConfigurationProperty(
condition="condition"
),
data=bedrock.CfnFlow.FlowDataConnectionConfigurationProperty(
source_output="sourceOutput",
target_input="targetInput"
)
)
)],
nodes=[bedrock.CfnFlow.FlowNodeProperty(
name="name",
type="type",
# the properties below are optional
configuration=bedrock.CfnFlow.FlowNodeConfigurationProperty(
agent=bedrock.CfnFlow.AgentFlowNodeConfigurationProperty(
agent_alias_arn="agentAliasArn"
),
collector=collector,
condition=bedrock.CfnFlow.ConditionFlowNodeConfigurationProperty(
conditions=[bedrock.CfnFlow.FlowConditionProperty(
name="name",
# the properties below are optional
expression="expression"
)]
),
inline_code=bedrock.CfnFlow.InlineCodeFlowNodeConfigurationProperty(
code="code",
language="language"
),
input=input,
iterator=iterator,
knowledge_base=bedrock.CfnFlow.KnowledgeBaseFlowNodeConfigurationProperty(
knowledge_base_id="knowledgeBaseId",
# the properties below are optional
guardrail_configuration=bedrock.CfnFlow.GuardrailConfigurationProperty(
guardrail_identifier="guardrailIdentifier",
guardrail_version="guardrailVersion"
),
inference_configuration=bedrock.CfnFlow.PromptInferenceConfigurationProperty(
text=bedrock.CfnFlow.PromptModelInferenceConfigurationProperty(
max_tokens=123,
stop_sequences=["stopSequences"],
temperature=123,
top_p=123
)
),
model_id="modelId",
number_of_results=123,
orchestration_configuration=bedrock.CfnFlow.KnowledgeBaseOrchestrationConfigurationProperty(
additional_model_request_fields=additional_model_request_fields,
inference_config=bedrock.CfnFlow.PromptInferenceConfigurationProperty(
text=bedrock.CfnFlow.PromptModelInferenceConfigurationProperty(
max_tokens=123,
stop_sequences=["stopSequences"],
temperature=123,
top_p=123
)
),
performance_config=bedrock.CfnFlow.PerformanceConfigurationProperty(
latency="latency"
),
prompt_template=bedrock.CfnFlow.KnowledgeBasePromptTemplateProperty(
text_prompt_template="textPromptTemplate"
)
),
prompt_template=bedrock.CfnFlow.KnowledgeBasePromptTemplateProperty(
text_prompt_template="textPromptTemplate"
),
reranking_configuration=bedrock.CfnFlow.VectorSearchRerankingConfigurationProperty(
type="type",
# the properties below are optional
bedrock_reranking_configuration=bedrock.CfnFlow.VectorSearchBedrockRerankingConfigurationProperty(
model_configuration=bedrock.CfnFlow.VectorSearchBedrockRerankingModelConfigurationProperty(
model_arn="modelArn",
# the properties below are optional
additional_model_request_fields=additional_model_request_fields
),
# the properties below are optional
metadata_configuration=bedrock.CfnFlow.MetadataConfigurationForRerankingProperty(
selection_mode="selectionMode",
# the properties below are optional
selective_mode_configuration=bedrock.CfnFlow.RerankingMetadataSelectiveModeConfigurationProperty(
fields_to_exclude=[bedrock.CfnFlow.FieldForRerankingProperty(
field_name="fieldName"
)],
fields_to_include=[bedrock.CfnFlow.FieldForRerankingProperty(
field_name="fieldName"
)]
)
),
number_of_reranked_results=123
)
)
),
lambda_function=bedrock.CfnFlow.LambdaFunctionFlowNodeConfigurationProperty(
lambda_arn="lambdaArn"
),
lex=bedrock.CfnFlow.LexFlowNodeConfigurationProperty(
bot_alias_arn="botAliasArn",
locale_id="localeId"
),
loop=loop_flow_node_configuration_property_,
loop_controller=bedrock.CfnFlow.LoopControllerFlowNodeConfigurationProperty(
continue_condition=bedrock.CfnFlow.FlowConditionProperty(
name="name",
# the properties below are optional
expression="expression"
),
# the properties below are optional
max_iterations=123
),
loop_input=loop_input,
output=output,
prompt=bedrock.CfnFlow.PromptFlowNodeConfigurationProperty(
source_configuration=bedrock.CfnFlow.PromptFlowNodeSourceConfigurationProperty(
inline=bedrock.CfnFlow.PromptFlowNodeInlineConfigurationProperty(
model_id="modelId",
template_configuration=bedrock.CfnFlow.PromptTemplateConfigurationProperty(
text=bedrock.CfnFlow.TextPromptTemplateConfigurationProperty(
text="text",
# the properties below are optional
input_variables=[bedrock.CfnFlow.PromptInputVariableProperty(
name="name"
)]
)
),
template_type="templateType",
# the properties below are optional
inference_configuration=bedrock.CfnFlow.PromptInferenceConfigurationProperty(
text=bedrock.CfnFlow.PromptModelInferenceConfigurationProperty(
max_tokens=123,
stop_sequences=["stopSequences"],
temperature=123,
top_p=123
)
)
),
resource=bedrock.CfnFlow.PromptFlowNodeResourceConfigurationProperty(
prompt_arn="promptArn"
)
),
# the properties below are optional
guardrail_configuration=bedrock.CfnFlow.GuardrailConfigurationProperty(
guardrail_identifier="guardrailIdentifier",
guardrail_version="guardrailVersion"
)
),
retrieval=bedrock.CfnFlow.RetrievalFlowNodeConfigurationProperty(
service_configuration=bedrock.CfnFlow.RetrievalFlowNodeServiceConfigurationProperty(
s3=bedrock.CfnFlow.RetrievalFlowNodeS3ConfigurationProperty(
bucket_name="bucketName"
)
)
),
storage=bedrock.CfnFlow.StorageFlowNodeConfigurationProperty(
service_configuration=bedrock.CfnFlow.StorageFlowNodeServiceConfigurationProperty(
s3=bedrock.CfnFlow.StorageFlowNodeS3ConfigurationProperty(
bucket_name="bucketName"
)
)
)
),
inputs=[bedrock.CfnFlow.FlowNodeInputProperty(
expression="expression",
name="name",
type="type",
# the properties below are optional
category="category"
)],
outputs=[bedrock.CfnFlow.FlowNodeOutputProperty(
name="name",
type="type"
)]
)]
)
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.*;
Object additionalModelRequestFields;
Object collector;
Object input;
Object iterator;
LoopFlowNodeConfigurationProperty loopFlowNodeConfigurationProperty_;
Object loopInput;
Object output;
LoopFlowNodeConfigurationProperty loopFlowNodeConfigurationProperty = LoopFlowNodeConfigurationProperty.builder()
.definition(FlowDefinitionProperty.builder()
.connections(List.of(FlowConnectionProperty.builder()
.name("name")
.source("source")
.target("target")
.type("type")
// the properties below are optional
.configuration(FlowConnectionConfigurationProperty.builder()
.conditional(FlowConditionalConnectionConfigurationProperty.builder()
.condition("condition")
.build())
.data(FlowDataConnectionConfigurationProperty.builder()
.sourceOutput("sourceOutput")
.targetInput("targetInput")
.build())
.build())
.build()))
.nodes(List.of(FlowNodeProperty.builder()
.name("name")
.type("type")
// the properties below are optional
.configuration(FlowNodeConfigurationProperty.builder()
.agent(AgentFlowNodeConfigurationProperty.builder()
.agentAliasArn("agentAliasArn")
.build())
.collector(collector)
.condition(ConditionFlowNodeConfigurationProperty.builder()
.conditions(List.of(FlowConditionProperty.builder()
.name("name")
// the properties below are optional
.expression("expression")
.build()))
.build())
.inlineCode(InlineCodeFlowNodeConfigurationProperty.builder()
.code("code")
.language("language")
.build())
.input(input)
.iterator(iterator)
.knowledgeBase(KnowledgeBaseFlowNodeConfigurationProperty.builder()
.knowledgeBaseId("knowledgeBaseId")
// the properties below are optional
.guardrailConfiguration(GuardrailConfigurationProperty.builder()
.guardrailIdentifier("guardrailIdentifier")
.guardrailVersion("guardrailVersion")
.build())
.inferenceConfiguration(PromptInferenceConfigurationProperty.builder()
.text(PromptModelInferenceConfigurationProperty.builder()
.maxTokens(123)
.stopSequences(List.of("stopSequences"))
.temperature(123)
.topP(123)
.build())
.build())
.modelId("modelId")
.numberOfResults(123)
.orchestrationConfiguration(KnowledgeBaseOrchestrationConfigurationProperty.builder()
.additionalModelRequestFields(additionalModelRequestFields)
.inferenceConfig(PromptInferenceConfigurationProperty.builder()
.text(PromptModelInferenceConfigurationProperty.builder()
.maxTokens(123)
.stopSequences(List.of("stopSequences"))
.temperature(123)
.topP(123)
.build())
.build())
.performanceConfig(PerformanceConfigurationProperty.builder()
.latency("latency")
.build())
.promptTemplate(KnowledgeBasePromptTemplateProperty.builder()
.textPromptTemplate("textPromptTemplate")
.build())
.build())
.promptTemplate(KnowledgeBasePromptTemplateProperty.builder()
.textPromptTemplate("textPromptTemplate")
.build())
.rerankingConfiguration(VectorSearchRerankingConfigurationProperty.builder()
.type("type")
// the properties below are optional
.bedrockRerankingConfiguration(VectorSearchBedrockRerankingConfigurationProperty.builder()
.modelConfiguration(VectorSearchBedrockRerankingModelConfigurationProperty.builder()
.modelArn("modelArn")
// the properties below are optional
.additionalModelRequestFields(additionalModelRequestFields)
.build())
// the properties below are optional
.metadataConfiguration(MetadataConfigurationForRerankingProperty.builder()
.selectionMode("selectionMode")
// the properties below are optional
.selectiveModeConfiguration(RerankingMetadataSelectiveModeConfigurationProperty.builder()
.fieldsToExclude(List.of(FieldForRerankingProperty.builder()
.fieldName("fieldName")
.build()))
.fieldsToInclude(List.of(FieldForRerankingProperty.builder()
.fieldName("fieldName")
.build()))
.build())
.build())
.numberOfRerankedResults(123)
.build())
.build())
.build())
.lambdaFunction(LambdaFunctionFlowNodeConfigurationProperty.builder()
.lambdaArn("lambdaArn")
.build())
.lex(LexFlowNodeConfigurationProperty.builder()
.botAliasArn("botAliasArn")
.localeId("localeId")
.build())
.loop(loopFlowNodeConfigurationProperty_)
.loopController(LoopControllerFlowNodeConfigurationProperty.builder()
.continueCondition(FlowConditionProperty.builder()
.name("name")
// the properties below are optional
.expression("expression")
.build())
// the properties below are optional
.maxIterations(123)
.build())
.loopInput(loopInput)
.output(output)
.prompt(PromptFlowNodeConfigurationProperty.builder()
.sourceConfiguration(PromptFlowNodeSourceConfigurationProperty.builder()
.inline(PromptFlowNodeInlineConfigurationProperty.builder()
.modelId("modelId")
.templateConfiguration(PromptTemplateConfigurationProperty.builder()
.text(TextPromptTemplateConfigurationProperty.builder()
.text("text")
// the properties below are optional
.inputVariables(List.of(PromptInputVariableProperty.builder()
.name("name")
.build()))
.build())
.build())
.templateType("templateType")
// the properties below are optional
.inferenceConfiguration(PromptInferenceConfigurationProperty.builder()
.text(PromptModelInferenceConfigurationProperty.builder()
.maxTokens(123)
.stopSequences(List.of("stopSequences"))
.temperature(123)
.topP(123)
.build())
.build())
.build())
.resource(PromptFlowNodeResourceConfigurationProperty.builder()
.promptArn("promptArn")
.build())
.build())
// the properties below are optional
.guardrailConfiguration(GuardrailConfigurationProperty.builder()
.guardrailIdentifier("guardrailIdentifier")
.guardrailVersion("guardrailVersion")
.build())
.build())
.retrieval(RetrievalFlowNodeConfigurationProperty.builder()
.serviceConfiguration(RetrievalFlowNodeServiceConfigurationProperty.builder()
.s3(RetrievalFlowNodeS3ConfigurationProperty.builder()
.bucketName("bucketName")
.build())
.build())
.build())
.storage(StorageFlowNodeConfigurationProperty.builder()
.serviceConfiguration(StorageFlowNodeServiceConfigurationProperty.builder()
.s3(StorageFlowNodeS3ConfigurationProperty.builder()
.bucketName("bucketName")
.build())
.build())
.build())
.build())
.inputs(List.of(FlowNodeInputProperty.builder()
.expression("expression")
.name("name")
.type("type")
// the properties below are optional
.category("category")
.build()))
.outputs(List.of(FlowNodeOutputProperty.builder()
.name("name")
.type("type")
.build()))
.build()))
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock;
var additionalModelRequestFields;
var collector;
var input;
var iterator;
LoopFlowNodeConfigurationProperty loopFlowNodeConfigurationProperty_;
var loopInput;
var output;
var loopFlowNodeConfigurationProperty = new LoopFlowNodeConfigurationProperty {
Definition = new FlowDefinitionProperty {
Connections = new [] { new FlowConnectionProperty {
Name = "name",
Source = "source",
Target = "target",
Type = "type",
// the properties below are optional
Configuration = new FlowConnectionConfigurationProperty {
Conditional = new FlowConditionalConnectionConfigurationProperty {
Condition = "condition"
},
Data = new FlowDataConnectionConfigurationProperty {
SourceOutput = "sourceOutput",
TargetInput = "targetInput"
}
}
} },
Nodes = new [] { new FlowNodeProperty {
Name = "name",
Type = "type",
// the properties below are optional
Configuration = new FlowNodeConfigurationProperty {
Agent = new AgentFlowNodeConfigurationProperty {
AgentAliasArn = "agentAliasArn"
},
Collector = collector,
Condition = new ConditionFlowNodeConfigurationProperty {
Conditions = new [] { new FlowConditionProperty {
Name = "name",
// the properties below are optional
Expression = "expression"
} }
},
InlineCode = new InlineCodeFlowNodeConfigurationProperty {
Code = "code",
Language = "language"
},
Input = input,
Iterator = iterator,
KnowledgeBase = new KnowledgeBaseFlowNodeConfigurationProperty {
KnowledgeBaseId = "knowledgeBaseId",
// the properties below are optional
GuardrailConfiguration = new GuardrailConfigurationProperty {
GuardrailIdentifier = "guardrailIdentifier",
GuardrailVersion = "guardrailVersion"
},
InferenceConfiguration = new PromptInferenceConfigurationProperty {
Text = new PromptModelInferenceConfigurationProperty {
MaxTokens = 123,
StopSequences = new [] { "stopSequences" },
Temperature = 123,
TopP = 123
}
},
ModelId = "modelId",
NumberOfResults = 123,
OrchestrationConfiguration = new KnowledgeBaseOrchestrationConfigurationProperty {
AdditionalModelRequestFields = additionalModelRequestFields,
InferenceConfig = new PromptInferenceConfigurationProperty {
Text = new PromptModelInferenceConfigurationProperty {
MaxTokens = 123,
StopSequences = new [] { "stopSequences" },
Temperature = 123,
TopP = 123
}
},
PerformanceConfig = new PerformanceConfigurationProperty {
Latency = "latency"
},
PromptTemplate = new KnowledgeBasePromptTemplateProperty {
TextPromptTemplate = "textPromptTemplate"
}
},
PromptTemplate = new KnowledgeBasePromptTemplateProperty {
TextPromptTemplate = "textPromptTemplate"
},
RerankingConfiguration = new VectorSearchRerankingConfigurationProperty {
Type = "type",
// the properties below are optional
BedrockRerankingConfiguration = new VectorSearchBedrockRerankingConfigurationProperty {
ModelConfiguration = new VectorSearchBedrockRerankingModelConfigurationProperty {
ModelArn = "modelArn",
// the properties below are optional
AdditionalModelRequestFields = additionalModelRequestFields
},
// the properties below are optional
MetadataConfiguration = new MetadataConfigurationForRerankingProperty {
SelectionMode = "selectionMode",
// the properties below are optional
SelectiveModeConfiguration = new RerankingMetadataSelectiveModeConfigurationProperty {
FieldsToExclude = new [] { new FieldForRerankingProperty {
FieldName = "fieldName"
} },
FieldsToInclude = new [] { new FieldForRerankingProperty {
FieldName = "fieldName"
} }
}
},
NumberOfRerankedResults = 123
}
}
},
LambdaFunction = new LambdaFunctionFlowNodeConfigurationProperty {
LambdaArn = "lambdaArn"
},
Lex = new LexFlowNodeConfigurationProperty {
BotAliasArn = "botAliasArn",
LocaleId = "localeId"
},
Loop = loopFlowNodeConfigurationProperty_,
LoopController = new LoopControllerFlowNodeConfigurationProperty {
ContinueCondition = new FlowConditionProperty {
Name = "name",
// the properties below are optional
Expression = "expression"
},
// the properties below are optional
MaxIterations = 123
},
LoopInput = loopInput,
Output = output,
Prompt = new PromptFlowNodeConfigurationProperty {
SourceConfiguration = new PromptFlowNodeSourceConfigurationProperty {
Inline = new PromptFlowNodeInlineConfigurationProperty {
ModelId = "modelId",
TemplateConfiguration = new PromptTemplateConfigurationProperty {
Text = new TextPromptTemplateConfigurationProperty {
Text = "text",
// the properties below are optional
InputVariables = new [] { new PromptInputVariableProperty {
Name = "name"
} }
}
},
TemplateType = "templateType",
// the properties below are optional
InferenceConfiguration = new PromptInferenceConfigurationProperty {
Text = new PromptModelInferenceConfigurationProperty {
MaxTokens = 123,
StopSequences = new [] { "stopSequences" },
Temperature = 123,
TopP = 123
}
}
},
Resource = new PromptFlowNodeResourceConfigurationProperty {
PromptArn = "promptArn"
}
},
// the properties below are optional
GuardrailConfiguration = new GuardrailConfigurationProperty {
GuardrailIdentifier = "guardrailIdentifier",
GuardrailVersion = "guardrailVersion"
}
},
Retrieval = new RetrievalFlowNodeConfigurationProperty {
ServiceConfiguration = new RetrievalFlowNodeServiceConfigurationProperty {
S3 = new RetrievalFlowNodeS3ConfigurationProperty {
BucketName = "bucketName"
}
}
},
Storage = new StorageFlowNodeConfigurationProperty {
ServiceConfiguration = new StorageFlowNodeServiceConfigurationProperty {
S3 = new StorageFlowNodeS3ConfigurationProperty {
BucketName = "bucketName"
}
}
}
},
Inputs = new [] { new FlowNodeInputProperty {
Expression = "expression",
Name = "name",
Type = "type",
// the properties below are optional
Category = "category"
} },
Outputs = new [] { new FlowNodeOutputProperty {
Name = "name",
Type = "type"
} }
} }
}
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var additionalModelRequestFields interface{}
var collector interface{}
var input interface{}
var iterator interface{}
var loopFlowNodeConfigurationProperty_ LoopFlowNodeConfigurationProperty
var loopInput interface{}
var output interface{}
loopFlowNodeConfigurationProperty := &LoopFlowNodeConfigurationProperty{
Definition: &FlowDefinitionProperty{
Connections: []interface{}{
&FlowConnectionProperty{
Name: jsii.String("name"),
Source: jsii.String("source"),
Target: jsii.String("target"),
Type: jsii.String("type"),
// the properties below are optional
Configuration: &FlowConnectionConfigurationProperty{
Conditional: &FlowConditionalConnectionConfigurationProperty{
Condition: jsii.String("condition"),
},
Data: &FlowDataConnectionConfigurationProperty{
SourceOutput: jsii.String("sourceOutput"),
TargetInput: jsii.String("targetInput"),
},
},
},
},
Nodes: []interface{}{
&FlowNodeProperty{
Name: jsii.String("name"),
Type: jsii.String("type"),
// the properties below are optional
Configuration: &FlowNodeConfigurationProperty{
Agent: &AgentFlowNodeConfigurationProperty{
AgentAliasArn: jsii.String("agentAliasArn"),
},
Collector: collector,
Condition: &ConditionFlowNodeConfigurationProperty{
Conditions: []interface{}{
&FlowConditionProperty{
Name: jsii.String("name"),
// the properties below are optional
Expression: jsii.String("expression"),
},
},
},
InlineCode: &InlineCodeFlowNodeConfigurationProperty{
Code: jsii.String("code"),
Language: jsii.String("language"),
},
Input: input,
Iterator: iterator,
KnowledgeBase: &KnowledgeBaseFlowNodeConfigurationProperty{
KnowledgeBaseId: jsii.String("knowledgeBaseId"),
// the properties below are optional
GuardrailConfiguration: &GuardrailConfigurationProperty{
GuardrailIdentifier: jsii.String("guardrailIdentifier"),
GuardrailVersion: jsii.String("guardrailVersion"),
},
InferenceConfiguration: &PromptInferenceConfigurationProperty{
Text: &PromptModelInferenceConfigurationProperty{
MaxTokens: jsii.Number(123),
StopSequences: []*string{
jsii.String("stopSequences"),
},
Temperature: jsii.Number(123),
TopP: jsii.Number(123),
},
},
ModelId: jsii.String("modelId"),
NumberOfResults: jsii.Number(123),
OrchestrationConfiguration: &KnowledgeBaseOrchestrationConfigurationProperty{
AdditionalModelRequestFields: additionalModelRequestFields,
InferenceConfig: &PromptInferenceConfigurationProperty{
Text: &PromptModelInferenceConfigurationProperty{
MaxTokens: jsii.Number(123),
StopSequences: []*string{
jsii.String("stopSequences"),
},
Temperature: jsii.Number(123),
TopP: jsii.Number(123),
},
},
PerformanceConfig: &PerformanceConfigurationProperty{
Latency: jsii.String("latency"),
},
PromptTemplate: &KnowledgeBasePromptTemplateProperty{
TextPromptTemplate: jsii.String("textPromptTemplate"),
},
},
PromptTemplate: &KnowledgeBasePromptTemplateProperty{
TextPromptTemplate: jsii.String("textPromptTemplate"),
},
RerankingConfiguration: &VectorSearchRerankingConfigurationProperty{
Type: jsii.String("type"),
// the properties below are optional
BedrockRerankingConfiguration: &VectorSearchBedrockRerankingConfigurationProperty{
ModelConfiguration: &VectorSearchBedrockRerankingModelConfigurationProperty{
ModelArn: jsii.String("modelArn"),
// the properties below are optional
AdditionalModelRequestFields: additionalModelRequestFields,
},
// the properties below are optional
MetadataConfiguration: &MetadataConfigurationForRerankingProperty{
SelectionMode: jsii.String("selectionMode"),
// the properties below are optional
SelectiveModeConfiguration: &RerankingMetadataSelectiveModeConfigurationProperty{
FieldsToExclude: []interface{}{
&FieldForRerankingProperty{
FieldName: jsii.String("fieldName"),
},
},
FieldsToInclude: []interface{}{
&FieldForRerankingProperty{
FieldName: jsii.String("fieldName"),
},
},
},
},
NumberOfRerankedResults: jsii.Number(123),
},
},
},
LambdaFunction: &LambdaFunctionFlowNodeConfigurationProperty{
LambdaArn: jsii.String("lambdaArn"),
},
Lex: &LexFlowNodeConfigurationProperty{
BotAliasArn: jsii.String("botAliasArn"),
LocaleId: jsii.String("localeId"),
},
Loop: loopFlowNodeConfigurationProperty_,
LoopController: &LoopControllerFlowNodeConfigurationProperty{
ContinueCondition: &FlowConditionProperty{
Name: jsii.String("name"),
// the properties below are optional
Expression: jsii.String("expression"),
},
// the properties below are optional
MaxIterations: jsii.Number(123),
},
LoopInput: loopInput,
Output: output,
Prompt: &PromptFlowNodeConfigurationProperty{
SourceConfiguration: &PromptFlowNodeSourceConfigurationProperty{
Inline: &PromptFlowNodeInlineConfigurationProperty{
ModelId: jsii.String("modelId"),
TemplateConfiguration: &PromptTemplateConfigurationProperty{
Text: &TextPromptTemplateConfigurationProperty{
Text: jsii.String("text"),
// the properties below are optional
InputVariables: []interface{}{
&PromptInputVariableProperty{
Name: jsii.String("name"),
},
},
},
},
TemplateType: jsii.String("templateType"),
// the properties below are optional
InferenceConfiguration: &PromptInferenceConfigurationProperty{
Text: &PromptModelInferenceConfigurationProperty{
MaxTokens: jsii.Number(123),
StopSequences: []*string{
jsii.String("stopSequences"),
},
Temperature: jsii.Number(123),
TopP: jsii.Number(123),
},
},
},
Resource: &PromptFlowNodeResourceConfigurationProperty{
PromptArn: jsii.String("promptArn"),
},
},
// the properties below are optional
GuardrailConfiguration: &GuardrailConfigurationProperty{
GuardrailIdentifier: jsii.String("guardrailIdentifier"),
GuardrailVersion: jsii.String("guardrailVersion"),
},
},
Retrieval: &RetrievalFlowNodeConfigurationProperty{
ServiceConfiguration: &RetrievalFlowNodeServiceConfigurationProperty{
S3: &RetrievalFlowNodeS3ConfigurationProperty{
BucketName: jsii.String("bucketName"),
},
},
},
Storage: &StorageFlowNodeConfigurationProperty{
ServiceConfiguration: &StorageFlowNodeServiceConfigurationProperty{
S3: &StorageFlowNodeS3ConfigurationProperty{
BucketName: jsii.String("bucketName"),
},
},
},
},
Inputs: []interface{}{
&FlowNodeInputProperty{
Expression: jsii.String("expression"),
Name: jsii.String("name"),
Type: jsii.String("type"),
// the properties below are optional
Category: jsii.String("category"),
},
},
Outputs: []interface{}{
&FlowNodeOutputProperty{
Name: jsii.String("name"),
Type: jsii.String("type"),
},
},
},
},
},
}
Properties
definitionIResolvable | CfnFlow.FlowDefinitionPropertydefinitiontyping.Union[IResolvable, FlowDefinitionProperty]definitionIResolvableDefinitionIResolvableDefinitioninterface{}required#The definition of the DoWhile loop nodes and connections between nodes in the flow.