Integration with AWS Bedrock Converse API.
import { ChatBedrockConverse } from "@langchain/aws";const model = new ChatBedrockConverse({ region: process.env.BEDROCK_AWS_REGION ?? "us-east-1", credentials: { secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY!, accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID!, },});const res = await model.invoke([new HumanMessage("Print hello world")]); Copy
import { ChatBedrockConverse } from "@langchain/aws";const model = new ChatBedrockConverse({ region: process.env.BEDROCK_AWS_REGION ?? "us-east-1", credentials: { secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY!, accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID!, },});const res = await model.invoke([new HumanMessage("Print hello world")]);
Optional
Integration with AWS Bedrock Converse API.
Example