Skip to content

Commit

Permalink
fix integ
Browse files Browse the repository at this point in the history
  • Loading branch information
shikha372 committed Sep 5, 2024
1 parent af747c8 commit aa8897c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
{
"Ref": "AWS::Region"
},
"::foundation-model/amazon.titan-text-express-v1\",\"Body\":{\"inputText.$\":\"States.Format('Alphabetize this list of first names: {}', $.names)\",\"textGenerationConfig\":{\"maxTokenCount\":100,\"temperature\":1}}}},\"Prompt3\":{\"Next\":\"Prompt4\",\"Type\":\"Task\",\"OutputPath\":\"$.Body.results[0].outputText\",\"Resource\":\"arn:",
"::foundation-model/amazon.titan-text-express-v1\",\"Body\":{\"inputText.$\":\"States.Format('Alphabetize this list of first names:/n{}', $.names)\",\"textGenerationConfig\":{\"maxTokenCount\":100,\"temperature\":1}}}},\"Prompt3\":{\"Next\":\"Prompt4\",\"Type\":\"Task\",\"OutputPath\":\"$.Body.results[0].outputText\",\"Resource\":\"arn:",
{
"Ref": "AWS::Partition"
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import { BedrockInvokeModel } from 'aws-cdk-lib/aws-stepfunctions-tasks';
* * aws stepfunctions describe-execution --execution-arn <exection-arn generated before> : should return status as SUCCEEDED
* This integ test does not actually verify a Step Functions execution, as not all AWS accounts have Bedrock model access.
*/
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-cdk.aws-stepfunctions-tasks:useNewS3UriParametersForBedrockInvokeModelTask': true,
},
});
const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-stepfunctions-tasks-bedrock-invoke-model-integ');

const model = bedrock.FoundationModel.fromFoundationModelId(stack, 'Model', bedrock.FoundationModelIdentifier.AMAZON_TITAN_TEXT_G1_EXPRESS_V1);
Expand All @@ -41,7 +37,7 @@ const prompt2 = new BedrockInvokeModel(stack, 'Prompt2', {
body: sfn.TaskInput.fromObject(
{
inputText: sfn.JsonPath.format(
'Alphabetize this list of first names: {}',
'Alphabetize this list of first names:/n{}',
sfn.JsonPath.stringAt('$.names'),
),
textGenerationConfig: {
Expand Down Expand Up @@ -75,7 +71,7 @@ const prompt3 = new BedrockInvokeModel(stack, 'Prompt3', {
});

/** Test for Bedrock s3 URI Path */
//Execution will fail for the following input as it expects a valid s3 URI from previous prompt
//State Machine Execution will fail for the following input as it expects a valid s3 URI from previous prompt
const prompt4 = new BedrockInvokeModel(stack, 'Prompt4', {
model,
input: { s3InputUri: '$.names' },
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ The following json shows the current recommended set of flags, as `cdk init` wou
"@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true,
"@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm": true,
"@aws-cdk/custom-resources:logApiResponseDataPropertyTrueDefault": false,
"@aws-cdk/aws-s3:keepNotificationInImportedBucket": false,
"@aws-cdk:aws-stepfunctions-tasks:useNewS3UriParametersForBedrockInvokeModelTask": true
"@aws-cdk/aws-s3:keepNotificationInImportedBucket": false
}
}
```
Expand Down Expand Up @@ -1374,5 +1373,6 @@ When this feature flag is enabled, specify newly introduced props 's3InputUri' a
| (not in v1) | | |
| V2NEXT | `true` | `true` |

**Compatibility with old behavior:** Disable the feature flag to use input and output path fields for s3 URI

<!-- END details -->

0 comments on commit aa8897c

Please sign in to comment.