diff --git a/appsync-bedrock-subscriptions-cdk/package.json b/appsync-bedrock-subscriptions-cdk/package.json index 2b5783c09..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", @@ -32,6 +34,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 +} 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 + }