From bac7f588b41e7d0783cebe00cb9d6aa7f0f3c0ce Mon Sep 17 00:00:00 2001 From: krokoko Date: Mon, 6 Jan 2025 09:45:45 -0600 Subject: [PATCH] chore(build): fix build --- CHANGELOG.md | 4 + DEVELOPER_GUIDE.md | 2 +- apidocs/interfaces/DockerLambdaCustomProps.md | 2 +- apidocs/namespaces/bedrock/README.md | 6 + .../namespaces/bedrock/classes/ChatMessage.md | 86 +++++++ .../bedrock/classes/PromptVariant.md | 49 +++- .../namespaces/bedrock/classes/ToolChoice.md | 95 ++++++++ .../bedrock/enumerations/ChatMessageRole.md | 25 ++ .../enumerations/PromptTemplateType.md | 6 + .../interfaces/AgentPromptVariantProps.md | 65 +++++ .../interfaces/ChatPromptVariantProps.md | 82 +++++++ .../interfaces/CommonPromptVariantProps.md | 10 + .../interfaces/TextPromptVariantProps.md | 10 +- .../bedrock/interfaces/ToolConfiguration.md | 19 ++ .../custom-resource-provider-helper.ts | 11 + ...efaultTestDeployAssertE49B1ECE.assets.json | 19 ++ ...aultTestDeployAssertE49B1ECE.template.json | 36 +++ ...edrock-chat-prompts-integ-test.assets.json | 19 ++ ...rock-chat-prompts-integ-test.template.json | 223 ++++++++++++++++++ .../chatprompt.integ.snapshot/integ.json | 19 ++ ...efaultTestDeployAssertE49B1ECE.assets.json | 2 +- ...-bedrock-guardrails-integ-test.assets.json | 2 +- .../integ.json | 2 +- ...efaultTestDeployAssertE49B1ECE.assets.json | 2 +- ...-cdk-aoss-dashboard-integ-test.assets.json | 2 +- .../integ.json | 2 +- ...efaultTestDeployAssertE49B1ECE.assets.json | 2 +- ...a-index-data-loader-integ-test.assets.json | 2 +- .../integ.json | 2 +- 29 files changed, 791 insertions(+), 15 deletions(-) create mode 100644 apidocs/namespaces/bedrock/classes/ChatMessage.md create mode 100644 apidocs/namespaces/bedrock/classes/ToolChoice.md create mode 100644 apidocs/namespaces/bedrock/enumerations/ChatMessageRole.md create mode 100644 apidocs/namespaces/bedrock/interfaces/AgentPromptVariantProps.md create mode 100644 apidocs/namespaces/bedrock/interfaces/ChatPromptVariantProps.md create mode 100644 apidocs/namespaces/bedrock/interfaces/ToolConfiguration.md create mode 100644 test/integ/chatprompt.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json create mode 100644 test/integ/chatprompt.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.template.json create mode 100644 test/integ/chatprompt.integ.snapshot/aws-cdk-bedrock-chat-prompts-integ-test.assets.json create mode 100644 test/integ/chatprompt.integ.snapshot/aws-cdk-bedrock-chat-prompts-integ-test.template.json create mode 100644 test/integ/chatprompt.integ.snapshot/integ.json diff --git a/CHANGELOG.md b/CHANGELOG.md index ed629d71..8bbafe9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# CDK Generative AI Constructs V0.1.289 (2025-01-08) + +Based on CDK library version 2.174.0 + # CDK Generative AI Constructs V0.1.283 (2024-11-20) Based on CDK library version 2.166.0 diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 9118b64b..e6e43fb9 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -16,7 +16,7 @@ Default output format [None]: json ``` - [Node](https://nodejs.org/en) >= v20.9.0 -- [AWS CDK](https://github.com/aws/aws-cdk/releases/tag/v2.166.0) >= 2.166.0 +- [AWS CDK](https://github.com/aws/aws-cdk/releases/tag/v2.174.0) >= 2.174.0 - [Python](https://www.python.org/downloads/) >=3.9 - [Projen](https://github.com/projen/projen) >= 0.78.8 - [Yarn](https://classic.yarnpkg.com/lang/en/docs/cli/install/) >= 1.22.19 diff --git a/apidocs/interfaces/DockerLambdaCustomProps.md b/apidocs/interfaces/DockerLambdaCustomProps.md index 94f22777..330cc7ec 100644 --- a/apidocs/interfaces/DockerLambdaCustomProps.md +++ b/apidocs/interfaces/DockerLambdaCustomProps.md @@ -669,7 +669,7 @@ stable > `readonly` `optional` **snapStart**: `SnapStartConf` Enable SnapStart for Lambda Function. -SnapStart is currently supported only for Java 11, 17 runtime +SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime #### Default diff --git a/apidocs/namespaces/bedrock/README.md b/apidocs/namespaces/bedrock/README.md index 35115dc6..59734f9a 100644 --- a/apidocs/namespaces/bedrock/README.md +++ b/apidocs/namespaces/bedrock/README.md @@ -12,6 +12,7 @@ ## Enumerations +- [ChatMessageRole](enumerations/ChatMessageRole.md) - [ConfluenceDataSourceAuthType](enumerations/ConfluenceDataSourceAuthType.md) - [ConfluenceObjectType](enumerations/ConfluenceObjectType.md) - [ContentFilterStrength](enumerations/ContentFilterStrength.md) @@ -43,6 +44,7 @@ - [ApiSchema](classes/ApiSchema.md) - [ApplicationInferenceProfile](classes/ApplicationInferenceProfile.md) - [BedrockFoundationModel](classes/BedrockFoundationModel.md) +- [ChatMessage](classes/ChatMessage.md) - [ChunkingStrategy](classes/ChunkingStrategy.md) - [ConfluenceDataSource](classes/ConfluenceDataSource.md) - [CrossRegionInferenceProfile](classes/CrossRegionInferenceProfile.md) @@ -64,6 +66,7 @@ - [S3DataSource](classes/S3DataSource.md) - [SalesforceDataSource](classes/SalesforceDataSource.md) - [SharePointDataSource](classes/SharePointDataSource.md) +- [ToolChoice](classes/ToolChoice.md) - [Topic](classes/Topic.md) - [WebCrawlerDataSource](classes/WebCrawlerDataSource.md) @@ -73,11 +76,13 @@ - [AddAgentAliasProps](interfaces/AddAgentAliasProps.md) - [AgentActionGroupProps](interfaces/AgentActionGroupProps.md) - [AgentAliasProps](interfaces/AgentAliasProps.md) +- [AgentPromptVariantProps](interfaces/AgentPromptVariantProps.md) - [AgentProps](interfaces/AgentProps.md) - [ApiSchemaConfig](interfaces/ApiSchemaConfig.md) - [ApplicationInferenceProfileAttributes](interfaces/ApplicationInferenceProfileAttributes.md) - [ApplicationInferenceProfileProps](interfaces/ApplicationInferenceProfileProps.md) - [BedrockFoundationModelProps](interfaces/BedrockFoundationModelProps.md) +- [ChatPromptVariantProps](interfaces/ChatPromptVariantProps.md) - [CommonPromptVariantProps](interfaces/CommonPromptVariantProps.md) - [ConfluenceCrawlingFilters](interfaces/ConfluenceCrawlingFilters.md) - [ConfluenceDataSourceAssociationProps](interfaces/ConfluenceDataSourceAssociationProps.md) @@ -121,6 +126,7 @@ - [SharePointDataSourceAssociationProps](interfaces/SharePointDataSourceAssociationProps.md) - [SharePointDataSourceProps](interfaces/SharePointDataSourceProps.md) - [TextPromptVariantProps](interfaces/TextPromptVariantProps.md) +- [ToolConfiguration](interfaces/ToolConfiguration.md) - [WebCrawlerDataSourceAssociationProps](interfaces/WebCrawlerDataSourceAssociationProps.md) - [WebCrawlerDataSourceProps](interfaces/WebCrawlerDataSourceProps.md) diff --git a/apidocs/namespaces/bedrock/classes/ChatMessage.md b/apidocs/namespaces/bedrock/classes/ChatMessage.md new file mode 100644 index 00000000..d4881e16 --- /dev/null +++ b/apidocs/namespaces/bedrock/classes/ChatMessage.md @@ -0,0 +1,86 @@ +[**@cdklabs/generative-ai-cdk-constructs**](../../../README.md) + +*** + +[@cdklabs/generative-ai-cdk-constructs](../../../README.md) / [bedrock](../README.md) / ChatMessage + +# Class: ChatMessage + +## Constructors + +### new ChatMessage() + +> **new ChatMessage**(`role`, `text`): [`ChatMessage`](ChatMessage.md) + +#### Parameters + +##### role + +[`ChatMessageRole`](../enumerations/ChatMessageRole.md) + +##### text + +`string` + +#### Returns + +[`ChatMessage`](ChatMessage.md) + +## Properties + +### role + +> `readonly` **role**: [`ChatMessageRole`](../enumerations/ChatMessageRole.md) + +*** + +### text + +> `readonly` **text**: `string` + +## Methods + +### \_\_render() + +> **\_\_render**(): `MessageProperty` + +**`Internal`** + +Renders as Cfn Property + This is an internal core function and should not be called directly. + +#### Returns + +`MessageProperty` + +*** + +### assistantMessage() + +> `static` **assistantMessage**(`text`): [`ChatMessage`](ChatMessage.md) + +#### Parameters + +##### text + +`string` + +#### Returns + +[`ChatMessage`](ChatMessage.md) + +*** + +### userMessage() + +> `static` **userMessage**(`text`): [`ChatMessage`](ChatMessage.md) + +#### Parameters + +##### text + +`string` + +#### Returns + +[`ChatMessage`](ChatMessage.md) diff --git a/apidocs/namespaces/bedrock/classes/PromptVariant.md b/apidocs/namespaces/bedrock/classes/PromptVariant.md index 2f94156e..ffdcd0b2 100644 --- a/apidocs/namespaces/bedrock/classes/PromptVariant.md +++ b/apidocs/namespaces/bedrock/classes/PromptVariant.md @@ -22,6 +22,14 @@ You can optimize the prompt for specific use cases and models. ## Properties +### genAiResource? + +> `abstract` `optional` **genAiResource**: `PromptGenAiResourceProperty` + +The template configuration. + +*** + ### inferenceConfiguration? > `abstract` `optional` **inferenceConfiguration**: `PromptInferenceConfigurationProperty` @@ -56,12 +64,51 @@ The template configuration. ### templateType -> `abstract` **templateType**: [`TEXT`](../enumerations/PromptTemplateType.md#text) +> `abstract` **templateType**: [`PromptTemplateType`](../enumerations/PromptTemplateType.md) The type of prompt template. ## Methods +### agent() + +> `static` **agent**(`props`): [`PromptVariant`](PromptVariant.md) + +Static method to create an agent prompt template. + +#### Parameters + +##### props + +[`AgentPromptVariantProps`](../interfaces/AgentPromptVariantProps.md) + +#### Returns + +[`PromptVariant`](PromptVariant.md) + +*** + +### chat() + +> `static` **chat**(`props`): [`PromptVariant`](PromptVariant.md) + +Static method to create a chat template. Use this template type when +the model supports the Converse API or the AnthropicClaude Messages API. +This allows you to include a System prompt and previous User messages +and Assistant messages for context. + +#### Parameters + +##### props + +[`ChatPromptVariantProps`](../interfaces/ChatPromptVariantProps.md) + +#### Returns + +[`PromptVariant`](PromptVariant.md) + +*** + ### text() > `static` **text**(`props`): [`PromptVariant`](PromptVariant.md) diff --git a/apidocs/namespaces/bedrock/classes/ToolChoice.md b/apidocs/namespaces/bedrock/classes/ToolChoice.md new file mode 100644 index 00000000..e1228f50 --- /dev/null +++ b/apidocs/namespaces/bedrock/classes/ToolChoice.md @@ -0,0 +1,95 @@ +[**@cdklabs/generative-ai-cdk-constructs**](../../../README.md) + +*** + +[@cdklabs/generative-ai-cdk-constructs](../../../README.md) / [bedrock](../README.md) / ToolChoice + +# Class: ToolChoice + +## Constructors + +### new ToolChoice() + +> **new ToolChoice**(`any`, `auto`, `tool`?): [`ToolChoice`](ToolChoice.md) + +#### Parameters + +##### any + +`any` + +##### auto + +`any` + +##### tool? + +`string` + +#### Returns + +[`ToolChoice`](ToolChoice.md) + +## Properties + +### any? + +> `readonly` `optional` **any**: `any` + +*** + +### auto? + +> `readonly` `optional` **auto**: `any` + +*** + +### tool? + +> `readonly` `optional` **tool**: `string` + +*** + +### ANY + +> `readonly` `static` **ANY**: [`ToolChoice`](ToolChoice.md) + +The model must request at least one tool (no text is generated) + +*** + +### AUTO + +> `readonly` `static` **AUTO**: [`ToolChoice`](ToolChoice.md) + +(Default). The Model automatically decides if a tool should be called or whether to generate text instead. + +## Methods + +### \_\_render() + +> **\_\_render**(): `ToolChoiceProperty` + +**`Internal`** + +#### Returns + +`ToolChoiceProperty` + +*** + +### specificTool() + +> `static` **specificTool**(`toolName`): [`ToolChoice`](ToolChoice.md) + +The Model must request the specified tool. Only supported by some models like Anthropic Claude 3 models. + +#### Parameters + +##### toolName + +`string` + +#### Returns + +[`ToolChoice`](ToolChoice.md) diff --git a/apidocs/namespaces/bedrock/enumerations/ChatMessageRole.md b/apidocs/namespaces/bedrock/enumerations/ChatMessageRole.md new file mode 100644 index 00000000..bb70cccc --- /dev/null +++ b/apidocs/namespaces/bedrock/enumerations/ChatMessageRole.md @@ -0,0 +1,25 @@ +[**@cdklabs/generative-ai-cdk-constructs**](../../../README.md) + +*** + +[@cdklabs/generative-ai-cdk-constructs](../../../README.md) / [bedrock](../README.md) / ChatMessageRole + +# Enumeration: ChatMessageRole + +## Enumeration Members + +### ASSISTANT + +> **ASSISTANT**: `"assistant"` + +This is the role of the model itself, responding to user inputs based on +the context set by the system. + +*** + +### USER + +> **USER**: `"user"` + +This role represents the human user in the conversation. Inputs from the +user guide the conversation and prompt responses from the assistant. diff --git a/apidocs/namespaces/bedrock/enumerations/PromptTemplateType.md b/apidocs/namespaces/bedrock/enumerations/PromptTemplateType.md index 4117f820..48923c86 100644 --- a/apidocs/namespaces/bedrock/enumerations/PromptTemplateType.md +++ b/apidocs/namespaces/bedrock/enumerations/PromptTemplateType.md @@ -8,6 +8,12 @@ ## Enumeration Members +### CHAT + +> **CHAT**: `"CHAT"` + +*** + ### TEXT > **TEXT**: `"TEXT"` diff --git a/apidocs/namespaces/bedrock/interfaces/AgentPromptVariantProps.md b/apidocs/namespaces/bedrock/interfaces/AgentPromptVariantProps.md new file mode 100644 index 00000000..af6985f0 --- /dev/null +++ b/apidocs/namespaces/bedrock/interfaces/AgentPromptVariantProps.md @@ -0,0 +1,65 @@ +[**@cdklabs/generative-ai-cdk-constructs**](../../../README.md) + +*** + +[@cdklabs/generative-ai-cdk-constructs](../../../README.md) / [bedrock](../README.md) / AgentPromptVariantProps + +# Interface: AgentPromptVariantProps + +## Extends + +- [`CommonPromptVariantProps`](CommonPromptVariantProps.md) + +## Properties + +### agentAlias + +> `readonly` **agentAlias**: [`IAgentAlias`](IAgentAlias.md) + +An alias pointing to the agent version to be used. + +*** + +### model + +> `readonly` **model**: [`IInvokable`](IInvokable.md) + +The model which is used to run the prompt. The model could be a foundation +model, a custom model, or a provisioned model. + +#### Inherited from + +[`CommonPromptVariantProps`](CommonPromptVariantProps.md).[`model`](CommonPromptVariantProps.md#model) + +*** + +### promptText + +> `readonly` **promptText**: `string` + +The text prompt. Variables are used by enclosing its name with double curly braces +as in `{{variable_name}}`. + +*** + +### promptVariables? + +> `readonly` `optional` **promptVariables**: `string`[] + +The variables in the prompt template that can be filled in at runtime. + +#### Inherited from + +[`CommonPromptVariantProps`](CommonPromptVariantProps.md).[`promptVariables`](CommonPromptVariantProps.md#promptvariables) + +*** + +### variantName + +> `readonly` **variantName**: `string` + +The name of the prompt variant. + +#### Inherited from + +[`CommonPromptVariantProps`](CommonPromptVariantProps.md).[`variantName`](CommonPromptVariantProps.md#variantname) diff --git a/apidocs/namespaces/bedrock/interfaces/ChatPromptVariantProps.md b/apidocs/namespaces/bedrock/interfaces/ChatPromptVariantProps.md new file mode 100644 index 00000000..658a4ffa --- /dev/null +++ b/apidocs/namespaces/bedrock/interfaces/ChatPromptVariantProps.md @@ -0,0 +1,82 @@ +[**@cdklabs/generative-ai-cdk-constructs**](../../../README.md) + +*** + +[@cdklabs/generative-ai-cdk-constructs](../../../README.md) / [bedrock](../README.md) / ChatPromptVariantProps + +# Interface: ChatPromptVariantProps + +## Extends + +- [`CommonPromptVariantProps`](CommonPromptVariantProps.md) + +## Properties + +### inferenceConfiguration? + +> `readonly` `optional` **inferenceConfiguration**: `PromptModelInferenceConfigurationProperty` + +Inference configuration for the Text Prompt + +*** + +### messages + +> `readonly` **messages**: [`ChatMessage`](../classes/ChatMessage.md)[] + +Inference configuration for the Chat Prompt. +Must include at least one User Message. +The messages should alternate between User and Assistant. + +*** + +### model + +> `readonly` **model**: [`IInvokable`](IInvokable.md) + +The model which is used to run the prompt. The model could be a foundation +model, a custom model, or a provisioned model. + +#### Inherited from + +[`CommonPromptVariantProps`](CommonPromptVariantProps.md).[`model`](CommonPromptVariantProps.md#model) + +*** + +### promptVariables? + +> `readonly` `optional` **promptVariables**: `string`[] + +The variables in the prompt template that can be filled in at runtime. + +#### Inherited from + +[`CommonPromptVariantProps`](CommonPromptVariantProps.md).[`promptVariables`](CommonPromptVariantProps.md#promptvariables) + +*** + +### system? + +> `readonly` `optional` **system**: `string` + +Context or instructions for the model to consider before generating a response. + +*** + +### toolConfiguration? + +> `readonly` `optional` **toolConfiguration**: [`ToolConfiguration`](ToolConfiguration.md) + +The configuration with available tools to the model and how it must use them. + +*** + +### variantName + +> `readonly` **variantName**: `string` + +The name of the prompt variant. + +#### Inherited from + +[`CommonPromptVariantProps`](CommonPromptVariantProps.md).[`variantName`](CommonPromptVariantProps.md#variantname) diff --git a/apidocs/namespaces/bedrock/interfaces/CommonPromptVariantProps.md b/apidocs/namespaces/bedrock/interfaces/CommonPromptVariantProps.md index ed91a405..1d5b6423 100644 --- a/apidocs/namespaces/bedrock/interfaces/CommonPromptVariantProps.md +++ b/apidocs/namespaces/bedrock/interfaces/CommonPromptVariantProps.md @@ -9,6 +9,8 @@ ## Extended by - [`TextPromptVariantProps`](TextPromptVariantProps.md) +- [`ChatPromptVariantProps`](ChatPromptVariantProps.md) +- [`AgentPromptVariantProps`](AgentPromptVariantProps.md) ## Properties @@ -21,6 +23,14 @@ model, a custom model, or a provisioned model. *** +### promptVariables? + +> `readonly` `optional` **promptVariables**: `string`[] + +The variables in the prompt template that can be filled in at runtime. + +*** + ### variantName > `readonly` **variantName**: `string` diff --git a/apidocs/namespaces/bedrock/interfaces/TextPromptVariantProps.md b/apidocs/namespaces/bedrock/interfaces/TextPromptVariantProps.md index 081885f6..ecfc7062 100644 --- a/apidocs/namespaces/bedrock/interfaces/TextPromptVariantProps.md +++ b/apidocs/namespaces/bedrock/interfaces/TextPromptVariantProps.md @@ -37,17 +37,21 @@ model, a custom model, or a provisioned model. > `readonly` **promptText**: `string` -The text prompt. Variables are used by encolsing its name with double curly braces +The text prompt. Variables are used by enclosing its name with double curly braces as in `{{variable_name}}`. *** -### promptVariables +### promptVariables? -> `readonly` **promptVariables**: `string`[] +> `readonly` `optional` **promptVariables**: `string`[] The variables in the prompt template that can be filled in at runtime. +#### Inherited from + +[`CommonPromptVariantProps`](CommonPromptVariantProps.md).[`promptVariables`](CommonPromptVariantProps.md#promptvariables) + *** ### variantName diff --git a/apidocs/namespaces/bedrock/interfaces/ToolConfiguration.md b/apidocs/namespaces/bedrock/interfaces/ToolConfiguration.md new file mode 100644 index 00000000..a62ca4b4 --- /dev/null +++ b/apidocs/namespaces/bedrock/interfaces/ToolConfiguration.md @@ -0,0 +1,19 @@ +[**@cdklabs/generative-ai-cdk-constructs**](../../../README.md) + +*** + +[@cdklabs/generative-ai-cdk-constructs](../../../README.md) / [bedrock](../README.md) / ToolConfiguration + +# Interface: ToolConfiguration + +## Properties + +### toolChoice + +> `readonly` **toolChoice**: [`ToolChoice`](../classes/ToolChoice.md) + +*** + +### tools + +> `readonly` **tools**: `ToolProperty`[] diff --git a/src/common/helpers/custom-resource-provider-helper.ts b/src/common/helpers/custom-resource-provider-helper.ts index 9fa21c19..5b73e140 100644 --- a/src/common/helpers/custom-resource-provider-helper.ts +++ b/src/common/helpers/custom-resource-provider-helper.ts @@ -143,6 +143,17 @@ export function buildCustomResourceProvider(props: CRProviderProps): ICRProvider this.serviceToken = this.provider.serviceToken; + NagSuppressions.addResourceSuppressions( + customResourceFunction, + [ + { + id: 'AwsSolutions-L1', + reason: 'Lambda runtime version is managed upstream by CDK.', + }, + ], + true, + ); + NagSuppressions.addResourceSuppressionsByPath( cdk.Stack.of(this), `${this.provider.node.path}/framework-onEvent/Resource`, diff --git a/test/integ/chatprompt.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json b/test/integ/chatprompt.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json new file mode 100644 index 00000000..79bdb016 --- /dev/null +++ b/test/integ/chatprompt.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json @@ -0,0 +1,19 @@ +{ + "version": "39.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "ServiceTestDefaultTestDeployAssertE49B1ECE.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/test/integ/chatprompt.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.template.json b/test/integ/chatprompt.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.template.json new file mode 100644 index 00000000..ad9d0fb7 --- /dev/null +++ b/test/integ/chatprompt.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/test/integ/chatprompt.integ.snapshot/aws-cdk-bedrock-chat-prompts-integ-test.assets.json b/test/integ/chatprompt.integ.snapshot/aws-cdk-bedrock-chat-prompts-integ-test.assets.json new file mode 100644 index 00000000..bd445007 --- /dev/null +++ b/test/integ/chatprompt.integ.snapshot/aws-cdk-bedrock-chat-prompts-integ-test.assets.json @@ -0,0 +1,19 @@ +{ + "version": "39.0.0", + "files": { + "751d9794e310a8381601a052b2743bed074e67856b55e6a04bcd73280b8f5284": { + "source": { + "path": "aws-cdk-bedrock-chat-prompts-integ-test.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "751d9794e310a8381601a052b2743bed074e67856b55e6a04bcd73280b8f5284.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/test/integ/chatprompt.integ.snapshot/aws-cdk-bedrock-chat-prompts-integ-test.template.json b/test/integ/chatprompt.integ.snapshot/aws-cdk-bedrock-chat-prompts-integ-test.template.json new file mode 100644 index 00000000..38aec3d0 --- /dev/null +++ b/test/integ/chatprompt.integ.snapshot/aws-cdk-bedrock-chat-prompts-integ-test.template.json @@ -0,0 +1,223 @@ +{ + "Resources": { + "cmk01DE03DA": { + "Type": "AWS::KMS::Key", + "Properties": { + "KeyPolicy": { + "Statement": [ + { + "Action": "kms:*", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": "*" + } + ], + "Version": "2012-10-17" + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "prompt1Prompt7E73129C": { + "Type": "AWS::Bedrock::Prompt", + "Properties": { + "CustomerEncryptionKeyArn": { + "Fn::GetAtt": [ + "cmk01DE03DA", + "Arn" + ] + }, + "DefaultVariant": "variant1", + "Description": "my first chat prompt", + "Name": "prompt-chat", + "Variants": [ + { + "InferenceConfiguration": { + "Text": {} + }, + "ModelId": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":bedrock:", + { + "Ref": "AWS::Region" + }, + "::foundation-model/anthropic.claude-3-5-sonnet-20240620-v1:0" + ] + ] + }, + "Name": "variant1", + "TemplateConfiguration": { + "Chat": { + "InputVariables": [ + { + "Name": "language" + } + ], + "Messages": [ + { + "Content": [ + { + "Text": "From now on, you speak Japanese!" + } + ], + "Role": "user" + }, + { + "Content": [ + { + "Text": "Konnichiwa!" + } + ], + "Role": "assistant" + }, + { + "Content": [ + { + "Text": "From now on, you speak {{language}}!" + } + ], + "Role": "user" + } + ], + "System": [ + { + "Text": "You are a helpful assistant that only speaks the language you`re told." + } + ], + "ToolConfiguration": { + "ToolChoice": { + "Auto": {} + }, + "Tools": [ + { + "ToolSpec": { + "Description": "Get the most popular song played on a radio station.", + "InputSchema": { + "Json": { + "type": "object", + "properties": { + "sign": { + "type": "string", + "description": "The call sign for the radio station for which you want the most popular song. Example calls signs are WZPZ and WKR." + } + }, + "required": [ + "sign" + ] + } + }, + "Name": "top_song" + } + } + ] + } + } + }, + "TemplateType": "CHAT" + } + ] + } + }, + "prompt2PromptEEA87227": { + "Type": "AWS::Bedrock::Prompt", + "Properties": { + "CustomerEncryptionKeyArn": { + "Fn::GetAtt": [ + "cmk01DE03DA", + "Arn" + ] + }, + "DefaultVariant": "variant1", + "Description": "my first text prompt", + "Name": "prompt-text", + "Variants": [ + { + "InferenceConfiguration": { + "Text": {} + }, + "ModelId": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":bedrock:", + { + "Ref": "AWS::Region" + }, + "::foundation-model/anthropic.claude-3-5-sonnet-20240620-v1:0" + ] + ] + }, + "Name": "variant1", + "TemplateConfiguration": { + "Text": { + "Text": "Hey" + } + }, + "TemplateType": "TEXT" + } + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/test/integ/chatprompt.integ.snapshot/integ.json b/test/integ/chatprompt.integ.snapshot/integ.json new file mode 100644 index 00000000..aa48cbac --- /dev/null +++ b/test/integ/chatprompt.integ.snapshot/integ.json @@ -0,0 +1,19 @@ +{ + "version": "39.0.0", + "testCases": { + "ServiceTest/DefaultTest": { + "stacks": [ + "aws-cdk-bedrock-chat-prompts-integ-test" + ], + "cdkCommandOptions": { + "destroy": { + "args": { + "force": true + } + } + }, + "assertionStack": "ServiceTest/DefaultTest/DeployAssert", + "assertionStackName": "ServiceTestDefaultTestDeployAssertE49B1ECE" + } + } +} \ No newline at end of file diff --git a/test/integ/inference-profiles.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json b/test/integ/inference-profiles.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json index 4adbb7de..79bdb016 100644 --- a/test/integ/inference-profiles.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json +++ b/test/integ/inference-profiles.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/test/integ/inference-profiles.integ.snapshot/aws-cdk-bedrock-guardrails-integ-test.assets.json b/test/integ/inference-profiles.integ.snapshot/aws-cdk-bedrock-guardrails-integ-test.assets.json index d9732249..748303f4 100644 --- a/test/integ/inference-profiles.integ.snapshot/aws-cdk-bedrock-guardrails-integ-test.assets.json +++ b/test/integ/inference-profiles.integ.snapshot/aws-cdk-bedrock-guardrails-integ-test.assets.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { "91dac6b16ba4df2701f08f5f6d386e6409d930f45d5e0c62fdcaad8a37cc69b0": { "source": { diff --git a/test/integ/inference-profiles.integ.snapshot/integ.json b/test/integ/inference-profiles.integ.snapshot/integ.json index 48d7dfb3..85db2a8b 100644 --- a/test/integ/inference-profiles.integ.snapshot/integ.json +++ b/test/integ/inference-profiles.integ.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "testCases": { "ServiceTest/DefaultTest": { "stacks": [ diff --git a/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json b/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json index 4adbb7de..79bdb016 100644 --- a/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json +++ b/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/aws-cdk-aoss-dashboard-integ-test.assets.json b/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/aws-cdk-aoss-dashboard-integ-test.assets.json index b1b45db2..80876ab4 100644 --- a/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/aws-cdk-aoss-dashboard-integ-test.assets.json +++ b/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/aws-cdk-aoss-dashboard-integ-test.assets.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { "181da6986985d46e23b14751019080abbf03bbc0a08672bc1215ed7b0913386c": { "source": { diff --git a/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/integ.json b/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/integ.json index bddbe2d0..18a0a264 100644 --- a/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/integ.json +++ b/test/patterns/gen-ai/aws-aoss-cw-dashboard/integ-tests/aws-aoss-cw-dashboard.integ.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "testCases": { "ServiceTest/DefaultTest": { "stacks": [ diff --git a/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json b/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json index 4adbb7de..79bdb016 100644 --- a/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json +++ b/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/ServiceTestDefaultTestDeployAssertE49B1ECE.assets.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/aws-llama-index-data-loader-integ-test.assets.json b/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/aws-llama-index-data-loader-integ-test.assets.json index 6f82b4a2..f3cd84dc 100644 --- a/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/aws-llama-index-data-loader-integ-test.assets.json +++ b/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/aws-llama-index-data-loader-integ-test.assets.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { diff --git a/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/integ.json b/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/integ.json index 2d280671..ad4023b7 100644 --- a/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/integ.json +++ b/test/patterns/gen-ai/aws-llama-index-data-loader/integ-tests/aws-llama-index-data-loader.integ.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "testCases": { "ServiceTest/DefaultTest": { "stacks": [