class CfnFlowPropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.Bedrock.Mixins.CfnFlowPropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awsbedrock/mixins#CfnFlowPropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.bedrock.mixins.CfnFlowPropsMixin |
Python | aws_cdk.mixins_preview.aws_bedrock.mixins.CfnFlowPropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_bedrock » mixins » CfnFlowPropsMixin |
Implements
IMixin
Extends
Mixin
Creates a prompt flow that you can use to send an input through various steps to yield an output.
You define a flow by configuring nodes, each of which corresponds to a step of the flow, and creating connections between the nodes to create paths to different outputs. You can define the flow in one of the following ways:
- Define a FlowDefinition in the
Definitionproperty. - Provide the definition in the
DefinitionStringproperty as a JSON-formatted string matching the FlowDefinition property. - Provide an Amazon S3 location in the
DefinitionS3Locationproperty that matches the FlowDefinition .
If you use the DefinitionString or DefinitionS3Location property, you can use the DefinitionSubstitutions property to define key-value pairs to replace at runtime.
For more information, see How it works and Create a prompt flow in Amazon Bedrock in the Amazon Bedrock User Guide.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-flow.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins } from '@aws-cdk/mixins-preview';
import { mixins as bedrock_mixins } from '@aws-cdk/mixins-preview/aws-bedrock';
declare const additionalModelRequestFields: any;
declare const collector: any;
declare const flowDefinitionProperty_: bedrock_mixins.CfnFlowPropsMixin.FlowDefinitionProperty;
declare const input: any;
declare const iterator: any;
declare const loopInput: any;
declare const output: any;
const cfnFlowPropsMixin = new bedrock_mixins.CfnFlowPropsMixin({
customerEncryptionKeyArn: 'customerEncryptionKeyArn',
definition: {
connections: [{
configuration: {
conditional: {
condition: 'condition',
},
data: {
sourceOutput: 'sourceOutput',
targetInput: 'targetInput',
},
},
name: 'name',
source: 'source',
target: 'target',
type: 'type',
}],
nodes: [{
configuration: {
agent: {
agentAliasArn: 'agentAliasArn',
},
collector: collector,
condition: {
conditions: [{
expression: 'expression',
name: 'name',
}],
},
inlineCode: {
code: 'code',
language: 'language',
},
input: input,
iterator: iterator,
knowledgeBase: {
guardrailConfiguration: {
guardrailIdentifier: 'guardrailIdentifier',
guardrailVersion: 'guardrailVersion',
},
inferenceConfiguration: {
text: {
maxTokens: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topP: 123,
},
},
knowledgeBaseId: 'knowledgeBaseId',
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: {
bedrockRerankingConfiguration: {
metadataConfiguration: {
selectionMode: 'selectionMode',
selectiveModeConfiguration: {
fieldsToExclude: [{
fieldName: 'fieldName',
}],
fieldsToInclude: [{
fieldName: 'fieldName',
}],
},
},
modelConfiguration: {
additionalModelRequestFields: additionalModelRequestFields,
modelArn: 'modelArn',
},
numberOfRerankedResults: 123,
},
type: 'type',
},
},
lambdaFunction: {
lambdaArn: 'lambdaArn',
},
lex: {
botAliasArn: 'botAliasArn',
localeId: 'localeId',
},
loop: {
definition: flowDefinitionProperty_,
},
loopController: {
continueCondition: {
expression: 'expression',
name: 'name',
},
maxIterations: 123,
},
loopInput: loopInput,
output: output,
prompt: {
guardrailConfiguration: {
guardrailIdentifier: 'guardrailIdentifier',
guardrailVersion: 'guardrailVersion',
},
sourceConfiguration: {
inline: {
inferenceConfiguration: {
text: {
maxTokens: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topP: 123,
},
},
modelId: 'modelId',
templateConfiguration: {
text: {
inputVariables: [{
name: 'name',
}],
text: 'text',
},
},
templateType: 'templateType',
},
resource: {
promptArn: 'promptArn',
},
},
},
retrieval: {
serviceConfiguration: {
s3: {
bucketName: 'bucketName',
},
},
},
storage: {
serviceConfiguration: {
s3: {
bucketName: 'bucketName',
},
},
},
},
inputs: [{
category: 'category',
expression: 'expression',
name: 'name',
type: 'type',
}],
name: 'name',
outputs: [{
name: 'name',
type: 'type',
}],
type: 'type',
}],
},
definitionS3Location: {
bucket: 'bucket',
key: 'key',
version: 'version',
},
definitionString: 'definitionString',
definitionSubstitutions: {
definitionSubstitutionsKey: 'definitionSubstitutions',
},
description: 'description',
executionRoleArn: 'executionRoleArn',
name: 'name',
tags: {
tagsKey: 'tags',
},
testAliasTags: {
testAliasTagsKey: 'testAliasTags',
},
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnFlowPropsMixin(props: CfnFlowMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Flow Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::Bedrock::Flow.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): IConstruct
Parameters
- construct
IConstruct
Returns
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript