From 2d3a9285348aee63c2867a3c4887beb71df313ae Mon Sep 17 00:00:00 2001 From: Alain Krok Date: Mon, 24 Jun 2024 12:39:48 -0400 Subject: [PATCH] chore(layer): update lambda layer construct and announce deprecation (#531) --- apidocs/classes/QaAppsyncOpensearch.md | 9 --------- layers/langchain-common-deps/requirements.txt | 8 ++------ .../gen-ai/aws-langchain-common-layer/index.ts | 3 +++ .../gen-ai/aws-qa-appsync-opensearch/index.ts | 15 --------------- 4 files changed, 5 insertions(+), 30 deletions(-) diff --git a/apidocs/classes/QaAppsyncOpensearch.md b/apidocs/classes/QaAppsyncOpensearch.md index 1cbf7207..b6b57246 100644 --- a/apidocs/classes/QaAppsyncOpensearch.md +++ b/apidocs/classes/QaAppsyncOpensearch.md @@ -34,7 +34,6 @@ The QaAppsyncOpensearch class. - [securityGroup](QaAppsyncOpensearch.md#securitygroup) - [stage](QaAppsyncOpensearch.md#stage) - [vpc](QaAppsyncOpensearch.md#vpc) -- [CONSTRUCT\_SCHEMA\_UPDATE\_WARNING](QaAppsyncOpensearch.md#construct_schema_update_warning) - [usageMetricMap](QaAppsyncOpensearch.md#usagemetricmap) ### Methods @@ -241,14 +240,6 @@ Returns the instance of ec2.IVpc used by the construct ___ -### CONSTRUCT\_SCHEMA\_UPDATE\_WARNING - -▪ `Static` `Readonly` **CONSTRUCT\_SCHEMA\_UPDATE\_WARNING**: ``"\n Attention QaAppsyncOpensearch users, an update has been made to \n the GraphQL schema.To ensure continued functionality, please review \n and update your GraphQL mutations and subscriptions to align with \n the new schema.This schema update enables enhanced capabilities \n and optimizations,so adopting the changes is recommended. \n Please refer to the construct documentation for details \n on the schema changes and examples of updated GraphQL statements.\n Reach out to the support team if you need assistance \n updating your integration codebase. \n "`` - -Construct warning - -___ - ### usageMetricMap ▪ `Static` `Protected` **usageMetricMap**: `Record`\<`string`, `number`\> diff --git a/layers/langchain-common-deps/requirements.txt b/layers/langchain-common-deps/requirements.txt index 2439af05..ac4ac9d8 100644 --- a/layers/langchain-common-deps/requirements.txt +++ b/layers/langchain-common-deps/requirements.txt @@ -1,7 +1,3 @@ -boto3>=1.34.29 -botocore>=1.34.29 -requests==2.32.0 -requests-aws4auth==1.2.3 langchain==0.2.5 -opensearch-py==2.4.2 -openai==1.10.0 +langchain-community==0.2.5 +langchain-aws==0.1.6 diff --git a/src/patterns/gen-ai/aws-langchain-common-layer/index.ts b/src/patterns/gen-ai/aws-langchain-common-layer/index.ts index 2549aed2..919a208f 100644 --- a/src/patterns/gen-ai/aws-langchain-common-layer/index.ts +++ b/src/patterns/gen-ai/aws-langchain-common-layer/index.ts @@ -11,6 +11,7 @@ * and limitations under the License. */ import * as path from 'path'; +import { Annotations } from 'aws-cdk-lib'; import * as lambda from 'aws-cdk-lib/aws-lambda'; import { Construct } from 'constructs'; import { Layer } from '../../../common/helpers/python-lambda-layer-helper'; @@ -108,6 +109,8 @@ export class LangchainCommonLayer extends Construct { constructor(scope: Construct, id: string, props: AdapterProps) { super(scope, id); + Annotations.of(scope).addWarningV2('@cdklabs/generative-ai-cdk-constructs:LangchainCommonLayer.deprecation', 'This construct is deprecated and will not receive further support. It will be removed in the next release of the library.'); + const layer = new lambda.LayerVersion(this, 'Model Adapter Layer', { code: lambda.Code.fromAsset(path.join(__dirname, '../../../../layers/langchain-common-layer')), description: 'Utilities to instantiate a llm client adapter. Adapters include bedrock, sagemaker, and openai', diff --git a/src/patterns/gen-ai/aws-qa-appsync-opensearch/index.ts b/src/patterns/gen-ai/aws-qa-appsync-opensearch/index.ts index 336c11d1..d0239576 100644 --- a/src/patterns/gen-ai/aws-qa-appsync-opensearch/index.ts +++ b/src/patterns/gen-ai/aws-qa-appsync-opensearch/index.ts @@ -148,21 +148,6 @@ export interface QaAppsyncOpensearchProps { * @summary The QaAppsyncOpensearch class. */ export class QaAppsyncOpensearch extends BaseClass { - /** - * Construct warning - */ - public static readonly CONSTRUCT_SCHEMA_UPDATE_WARNING=` - Attention QaAppsyncOpensearch users, an update has been made to - the GraphQL schema.To ensure continued functionality, please review - and update your GraphQL mutations and subscriptions to align with - the new schema.This schema update enables enhanced capabilities - and optimizations,so adopting the changes is recommended. - Please refer to the construct documentation for details - on the schema changes and examples of updated GraphQL statements. - Reach out to the support team if you need assistance - updating your integration codebase. - `; - /** * Returns the instance of ec2.IVpc used by the construct */