From 059eab1ef40bd95ed403497765c026ab41171c2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:49:46 +0000 Subject: [PATCH 1/2] Bump langchain Bumps the npm_and_yarn group with 1 update in the /appsync-bedrock-subscriptions-cdk directory: [langchain](https://github.com/langchain-ai/langchainjs). Updates `langchain` from 0.0.169 to 0.3.5 - [Release notes](https://github.com/langchain-ai/langchainjs/releases) - [Changelog](https://github.com/langchain-ai/langchainjs/blob/main/release_workspace.js) - [Commits](https://github.com/langchain-ai/langchainjs/compare/0.0.169...0.3.5) --- updated-dependencies: - dependency-name: langchain dependency-type: direct:production dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- appsync-bedrock-subscriptions-cdk/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appsync-bedrock-subscriptions-cdk/package.json b/appsync-bedrock-subscriptions-cdk/package.json index 2b5783c09..eba9598d8 100644 --- a/appsync-bedrock-subscriptions-cdk/package.json +++ b/appsync-bedrock-subscriptions-cdk/package.json @@ -32,6 +32,6 @@ "aws-cdk-lib": "2.80.0", "babel-jest": "^29.7.0", "constructs": "^10.0.0", - "langchain": "^0.0.169" + "langchain": "^0.3.5" } } \ No newline at end of file From 1278b45b4c0fca7d27a5b57f886f4d27a1751a17 Mon Sep 17 00:00:00 2001 From: Marco Jahn Date: Fri, 1 Nov 2024 10:47:44 +0100 Subject: [PATCH 2/2] fixed langchain version changes, updated imports --- appsync-bedrock-subscriptions-cdk/package.json | 4 +++- appsync-bedrock-subscriptions-cdk/src/ask.ts | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/appsync-bedrock-subscriptions-cdk/package.json b/appsync-bedrock-subscriptions-cdk/package.json index eba9598d8..93d526182 100644 --- a/appsync-bedrock-subscriptions-cdk/package.json +++ b/appsync-bedrock-subscriptions-cdk/package.json @@ -17,6 +17,7 @@ "@aws-sdk/protocol-http": "^3.374.0", "@aws-sdk/signature-v4": "^3.374.0", "@types/aws-lambda": "^8.10.125", + "@types/jest": "^29.5.14", "@types/node": "18.14.6", "aws-cdk": "2.70.0", "jest": "^29.5.0", @@ -25,6 +26,7 @@ }, "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.431.0", + "@langchain/community": "^0.3.11", "@smithy/eventstream-codec": "^2.0.12", "@smithy/protocol-http": "^3.0.8", "@smithy/signature-v4": "^2.0.12", @@ -34,4 +36,4 @@ "constructs": "^10.0.0", "langchain": "^0.3.5" } -} \ No newline at end of file +} diff --git a/appsync-bedrock-subscriptions-cdk/src/ask.ts b/appsync-bedrock-subscriptions-cdk/src/ask.ts index 5a547161f..c60740b0e 100644 --- a/appsync-bedrock-subscriptions-cdk/src/ask.ts +++ b/appsync-bedrock-subscriptions-cdk/src/ask.ts @@ -1,7 +1,7 @@ -import { AppSyncResolverEvent } from 'aws-lambda' -import { ChatBedrock } from 'langchain/chat_models/bedrock' -import { AppSyncRequestIAM } from "./appsyncRequest" -import { StringOutputParser } from "langchain/schema/output_parser"; +import { AppSyncResolverEvent } from "aws-lambda"; +import { ChatBedrock } from "@langchain/community/chat_models/bedrock"; +import { AppSyncRequestIAM } from "./appsyncRequest"; +import { StringOutputParser } from "@langchain/core/output_parsers"; const GRAPHQL_URL = process.env.GRAPHQL_URL || ""; const REGION = process.env.REGION || 'us-east-1'; @@ -39,4 +39,4 @@ exports.handler = async (event: AppSyncResolverEvent<{ chatId: string, prompt: s } }) } -} \ No newline at end of file + }